Product Hits integration principles

For different purposes, AB Tasty lets you save the data related to what kind of product your visitors view and add to their cart during their visits on your website. This integration enables AB Tasty to offer you complementary services to improve your testing and personalization strategy. 

We built two in-house targeting criteria to help our customers to go further in their experimentation and personalization strategy:

  • Cart abandonment: these criterion helps our user to target their “abandonist” visitors 
  • Content interest: this criterion helps identify and target visitors based on their specific interests detected on your website. It can either work through the page title (which it does natively) or through product hits that you can send us if you find it more accurate. The hit product integration will also allow AB Tasty to display some conversion data on content interest audiences.

To make those solutions work, we just need some data that our generic tag can not properly detect, read, and interpret. To answer that limitation, we developed a specific JS function, that we call “product hit”, for you to send us the right data in the right context, which we will leverage in the AB Tasty platform to offer you new services (inside the targeting for example). 

To send those product data to AB Tasty, you need to add a Javascript script on every product page, while your visitors are doing two types of events: viewing a product (i.e: loading any product page), and adding a product to their cart.

To learn how-to integrate Product hits, refer to How to integrate Product hits.

What to implement for the Cart abandonment criterion

We are going to see how the hit JS event is built, with a quick overview of its key components.

window.abtasty.send("product", {
pit: "CART_ITEM",
pcid: yourCartIDVariable,
pq: yourProductQuantityVariable,
pp: yourProductPriceVariable,
ps: yourProductSKUVariable,
pn: yourProductNameVariable
});

The event uses the ‘window.abtasty.send’ function to call the global ‘abtasty’ object integrated into your website through the generic tag. This is how the collection will work. The script will pass some specific product data to our generic tag to be sent to our data pipeline. From this collection, we can build up services for you to leverage those data.

Inside the script, you will find a list of parameters that you will need to fill in to send us the appropriate data depending on your visitor's context. Some parameters are mandatory for some specific kind of hits, defined by the first parameter, the product interaction type (first line of the following table). Apart from that, to succeed in your implementation, you just need to respect the value type of each parameter and link the right data on your side to the right parameters. Let’s deep dive into each parameter:

Parameter Value  Definition Mandatory Example
‘pit’ (product interaction type) Two values are possible:
  • ‘CART_ITEM’: when a new item is added to your visitor card
  • ‘CART_TOTAL’: when you want to declare an entire cart being initiated
Coincides with the type of action we want to track.  Yes
pit:“CART_ITEM”;
‘pcid’ (product cart id) String value. You can insert here the ID of the cart you are collecting Coincides with the ID of the cart initiated by your visitor. Yes
pcid: “CARTPROD0001”;
‘Pq’ (product quantity) Integer value. This parameter accepts only numbers Coincides with the number of products inside the visitor cart  Yes
pq: “5”;
‘pp’ (product price) Float value. This parameter accepts any numbers Coincides with:
  • The product price for the ‘CART_ITEM’ scenario
  • The total cart amount for the ‘CART_TOTAL’ scenario
Yes
pp: “15.99”;
‘ps’ (product SKU) String value. Coincides with the ID of the product concerned with the page view or product put into the cart Yes
ps: “ECOMPROD0001” 
‘pn’ (product name) String value Coincides with the name of the product. It should be an exhaustive reference to the product concerned with the visitor's action  No
pn: “Super basket 5008” 

You can refer to our technical documentation just here.

What to implement for the Content Interest criterion

Please refer to our specific documentation about the criterion in themselves to have a wide overview of how the criteria work. 

The hit product is not mandatory to use this segmentation criterion. It works with page titles and the generic tag can analyze and recognize some content interests based on general navigation data. 

But to go further with the analysis of your content interest audiences, we created in our targeting interface a table with both traffic and conversion data. And this is where the hit product integration comes in: to reconcile a specific product with a specific transaction, we need you to send us the right information when a visitor sees a product. With that good setup, you will be able to have precise conversion data for every content interest audience, and base your decisions on those every time you are setting up a campaign!

We are going to see how the hit JS event is built, with a quick overview of its key components.

window.abtasty.send("product", {
pit: "VIEW",
pp: yourProductPriceVariable,
ps: yourProductSKUVariable,
pn: yourProductNameVariable
});

The event uses the ‘window.abtasty.send’ function to call the global ‘abtasty’ object integrated into your website through the generic tag. This is how the collection will work. The script will pass some specific product data to our generic tag to be sent to our data pipeline. From this collection, we can build up services for you to leverage those data.

Inside the script, you will find a list of parameters that you will need to fill in to send us the appropriate data depending on your visitor's context. Some parameters are mandatory for some specific kind of hits, defined by the first parameter, the product interaction type (first line of the following table). Apart from that, to succeed in your implementation, you just need to respect the value type of each parameter and link the right data on your side to the right parameters. Let’s deep dive into each parameter:

Parameter Value  Definition Mandatory
‘pit’ (product interaction type) ‘VIEW’: when a product is being viewed by your visitor. The hit we are about to collect is about a visitor that is viewing a specific product during its navigation. This is a default value that you won’t have to change.  Yes
‘pp’ (product price) Float value. This parameter accepts any numbers Coincides with the product price the visitor is seeing   No (but recommended)
‘ps’ (product SKU) String value. Coincides with the ID of the product being viewed Yes
‘pn’ (product name) String value Coincides with the name of the product. It should be an exhaustive reference to the product concerned with the visitor's action  No (but recommended)

You can also refer to our technical documentation just here.

Was this article helpful?

/