DocsUser guides

How to track adds to basket in Custobar using Google Tag Manager?

Integrations

How to track adds to basket in Custobar using Google Tag Manager?

Are you looking fo a way to track your identified customers when they add something to their shopping cart online? And you use Google Tag Manager? Here's how to do it.

Firstly, make sure you have completed the base setup of Custobar tracking in GTM.

Let's get started

Your ecommerce solution should create an add_to_cart event when an item is added to theshopping cart. We will use that event to fire our BASKET_ADD tag.

Go ahead and create a new tag, give it a name and choose Custom HTML as your tag type.

They you will need to paste the following script to the HTML window.

<script>window.cstbr.push({type: 'BASKET_ADD',product_id: {{DLV - Product ID}}});</script>

Remember to double check that you use the right data layer variable for product ID.

Scroll down and add a trigger to your tag. Click + sign to create a new trigger.

Give your trigger a descriptive name and Choose Custom Event as your trigger type.

Name your trigger and add your add_to_cart ecommerce event as the triggering event name.

Save your trigger and tag, publish your Tag Manager container.