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.

Add to cart

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: });</script>

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

Basket add

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.

Trigger type

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

Trigger configSave your trigger and tag, publish your Tag Manager container.