How to set up cart tracking

How to set up cart tracking

  • updated 1 yr ago

   

Allow Hello Retail to track cart content

First, you have to allow Hello Retail to track cart contents. This information is needed to send out personalized abandoned cart email notifications, as of Triggered emails, featuring the image, title, and price of the product the customer has left behind.

Hello Retail must be correctly installed on your website before you try to set up abandoned cart notifications.

Correctly installed means you have:

  1. added the Hello Retail javascript and checked that the script is running correctly. Find a guide here.
  2. supplied us with your product data by giving us the URL to your product feed or adding the Hello Retail product span. Find a guide .
  3. provided us with conversion data by adding the Hello Retail conversion span. Find a guide here.

How can I do this?

a) JavaScript method

Find much more info about the cart tracking part of the javascript API here: https://developer.helloretail.com/sdk/tracking/cart_tracking/

b) HTML-span

You can do this by adding a span into the HTML of your webshop's pages. A span is a small piece of code that will allow Hello Retail to collect data about the contents of the cart every time a user views a page where the span is placed. Spans should always be in the body of your HTML (in between <body> and</body>). 

This is how the span looks, using product URLs as a reference to the products in the cart:

<span class="addwish-cart" style="display:none" data-url="http://example.com/cart/id/789" data-total="150.50" data-email="customer@example.com">
<span class="addwish-product" data-url="http://example.com/product/456.html">
</span>
<span class="addwish-product" data-url="http://example.com/product/2234.html">
</span>
</span>

This is how the span looks, using product numbers as a reference to the products in the cart:

<span class="addwish-cart" style="display:none" data-url="http://example.com/cart/id/789" data-total="150.50" data-email="customer@example.com">
<span class="addwish-product" data-productnumber="p-456-2">
</span>
<span class="addwish-product" data-productnumber="p-2234">
</span>
</span>

The first and last span tags are called the root span. The other spans on the inside are called the inner spans (or product spans).

  • The data-URL attribute in the first line of the span (root span) is optional. If you have a URL that will lead directly back to the cart, you can include it here. This will allow you to link directly back to the abandoned cart in your notifications.
  • The data-total attribute in the root span is required. This should contain the total value of the visitor's cart. Please note: The total cart value amount should be formatted with a. (dot) as decimal separator.
  • The data-email attribute in the root span is especially useful when tracking carts with the intent to send out abandoned cart emails. This is used to associate an already known email with the cart. This could be if the user is already logged in - then you can associate the user's email address with the current cart.
  • Inside the root, a span is several product spans. There should be one of these for every product in the cart. If the cart is empty, there are no product spans. Hello Retail can see that the cart is empty because the root span will still be there.
  • In each product span, you can choose to reference products in the cart either by URL or product number. If referencing the product URL, the data-URL attribute must contain the canonical URL for the product. If referencing the product number, the data-product number should be the product number.
Like Follow
  • 1 yr agoLast active
  • 2697Views
  • 1 Following