Skip to main content

Tracking manager

Tracking Manager lets you captures shopper behavior as it happens on the page: button clicks, product views, add-to-cart events, and purchases.

Set it up once, and Zoovu automatically generates your Discovery Impact Report: a clear view of how your Zoovu experiences influence real purchases across your site. You can also pipe the same data to Google Analytics, Adobe Analytics or any BI tool you already use.

To activate the tracking manager, please contact your Zoovu representative or send a message to the Customer Success Team

Every setup follows the same three steps:

  1. Create a tracking script in the Zoovu platform.
  2. Publish and embed it on every page where tracking should run.
  3. Send events - either using rules you set up in the platform or by calling the tracking methods via API.

Step 1: Create a tracking script

Before you decide how to send events, you need a script. The script can be published and embedded even while empty (you don't need rules in place before deploying it).

  • Go to Zoovu Home > Tracking manager
  • Click the Scripts tab
  • Select Create tracking script.

Scripts

All events tracked under a script are linked to its domain configured in Zoovy Home > Domain.


Step 2: Choose how to send events

Once the script exists and is embedded, you have two ways to send events. Both produce the same result.

Option 1 - Rules and variables

You define triggers and variables inside Tracking Manager. The script monitors the page and fires events automatically when conditions are met.

This approach is best for standard events where you want to keep all tracking logic inside Zoovu.

Option 2 - Window API

Add tracking calls to your website code. The script just needs to be embedded and it doesn't need any rules.

This approach is best if you want direct control over when and how events fire.

You can use both approaches together. Rules handle the events you configure; API calls handle anything you prefer to manage yourself.

Example: Tracking Add to Cart

Here'a an example of the same event, implemented both ways:

Option 1: rules approach

You configure everything in Tracking Manager:

  1. Create a trigger that listens for a click on the Add to Cart button
  2. Create variables that read data from the page (e.g. price, SKU)
  3. Write a rule: When Add to Cart is clicked, send Add to Cart event with those variables
  4. Publish and embed the script

Example trigger:

ConditionOperatorValue
Page URLcontains&productId=
Event targetmatches CSS selectorbutton#add-to-cart

Option 2: API approach

Add one line to your Add to Cart button handler:

window.zoovutracking.sendAddToCart(price, otherArguments)

Step 3: Configure rules (Option 1)

Skip this section if you're using the API approach.

Rules are the building blocks of platform-managed tracking. Each rule has two parts:

  • When - the trigger (a condition that must be true)
  • Then - the action (what happens when the condition is met)

Triggers

Triggers evaluate to true or false and determine whether a rule runs. They can listen for:

  • Click events - fires when a user clicks a specific element
  • Page load events - fires when a page loads or the URL changes
  • AND / OR conditions - combine multiple conditions to control when a rule activates

Tracking in Single Page Applications

SPAs don't reload the page during navigation, so standard page load triggers won't fire. Instead, the script monitors URL changes to detect page transitions.

Example: a user navigating from /products/123 to /cart triggers the event when the URL changes.

Variables

Variables pull dynamic values from the page at the moment an event fires - for example, price, SKU or quantity.

Variable types:

  • Function - a JavaScript snippet that reads a value from the page
  • Constant - a fixed value that never changes

Return types (the returned value must match the selected type):

  • TEXT - string values (e.g. product SKU, user ID)
  • NUMBER - numeric values (e.g. price, quantity)
  • BOOLEAN - true/false
  • LIST - array of values

If the returned value doesn't match the expected return type, the rule won't execute and an error will show up in the console.

Default variables available out of the box:

  • Current page URL
  • Event target (the element that triggered the event)
  • Event target's parent element
Example: extract SKU from a product page
const skuElement = document.querySelector('#product-details-sku');
return skuElement.innerHTML;
Example: extract SKU from a clicked product in a list
const clickedProductContainer = event.target.parentElement;
return clickedProductContainer.querySelector('#product-details-sku').innerHTML;

Actions

Actions define what happens when a trigger fires:

  • Predefined events (e.g. Add to Cart, Purchase) - sent directly to the tracking system
  • Custom actions - for advanced scenarios, such as storing data in localStorage to retrieve later on the Thank You page

Custom actions have access to the trigger's event object, the same as variables do.

Use Advanced Mode only when standard tracking options aren't enough. Code in Advanced Mode runs before all rules, on every page load.


Step 4: Publish and embed the script

After configuring your script (or even before that - if you're using the API approach), click Publish.

All future updates apply automatically when the script runs - you won't need to re-embed after publishing changes.

Embed the script

  • Click Generate Integration Code
  • Copy the JavaScript snippet
  • Paste it before the closing </head> tag on every page where tracking should run, including cart and checkout pages

The integration tag never changes between publishes. You only need to embed it once.

Test rules before full integration

To test rules before embedding the script, inject it temporarily using a browser plugin:

  1. Copy the src URL from your integration code:

    https://services.zoovu.com/events/user-tracking-script/[your-script-id]/js-loader
  2. In the browser plugin, create this snippet:

    let scr = document.createElement('script');
    scr.setAttribute('src', 'your-src-url-here');
    document.head.appendChild(scr);
  3. Run it on the target website.

Verify the script is running

  1. Open browser DevTools (F12)
  2. Go to the Network tab
  3. Filter by zoovu
  4. Look for requests starting with https://services.zoovu.com/
  5. If the js-loader request appears, the script is integrated correctly

Debugging

Check that events are being sent

  • Open DevTools → Network tab
  • Filter by /fact to find tracking event requests
  • Click a request to inspect its payload and verify the event data

View error messages

Tracking errors are hidden by default. To see them:

  • Open DevTools → Console tab
  • Set the filter to Verbose
  • Look for errors related to tracking values or missing data

Reference

Script API

Available in custom actions, variables, and Advanced Mode:

NameTypeAvailabilityDescription
eventObjectVariables, Custom ActionsThe event object issued by the trigger
disableTracking()FunctionVariables, Custom Actions, Advanced ModeDisables tracking
enableTracking()FunctionVariables, Custom Actions, Advanced ModeRe-enables tracking
getNumericPriceFromString()FunctionVariables, Custom ActionsReturns a price string as a number (e.g. 1113.33)

Copy a tracking script

To duplicate an existing script:

  • In the Scripts tab, select the script to copy
  • Click the duplicate option
  • Assign the same domain or a different one
  • The copy includes all rules, referencing the same triggers and variables

  • The tracking script reuses the zoovu-cid cookie if it already exists from other Zoovu experiences on the same site.

Compliance

  • Users must be able to opt in or opt out depending on your legal requirements (GDPR, etc.)
  • The DECLINE_TRACKING event logs refusals and automatically disables tracking

Disable and re-enable tracking

Tracking is enabled by default. To disable it:

  • Call disableTracking() in a custom action or Advanced Mode
  • Send the DECLINE_TRACKING event - this calls disableTracking() automatically

Re-enable at any time with enableTracking().