Comprehensive Guide on Setting Up Conversion Tracking with Enhanced Conversions Using gTag on Shopify

Comprehensive Guide on Setting Up Conversion Tracking with Enhanced Conversions Using gTag on Shopify

Welcome to our comprehensive guide on setting up conversion tracking with enhanced conversions using gTag on Shopify! In this blog post, we’ll walk you through the step-by-step process to implement the gTag script for tracking customer events and conversions. This guide is based on the detailed instructions provided in the video "Shopify Customer Events: gTag - Conversion Tracking (w/Enhanced Conversions)" available on YouTube. Let's dive into the key components you will learn from this tutorial.

What You Will Learn:

1. Implementing gTag for Conversion Tracking

Adding the gTag Script to Your Shopify Store: The first step in setting up conversion tracking is to integrate the Global Site Tag (gTag) into your Shopify store. The gTag is a JavaScript tagging framework that allows you to send event data to Google Ads and Google Analytics.

Steps to Implement gTag:

  1. Access Your Shopify Admin: Log in to your Shopify admin panel.
  2. Navigate to Settings: Go to the "Settings" section located at the bottom of the left-hand sidebar.
  3. Select Customer Events: In the "Settings" menu, click on "Customer Events."
  4. Add gTag Script: Click on "Add Customer Event" and select "gTag." Follow the prompts to add your Global Site Tag ID from Google Ads.

Here's the code to add as a Customer Event:

const script = document.createElement('script');
script.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=AW-abc123');
script.setAttribute('async', '');
document.head.appendChild(script);

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-abc123');
//gtag ends here

//ec + purchase code starts here
analytics.subscribe("checkout_completed", (event) => {
  gtag('set', 'user_data', {
    "email": event.data.checkout.email,
    "phone_number": event.data.checkout.phone
  });
  gtag('event', 'conversion', {
    'send_to': 'AW-abc123/blahblah',
    'value': event.data.checkout.totalPrice.amount,
    'transaction_id': event.data.checkout.order.id,
    'currency': event.data.checkout.currencyCode
  });
});

Setting up conversion tracking with enhanced conversions using gTag on Shopify is a powerful way to maximize your marketing efforts. By following the steps outlined above, you can ensure that your conversion tracking is precise and effective, providing you with valuable insights into your customer behavior and marketing performance.

Don't miss out on maximizing your marketing efforts with precise and effective conversion tracking! Implement these strategies today to take your Shopify store's performance to the next level.

For more detailed instructions and visual guidance, be sure to check out the full video tutorial on YouTube. Happy tracking!


Back to blog

Leave a comment

Please note, comments need to be approved before they are published.