SEO, AdWords, affiliates, advertising, and promotions
Hello!
I have run into some issues recently related to the new checkouts. Any assistance is appreciated. Thanks in advance!
Issue:
Google Tag Manager is not firing on the checkout page despite a custom pixel being installed under customer events. Specifically Begin Checkout and Conversion/Purchase.
Background:
Possible interference:
Custom Pixel:
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} window.dataLayer.push({ event: "debug_event_check", timestamp: new Date().toISOString() }); console.log("Debug Event Sent to DataLayer"); const COUNTRY_CODE = 'US'; // Initialize GTM tag (function(w,d,s,l,i){ w[l]=w[l]||[]; w[l].push({'gtm.start': new Date().getTime(), event:'gtm.js'}); var f=d.getElementsByTagName(s)[0], j=d.createElement(s), dl=l!='dataLayer'?'&l='+l:''; j.async=true; j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl; f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer', 'GTM-XXXX'); // Subscribe to events analytics.subscribe("checkout_completed", (event) => { window.dataLayer.push({ event: "conversion", email: event.data?.checkout?.email, phone: event.data?.checkout?.phone, first_name: event.data?.checkout?.shippingAddress?.firstName, last_name: event.data?.checkout?.shippingAddress?.lastName, address1: event.data?.checkout?.shippingAddress?.address1, address2: event.data?.checkout?.shippingAddress?.address2, city: event.data?.checkout?.shippingAddress?.city, country: event.data?.checkout?.shippingAddress?.country, countryCode: event.data?.checkout?.shippingAddress?.countryCode, province: event.data?.checkout?.shippingAddress?.province, provinceCode: event.data?.checkout?.shippingAddress?.provinceCode, zip: event.data?.checkout?.shippingAddress?.zip, orderId: event.data?.checkout?.order?.id, currency: event.data?.checkout?.currencyCode, subtotal: event.data?.checkout?.subtotalPrice?.amount, shipping: event.data?.checkout?.shippingLine?.price?.amount, value: event.data?.checkout?.totalPrice?.amount, tax: event.data?.checkout?.totalTax?.amount, items: event.data?.checkout?.lineItems.map(item => ({ id: `shopify_${COUNTRY_CODE}_${item.variant.product.id}_${item.variant.id}`, google_business_vertical: 'retail' })) }); }); analytics.subscribe("checkout_started", (event) => { window.dataLayer.push({ event: "begin_checkout", timestamp: event.timestamp, id: event.id, token: event.data?.checkout?.token, url: event.context.document.location.href, client_id: event.clientId, email: event.data?.checkout?.email, phone: event.data?.checkout?.phone, first_name: event.data?.checkout?.shippingAddress?.firstName, last_name: event.data?.checkout?.shippingAddress?.lastName, address1: event.data?.checkout?.shippingAddress?.address1, address2: event.data?.checkout?.shippingAddress?.address2, city: event.data?.checkout?.shippingAddress?.city, country: event.data?.checkout?.shippingAddress?.country, countryCode: event.data?.checkout?.shippingAddress?.countryCode, province: event.data?.checkout?.shippingAddress?.province, provinceCode: event.data?.checkout?.shippingAddress?.provinceCode, zip: event.data?.checkout?.shippingAddress?.zip, orderId: event.data?.checkout?.order?.id, currency: event.data?.checkout?.currencyCode, subtotal: event.data?.checkout?.subtotalPrice?.amount, shipping: event.data?.checkout?.shippingLine?.price?.amount, value: event.data?.checkout?.totalPrice?.amount, tax: event.data?.checkout?.totalTax?.amount, items: event.data?.checkout?.lineItems.map(item => ({ id: `shopify_${COUNTRY_CODE}_${item.variant.product.id}_${item.variant.id}`, google_business_vertical: 'retail' })) }); });
Hi Cdem,
thanks for your query.
As custom pixel works on a sandbox environment, You cannot connect Shopify checkout with GTM using this data layer.
You have to have The proper Datalayer to connect the checkout page and purchase/thank you page with GTM and an Chrome extension.
so the solution is changing the Datalayer and connect the GTM with an extension where you can connect checkout page and see all the events and tag firing status.
Feel free to ask if you have any questions.
Thanks
Hi @J_mah,
Can you mention what are the exact changes you have made to the dataLayer to connect GTM container to the Checkout and further pages?
Thank you in advance!
Regards,
Niraj
Hi Cdem,
I would like to suggest an alternate solution for you.
You can start using a google conversion pixel app which will rid you of all these technical things. It is definitely a live saver, as it takes care of the coding related for you and most of the apps have a dedicated support team that are ready to help you.
You can try out 'Nabu for Google Ads Pixel'. You are specifically facing issues with the check out event, this app will resolve it for you. Additional events such as begin check out and add to cart can also be tracked. The app's coding is constantly changed based on Google's changes to ensure Google Ads Tracking is always accurate. It has additional features like, identifying duplicate conversions, or fixing missing conversion values. There are a whole lot of settings you can manage from the dashboard too.
(the interface of the app)
I highly recommend you use this and let me know of any questions concerning set up if you do end up installing it 🙂
Sanjna Lal | Content Marketing Manager @ AdNabu
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Try our Nabu for Google Shopping Feed App from Shopify App Store.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025