This feature can identify abandoned cart and viewed product events WooCommerce. If you use this feature, we will send all of those Add to Cart and Viewed Product events to you.
To use this feature, you must have the most recent version of our script on your website. You can find your script in your account under Code Script > View Script. Click here for a link to all our tutorials on how to add the script to your site, in case you need a refresher.
Our Add to Cart and Viewed Products scripts must be installed below where you have the existing item variable in the script.
Note: Since the tags, templates, and variables in WooCommerce are part of a unique set up for your brand, your developer will need to manage the set up process for our scripts. We cannot offer support on WooCommerce installs.
Here is an example of the Add to Cart script you can use, but you will need to update the button class name to match the specific one for your site. Also, the script will need to be updated if you're using different variables:
<script type="text/javascript"> var add_to_cart_product = {}; var item_classnames = document.getElementsByClassName("single_add_to_cart_button"); for (var i = 0; i < item_classnames.length; i++) { item_classnames[i].addEventListener('click', function () { add_to_cart_product = { 'Name': item.title, 'ImageURL': item.image_url, 'URL': item.url, 'Price': item.price, 'ProductID': item.product_id, 'VariantID': item.variant_id, 'Categories': item.categories }; geq.addToCart(add_to_cart_product); }); } </script>
Here is an example of the Viewed Product script you can use. The script will need to be updated if you're using different variables:
<script type="text/javascript"> let productItem = { Name: item.title, ImageURL: item.image_url, URL: item.url, Price: item.price, ProductID: item.product_id, VariantID: item.variant_id, Categories: item.categories }; geq.event('Viewed Product Reclaim', productItem); </script>
Note: Once the scripts are set up, ask your client success manager to send a test Add to Cart and/or Viewed Product event.
You can see these events successfully passing through in your Retention.com account. This is an easy way to confirm that our events have been successfully implemented.
Go to Event Details > Added to cart:
Or Event Details > Viewed Product Reclaim:
Have questions? Message us on chat or email us at support[at]retention.com!