Actions Tracking

It's possible to track activity on your e-commerce website, such as cart additions, purchases made, favorite article additions and more. When a trigger is configured, the tracked action is stored in Recommendations when the event occurs. These tracked events are mainly used for analytics purposes and are configured through the Recommendations dashboard.


Configure user-product interactions

These user interface actions can be used as a complement to the standard “view” and “follow” actions, to help determine the final recommended products.

To track activity on the cart

Action name — For example ‘Carts’ or ‘Purchases’. What follows will describe what is considered as a cart addition/purchase. ‘Carts’ and ‘Purchases’ are standard predefined actions. Other custom actions can be created (i.e. ‘trailerLaunched’, ‘openQuickView’, etc…). You can choose the name freely (only letters, numbers and ‘-‘ allowed).

Triggers — This defines which consumer interaction will lead to a cart addition: you can choose from a click on a button, in a DIV, or a form submission event. You can add as many triggers as required for one action and when one if these triggers fires, the action is considered as executed and will be saved.

Where clause — To define which button, DIV, FORM SUBMIT should be tracked you have to add a condition on the ID, Name, Class or action. These are HTML attributes which can easily be found inside the HTML code of your page. Ask your website designer for this information.

By default, when an action is triggered, the actual product on which the user performs the action is defined by the page itself. For example, if the user is located on a product page and clicks on the add to cart button on the page, the “cart” event will be triggered for this user on the product contained on the page. The system figures out what product is on this page based on different criteria (such as the URL of the page or the product ID that is contained inside the page).

In some cases you may want to pass the product ID to the event trigger instead of letting the system automatically detect the page on which the user is (e.g. via a product ID contained in the URL).
This may be needed when there are multiple products on the page (category), and therefor multiple add-to-cart buttons (for example). In that case you can click on the ‘Retrieve PID’ checkbox and set up the ‘HTML property name’, from which to read the product ID.

For example, you may have a button like this:
<button id=”my-button” data-pid=”123456”></button>

In that case, you would check the ‘Retrieve PID’ checkbox and configure the ‘HTML property name’ to be: data-pid. When a user clicks on the button, the add-to-cart will be recorded for the product with PID 123456 (if this product is part of the product catalog).

It may happen that instead of having the exact PID character value, it may be encapsulated within some other text. In that case, you can use an ‘optional extractor’ (which is technically called a regular expression).

For example, this would allow you to extract the PID from a button:
<button id=”my-button” product-image=””></button>

Note: Since this is a rather technical topic, we advise you to get in touch with your Marigold contact to help you fine-tune these settings.