Skip to main content
All CollectionsIntegrationsSendLane
Create Add to Cart, Viewed Product and Checkout Started events for Sendlane
Create Add to Cart, Viewed Product and Checkout Started events for Sendlane
Updated over 2 months ago

The Reclaim feature can identify abandoned cart and viewed product events for both unknown, non-logged in users and known, non-logged in customers. If you use this feature, we will send all of those Add To Cart events, Viewed Product events and/or Checkout Started events to you.

To use this feature, you must first ensure that you’re using 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.

You also need to setup the Sendlane V2 integration, and here's how to do that.

Set up Add to Cart script

1. In your site builder, add the Add To Cart script— 'geq.addToCart(item)' —to the on-click event for adding an item to your cart, such as an "Add To Cart" button. Below is the generic code for buttons.

Remember: The name of the button should match what is in quotes below ( "AddToCart" ) to fire properly. So, if your button isn't "AddToCart", you'll need to update that in the script provided below.

Generic code for buttons defined by a button ID:

<script type="text/javascript">
  document.getElementById("AddToCart").addEventListener("click", function () {
    geq.addToCart(item);
  });
</script>

Generic code for button defined by a class notation:

<script type="text/javascript">
  document.getElementsByClassName("AddToCart").addEventListener("click", function () {
    geq.addToCart(item);
  });
</script>

Set up Viewed Product script

If you have an existing Viewed Product tracking script installed on your site, add this below it:

<script>
  geq.event("Viewed Product Reclaim", item);
</script>

If you do not have an existing Viewed Product tracking script, add this to your theme:

<script type="text/javascript">
  var item = {
  Name: ##{{ product.title|json }},
  ProductID: ##{{ product.id|json }},
  ImageURL: "https:##{{ product.featured_image.src|img_url:'grande' }}",
  URL: "##{{ shop.secure_url }}##{{ product.url }}",
  Brand: ##{{ product.vendor|json }},
  Price: ##{{ product.price|money|json }},
  CompareAtPrice: ##{{ product.compare_at_price_max|money|json }}
  };
  geq.event('Viewed Product Reclaim', item);
</script>

Create Add To Cart, Viewed Product and Checkout Started events

Note: The custom event names 'Add To Cart Reclaim', 'Viewed Product Reclaim' and 'Checkout Started Reclaim' are case sensitive. They must be entered as presented for the integration to function properly.

1. Once you've added the script(s) and set up the Sendlane V2 integration, go to Integrations > Events in Sendlane (for the custom integration you created previously).

2. Click Create Event.

3. Name the event Add To Cart Reclaim. Click Create.

4. Repeat the steps to create the Viewed Product Reclaim and Checkout Started custom event.

5. Ask your client success manager to send a test event for Add To Cart, Viewed Produt and/or Checkout Started. Once those are sent, they will appear in Integrations > Events for the custom integration created.

Create automation

1. Copy your existing Add To Cart or Viewed Product automation by going to Automations > Duplicate Automation.

2. Name the automation Add To Cart Reclaim, Viewed Product Reclaim or Checkout Started Reclaim, and click Duplicate.

3. Click to edit the automation, and click Add trigger. Select Custom > Custom Event.

4. Choose the Store where our events were sent. Select either Add To Cart Reclaim, Viewed Product Reclaim or Checkout Started Reclaim from the Event drop-down.

View Reclaim events

You can see these events successfully passing through in your Retention.com account when you see the Added To Cart option populate under Event Details. This is an easy way to confirm that our events have been successfully implemented.

You can also view Viewed Product Reclaim and Checkout Started Reclaim events populate in Event Details.

Have questions? Message us on chat or email us at support[at]retention.com!

Did this answer your question?