Skip to main content
All CollectionsAdd Events
How To Setup Add To Cart & Initiate Checkout Events
How To Setup Add To Cart & Initiate Checkout Events

Learn how to setup the Add To Cart and Initiate Checkout (ATC & IC) events for your Ecommerce store.

Updated this week

Start Here πŸ‘‹

This article will show you step-by-step how to setup tracking for the Add To Cart and Initiate Checkout events for your Ecommerce store.


How to setup a new Google Tag Manager web container

*Skip this step if you already have Google Tag Manager setup on your Ecommerce store.
​
Google Tag Manager is a tag management system (TMS) that allows you to quickly and easily update measurement codes and related code fragments collectively known as tags on your website.


How to install Google Tag Manager in your Ecommerce store

*Skip this step if you already have Google Tag Manager setup on your Ecommerce store.
​

Please watch the video below for how to successfully install Google Tag Manager codes into your Ecommerce store.
​
The video below is an example for how to install Google Tag Manager in a Shopify store in the theme.liquid.

Important: You cannot have the Cometly base code on your store twice or it will impact tracking. When the base code is added in GTM, it's adding the code to your site. You need to remove the Cometly base code from the theme.liquid if previously installed there.


Setup Cometly base code tag inside Google Tag Manager

In this step you will add your Cometly Pixel as a tag in Google Tag Manager.

Important: If you already have the Cometly Pixel installed on your ecommerce store, you can skip this step. The Cometly Pixel does not need to be installed via Google Tag Manager to track Add to Cart and Initiate Checkout events if it is already installed on your site.

In your GTM workspace, click Add a New Tag.

Name your tag 'Cometly Pixel'

Click on Tag Configuration and choose a custom HTML tag.

Paste your Cometly Pixel into the HTML box on the Tag.

Set Trigger to 'All Pages'.


Setup Add To Cart & Initiate Checkout Events

Setup tracking for the Add To Cart and Initiate Checkout events for ecommerce store.

  • In the video, we reference another tag called init that has been deprecated from the platform. Please ignore any reference to that tag. You only need the Cometly Pixel tag, not the init tag.

Video Instruction Steps:

  1. Add tag: Cometly base code

  2. Configure Built-In Variables

  3. Create All Clicks trigger

  4. Test & preview in GTM to see the available Click Text & Click Classes for each Click

  5. Add tag: Cometly - Add To Cart

  6. Add tag: Cometly - Initiate Checkout

  7. Add tag: Cometly - View Content

Events

Add To Cart

<script>
comet('add_to_cart');
</script>

Initiate Checkout

<script>
comet('initiate_checkout');
</script>

View Content

<script>
comet('view_content');
</script>

Pre-Purchase Upsell Apps: How to setup the Add To Cart trigger

Did this answer your question?