# User Flow & E-Commerce

Ondeva gives you precise control over user access, session behavior, and monetization flows. These steps are essential for any SaaS or productized app built on Ondeva — enabling authentication, license enforcement, and seamless e-commerce actions from within workflows.

### **Login**

**Purpose:**

Forces the user to authenticate. If already logged out, they’ll be redirected to the login page and returned to their current screen upon success.

**When to Use:**

* Guard protected content
* Require login before form submission
* Secure workflows that write to user-specific data

***

### **License Enforcing**

**Purpose:**

Checks whether the user has a valid license (or set of licenses). If the check fails, the user is blocked from progressing.

**Key Options:**

* **License Selection**: Choose one or more required licenses

**When to Use:**

* Gate workflows or features based on paid plan
* Handle upsells for premium components
* Limit access to internal tools or downloads

***

### **Add Item to Cart (E-Commerce)**

**Purpose:**

Adds a product or license to the current user’s shopping cart.

**Key Options:**

* **Product / License**: Select the item to be added
* **Clear Cart First**: Optional — clears the current cart before adding the new item

**When to Use:**

* Trigger a checkout flow (e.g. “Buy Now” button)
* Offer upgrade paths (add license for additional features)
* Support dynamic pricing tiers or modular subscriptions

***

### **Register Session**

**Purpose:**

Logs a session-level tracking entry with optional metadata for analysis. The Session ID is stored in a variable: `{var_sessionId}`

**Key Options:**

* **User ID** (optional)
* **Session ID** (optional)
* **URL** (context page)

**When to Use:**

* Record usage sessions for metrics
* Tie workflows to performance data
* Build your own internal analytics pipeline

***

### **Register Page View**

**Purpose:**

Tracks a page visit for the current session and user. The Visit ID is stored in a variable: `{var_visitId}`

**Fields:**

* **User ID** (optional)
* **Session ID** (optional)
* **URL** (context page)

**When to Use:**

* Funnel tracking
* Custom conversion attribution
* Heatmap or flow visualization features

***

### Best Practices

* Combine **License Enforcing** with **Design Visibility** rules for a seamless UX.
* Use **Add to Cart** in pricing tables, modals, or gated content dialogs.
* Log sessions and page views if you want to collect analytics event from other sources then the automatic tracking of Ondeva’s analytics system.
