> ## Documentation Index
> Fetch the complete documentation index at: https://developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Web activity tracking

> How Customer Engagement collects checkout, shopping cart, and product view data from your website, and what that data is used for.”

Web activity tracking gathers three kinds of behavioral data from your website to Customer Engagement:

* checkout changes
* shopping cart changes
* product views

Customer Engagement links that data to a contact, either immediately or later once the visitor is identified, and uses it to trigger automations and personalize communication.

Visitor activity is tracked whether or not they are identified. Anonymous activity is stored in the browser and connected to a contact as soon as that visitor is identified.

## What it enables

| Feature | What it needs |
| - | - |
| **Abandoned checkout (beta)** — trigger an automation when a checkout is not completed (no purchase happened) | A product feed, the tracking script, and [checkout tracking](https://developer.voyado.com/docs/tracking/tracking-checkout-changes.md) |
| **Abandoned cart** — trigger an automation when a cart is left behind | A product feed, the tracking script, and [cart tracking](https://developer.voyado.com/docs/tracking/tracking-cart-changes.md) |
| **Abandoned browse** — trigger an automation when a visitor browses but adds nothing to the cart | Everything for abandoned cart, plus [product view tracking](https://developer.voyado.com/docs/tracking/tracking-product-views.md) |
| **Products of interest** — a per-contact list of up to 25 products, usable in segmentation | A product feed, the tracking script, and [product view tracking](https://developer.voyado.com/docs/tracking/tracking-product-views.md) |
| **Product recommendations** — personalized recommendations in emails | Products of interest, which are combined with purchase and return history |

> [card] [More about abandoned cart and abandoned browse](https://help.engage.voyado.com/hc/en-gb/sections/17212833070492-Abandoned-cart)

## Two ways to send the data

The two ways of implementing tracking are:

* With the tracking script
* With the tracking API

Almost all implementations use the *tracking script*. However the tracking API also exists for cases where a script can't be used, but this shifts more of the work onto you.

| | Tracking script | Tracking API |
| - | - | - |
| Anonymous visitors | Tracked | **Not possible** — `contactId` is required |
| Identified visitors | Tracked | Tracked |
| `sessionId` | Added automatically | You must add it to every payload |
| Cookies and identification | Handled by the script | You must handle it yourself |
| Identifying visitors arriving from email links | Automatic, from the `vtid` URL parameter | You must read `vtid` and pass it as `contactId` |

## Key terms

| Term | What it means |
| - | - |
| Client ID | An ID the script generates to represent a **browser**. Stored in the `_va` cookie. |
| Contact ID | The Customer Engagement ID of an **identified contact**. Stored in the `_vaI` cookie. |
| `vtid` | A query parameter added to links in Customer Engagement emails. Holds the contact ID in encoded form. |
| `sessionId` | A unique ID for one browsing session. Customer Engagement uses it to decide whether abandoned cart or abandoned browse should trigger. |
| Collect endpoint | The endpoint the tracking script posts to. It is **not** part of the Customer Engagement REST API — it is used only by the tracking script. |
| `cartRef` | Your own unique reference for one shopping cart. It must stay the same for that cart's entire life. |
| `itemId` | The product identifier you send. Matched against the SKU in Customer Engagement. |
| `locale` | The language/market of the site, as an IETF language tag such as `sv-SE`. Must match a product feed in Customer Engagement. |

> [!TIP]
>
> `_vaI` is `_va` followed by an uppercase letter **I** (I as in Ingemar), not a lowercase L. The two are hard to tell apart in many fonts.

## Where to start

**1. Configure a product feed in Customer Engagement**

Cart and product view data is enriched from the product feed. Without a feed for the relevant locale, no automation can trigger.

> [card] [Set up a product feed](https://developer.voyado.com/docs/setup/product-feeds.md)

**2. Implement the tracking script**

One snippet, on every page of the site.

> [card] [The tracking script](https://developer.voyado.com/docs/tracking/tracking-script.md)

**3. Identify your visitors**

Call `setContactId()` at the moment your site identifies someone, and understand how the cookies work.

> [card] [Identification and cookies](https://developer.voyado.com/docs/tracking/identification-and-cookies.md)

**4. Send cart and product view events**

Track every cart change, and every product view.

> [card] [Tracking cart changes](https://developer.voyado.com/docs/tracking/tracking-cart-changes.md)

> [card] [Tracking product views](https://developer.voyado.com/docs/tracking/tracking-product-views.md)

**5. Verify the implementation**

Work through the checklists before going live.

> [card] [Verifying and troubleshooting](https://developer.voyado.com/docs/tracking/verifying-web-tracking.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.