Google Ecosystem
October 14, 2024
15 min

2024 Complete Shopify Google Ads Enhanced Conversions Tracking Setup Guide (With Code, No Plugins, No GTM) (41)

Shopify Pixel greatly simplifies Google Ads tracking setup. Complete guide to setting up Google Ads Enhanced Conversions tracking without Google Tag Manager or third-party plugins, with full code included.

2024 Complete Shopify Google Ads Enhanced Conversions Tracking Setup Guide (With Code, No Plugins, No GTM) (41)

Cover Image

Divider

Preface

Let me give newcomers a shot in the arm early:

Since the appearance of Shopify Pixel, it has greatly simplified the tracking conversion settings for Google, Meta, TikTok, and Pinterest.

This issue will focus on how to set up Enhanced Conversion Tracking for Google Ads.

Let me put up a shield early - there are actually multiple methods and tools that can achieve this. Please view it dialectically and choose the method that suits you.

This issue will not use Google Tag Manager, and there are no third-party plugin advertisements.

Divider

Prerequisites

  1. Shopify has Google & YouTube installed, and your Google account has been successfully bound. (And it's strongly recommended to install Google Analytics 4 following the instructions - this is not covered in this tutorial)

Google & YouTube Installation

  1. Your Google account is functioning normally.

Divider

Let's Go: Create Conversion Tracking Goal in Google Ads

Create Conversion Goal

Step 1

Step 2

Step 3

Step 4

Step 5

Step 6

At this point, Google will monitor whether you have installed the Google code and which SaaS platform your website uses.

If Google code is already installed: (Note! For most Shopify players, if you've completed the prerequisites and opened Google Analytics in the Google & YouTube app following the instructions, you've actually already had the code installed by default!)

If not installed (in my case, the website is WordPress, so Google detected WordPress and guided me to continue):

Code Not Installed

Install Code

Code Example

Save Code

Code Detection

Detection Passed

Detection Completed

In rare cases, if we haven't installed it, we need to insert the code: Copy the above code and enter Shopify, go to theme code editing, and paste it under <head> in the theme.liquid file, then save.

After the code installation is complete (or if you already have it), it will show that your tag has been detected.

Add Event Code

The next step is quite important, and there are multiple ways to handle it. But the core task is that we need to put these event codes on the website so that relevant event actions can be correctly identified (such as purchase, begin checkout, add to basket, etc.)

Event Code

Event Code Details

Event Code Details 2

Open the event snippet, copy the code and paste it somewhere else for later use.

Add Custom Pixel in Shopify

Next, return to Shopify and add a custom pixel here:

Shopify Pixel Settings

Pixel Settings Details

Give it any name, and for the code snippet, you can directly copy:

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

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-1111111', {'allow_enhanced_conversions':true});

analytics.subscribe("checkout_completed", (event) => {
  gtag('set', 'user_data', {
    email: event.data?.checkout?.email,
    phone: event.data?.checkout?.phone,
    address: {
      first_name: event.data?.checkout?.shippingAddress?.firstName,
      last_name: event.data?.checkout?.shippingAddress?.lastName,
      street: event.data?.checkout?.shippingAddress?.address1,
      city: event.data?.checkout?.shippingAddress?.city,
      region: event.data?.checkout?.shippingAddress?.province,
      postal_code: event.data?.checkout?.shippingAddress?.zip,
      provinceCode: event.data?.checkout?.shippingAddress?.provinceCode,
      country: event.data?.checkout?.shippingAddress?.country,
      countryCode: event.data?.checkout?.shippingAddress?.countryCode,
    }
  });
  gtag('event', 'conversion', {
    send_to: 'AW-1111111/d11lvsao1niubi11',
    transaction_id: event.data?.checkout?.order?.id,
    value: event.data?.checkout?.subtotalPrice?.amount,
    currency: event.data?.checkout?.subtotalPrice?.currencyCode,
  });
});

Important: Please replace AW-1111111 in the code with your actual Google Ads ID, and replace AW-1111111/d11lvsao1niubi11 with your actual conversion ID.

Code Input

Divider

Complete Setup

Then return to Google Ads and continue with various saves. Done.

Complete Setup

Save Completed

When you move your mouse over the status of this tracking goal, you'll see its status.

Generally speaking, if your site has continuous conversions, the first green checkmark will appear after several hours; wait another 1-3 days, and the second enhanced conversions green checkmark will appear.

Status Check

Status Check 2

Status Check 3

Status Check 4

Other Settings Check

For some old accounts, you can check whether you've enabled this feature overall.

Feature Check

Feature Check 2

Feature Check 3

Feature Check 4

Feature Check 5

Feature Check 6

Feature Check 7

Feature Check 8

Divider

FAQ

End

Recommended for You

1 / 5