Join the WhatsApp Group for Support, Suggestions, and Bug Reports:
- Go to theme edit and paste GTM tracking code right after
<head>
tag intheme.liquid
file - Inside the
snippets
folder create a new file asultimate-datalayer
. Copy all of the code fromultimate-datalayer.liquid
of this repository to sinppet fileultimate-datalayer.liquid
. - In the
theme.liquid
file after your GTM tracking code includeultimate-datalayer.liquid
file as{% render 'ultimate-datalayer' %}
- From shopify admin dashboard go to Settings >> Checkout (Scroll Down) >> Additional scripts. Copy all code from
checkout.liquid
from this repository to theAdditional scripts
field. Change the example GTM example tracking ID 000-00000 to the real GTM ID - Depending on your Shopify theme, you might have to make some adjustments. For more information, please refer to the video below.
- view_item
- view_item_list
- add_to_cart
- remove_from_cart
- view_cart
- begin_checkout
- add_to_wishlist
- purchase
- newsletter_signup
- search
- phone_number_click
- email_click
- Logged customer and on the checkout page customer details included as customer object with dataLayer
- Event Parameters: currency, value, transaction_id, coupon, shipping, vat, items, item_list_name, item_list_id
- Items Parameters item_id, item_name, quantity, price, discount, item_brand, item_category, item_variant, sku, item_list_name, item_list_id
With all general event tracking it also tracks following special events
- DataLayer event prefix
- Quick View Event Tracking (as view_item)
- Mini Cart and Dropdown Cart, Cart Drawer Tracking (as view_cart)
- Shopify Direct Checkout Tracking ( as add_to_cart & begin_checkout)
- Sticky Cart, Sidebar Cart, etc Tracking ( as add_to_cart)
- Shopify Ajax Search Tracking ( as search )
- Events was tacked by Ajax Response so no data discrepancy for edge cases
- No jQuery, no 3rd Party Scripet was included, all code was written ES6 Object Oriented Way. Added proper error handling so that there is no JS error
For more information, please watch the video below.