Website Retargeting: Tag Implementation for an Add to Cart Event

LiveIntent Website Retargeting for Advertisers captures shopper behavior on an advertiser’s website for the purpose of informing data-driven ads in LiveIntent inventory.  The insights collected include products views, shopping carts, and purchases.  These intent insights power dynamic ad creative for customers with products they have interacted with, or relevant up-sells and cross-sells. LiveIntent calculates the best product to display to each individual customer, with the goal of efficiently producing a conversion.

LiveIntent is able to accomplish this via our Website Retargeting Tag, in addition to the advertiser’s product feed.  The Website Retargeting Tag loads asynchronously and does not influence page load times or other aspects of the user experience of your website.


Time for Completion: 10 minutes



This event is meant to be used on pages where the basic script is already loaded and there is a chance to add a product to the cart without actually visiting the cart page afterwards. For example on a category page with several products on it it is possible to add a product to the cart without leaving the page.

You could call the event "addToCart" for example when a users clicks on the button to add the product to the cart.


Example setup for an add to cart event

<script type="text/javascript">
window.liQ = window.liQ || [];
 { event: "addToCart", items: [{id: "3983rjk2jr432r", price: 12.32 , quantity: 1, currency: "USD"}]},


{ event: "addToCart", items: [{id: "3983rjk2jr432r", price: 12.32 , quantity: 1, currency: "USD" }]}
event static string, "addToCart"    
items    Array    id string, contains the product ID from the cart page, those IDs need to match with the product IDs we receive from the product catalog feed.
price number, two decimals
quantity number, how many of the same product
currency Three character string with ISO currency format (



{ event: "setEmail", email: "" }
{ event: "setHashedEmail", hashedEmail: "169003b1f9b7897147ddf7008e3ff649" }
  • You can send the setEmail or setHashedEmail event at any time. Not only on a page view, but also when a form is submitted. 
  • SetEmail is expecting an unencrypted email address. The tag makes sure that LiveIntent will only receive an encrypted email address as a hash. LiveIntent will never receive plain text email addresses.
  • SetHashedEmail is expecting to have a trimmed and all lower case email address before encrypted into a hash. If you don't lowercase and trim the email address before encryption, this will result in the inability to target the user or make them part of the targetable retargeting segment. For example: The encrypted hash of results in a different hash value than
Was this article helpful?
0 out of 0 found this helpful
Powered by Zendesk