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.
You can retreive your Cometly pixel from inside your Cometly account by navigating to Space Setup > Install & Verify Cometly Pixel
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 theinit
tag.
Video Instruction Steps:
Add tag: Cometly base code
Configure Built-In Variables
Create All Clicks trigger
Test & preview in GTM to see the available Click Text & Click Classes for each Click
Add tag: Cometly - Add To Cart
Add tag: Cometly - Initiate Checkout
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