Google Ads Enhanced Conversion helps you improve your conversion tracking by sharing more detailed conversion data with Google Ads.

Here, you will get a fully functional solution to set up Google Ads Enhanced Conversions in a few steps.

enhanced-conversion

Key Takeaways:

  • Use Analyzify’s open source code block to set up Google Ads Enhanced Conversions on Shopify (below)
  • Google Ads Enhanced Conversion allows sharing more detailed conversion data with Google Ads, by including customer information like email, name, address, and phone number.
  • Accurate conversion tracking is crucial for optimizing advertising spending, especially given changes in data tracking due to iOS 14.5, Safari ITP, and ad blockers.
  • There are two methods to set up Google Ads Enhanced Conversions on the Shopify store for more effective conversion tracking: the first method involves editing code directly, while the second method uses Google Tag Manager for a more complex setup.

Are you using an ad blocker? The tutorial contains many images- most image names include “Google Ads” or “Ads”. Ad blockers think that it is an ad and blocks those. So make sure to temporarily disable your ad blocker to properly view the content.

🎉 Bonus Content: Explore the best Shopify Google Ads apps to optimize & improve the quality of your campaigns.

How to set up Google Ads Enhanced Conversions on Shopify

As usual, there are several methods. You can easily do it yourself using the first method. You can choose the 2nd, Google Tag Manager method, if you want a more sophisticated setup. We only covered the Purchase tracking as it is the only place where the related user data (email, phone, address) is available.

Enable Enhanced Conversion setting on Google Ads

You can create or apply a new conversion to your existing one. In this tutorial, I will use an existing Google Ads conversion. However, it will very similar if you want to make a new conversion as well.

Step 1: Go to Google Ads > Tools & Settings > Measurement – Conversions

Enable Enhanced Conversion setting on Google Ads – Step 1


Step 2:
Find your Purchase conversion. The conversion source should be “Website”.
You can not apply Enhanced Conversions into a Google Analytics or GA4-sourced conversion.

Enable Enhanced Conversion setting on Google Ads - Step 2
Enable Enhanced Conversion setting on Google Ads – Step 2

Step 3: You should be seeing the “Enhanced Conversions” section right below “Tag setup”.
If you are not seeing that, it means this feature is not available for your Ads account yet.
Click the checkbox. Now we will need to choose our setup method.

Turn on enhanced conversions on Google Ads
Turn on enhanced conversions on Google Ads

First Method: Set up with the global site tag

I will now share the steps and code blocks you need. You can check this official article if you are not using Shopify or if you want to learn more about it.

Step 1: Make Sure You’re Using Global Site Tag

To be able to move on with me here, you should have the Global Site Tag (gtag.js) installed on your store. You will need to type your URL and click CHECK URL. If Global Site Tag is not installed on your store, you will only be shown the Google Tag Manager Option. If that’s the case, move to Method 2. Alternatively, you can learn how to install Global Site Tag on Shopify.

Google Ads Enhanced Conversions Global Site Tag Control
Google Ads Enhanced Conversions Global Site Tag Control

Step 2: Choose The Setup Method: Edit Code/Event Snippet

As mentioned above, if you have the Global Site Tag installed, you should be seeing something like the one below. Follow the steps:
Choose Global Site Tag > Edit Code > Use Event Snippet – and SAVE.

Enhanced Conversions - Global Site Tag Setup - Event snippet
Enhanced Conversions – Global Site Tag Setup – Event snippet

Step 3: Find and Copy Your Conversion ID and Label

We will also need to learn your Conversion ID and label. Just scroll up to the “Tag Setup” part and choose Google Tag Manager. We will NOT use Google Tag Manager. We are choosing this just to get your Conversion ID and Label easier. Copy your Google Ads Conversion ID and Label and move to the next step.

Conversion ID & Label - Google Ads
Conversion ID & Label – Google Ads

Step 4: Take a Backup of Your Existing Scripts

Better safe than sorry! Let’s take the backup of your existing codes – just in case.
Go to your Shopify Store Admin > Settings > Checkout > Additional Scripts

Shopify Settings > Additional Checkout Scripts
Shopify Settings > Additional Checkout Scripts

Things are quite sensitive here. Copy all of the existing code blocks and save them somewhere safe; you can email yourself 🙂

Take a sip from your coffee. Now the fun part begins! We will add & remove some codes from your Shopify Checkout scripts.

Step 5: Find Your Existing Conversion Script

You most probably have a conversion script there. If you can’t see it in the first place, you can try searching “AW-” – and the search should lead you. It should look like this:

Google Ads Conversion Script on Shopify
Google Ads Conversion Script on Shopify

If you don’t have it there, there are two possibilities:

a) Your conversion tracking wasn’t already working properly.
In this case, just continue to the next step because our code snippet will already include the conversion tracking script as well.

b) You are using Google Tag Manager to track conversions.
In this case, you can either pause your conversion tag in Google Tag Manager or use the 2nd Method to implement the Enhanced Conversions.

Step 6: Add the New Enhanced Conversion Tracking Code on Shopify Checkout

The code block is below. Please read these points carefully before you implement them:

  • Make sure that you have the backup of the existing scripts.
  • You will need to update the code block with your conversion ID, label, merchant ID, product ID format, country, and language in the next step – don’t just copy and paste the block and leave the page. The next step matters a lot!
  • This is a new feature, and it is still in “beta”. Even though we tested it very well and observed great results, it might not perform perfectly for your case.

Agreed? Great! Now copy the code block below and go to the next step.

{% comment %}
Analyzify - Enhanced Conversions Tag V1.4
SECTION 1: ONLY EDIT HERE
Add your relevant values here. Detailed guideline: https://analyzify.app/hub/google-ads-enhanced-conversion-setup-on-shopify/
{% endcomment %}
<script>
const analyzify = {
  ads_conversion_id: “AW-111111111”,
  ads_conversion_label: “conversionlabelhere”,
  product_id_format: “product_id-variant_id”, // options: product_id-variant_id, variant_id, sku, product_id
  ads_merchant_id: “222222222",
  ads_feed_country: “US”,
  ads_feed_language: “EN”,
  product_id_prefix: “shopify”,
  divider: “_”,
  user_provided_data: ‘email’, // options: all, email, email-phone
  debug: false, // options: true, false
}
</script>
{% comment %}
SECTION 2: DO NOT EDIT BELOW - ONLY EDIT SECTION 1
{% endcomment %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, analyzify.ads_conversion_id, { ‘allow_enhanced_conversions’: true });
</script>
<!-- START Google Ads Enhanced Conversions -->
<script>
const checkOrderPage = {% if first_time_accessed %}true{% else %}false{% endif %} || window.location.href.indexOf(‘thank_you’) > -1 || analyzify.debug;
if (checkOrderPage) {
    const userProvidedData = {
        email: ‘{{ checkout.email }}‘,
        phone: ‘{{ billing_address.phone }}’ !== ‘’ ? ‘{{ billing_address.phone }}’ : ‘{{ shipping_address.phone }}‘,
        address: {
            first_name: ‘{{ billing_address.first_name }}’ !== ‘’ ? ‘{{ billing_address.first_name }}’ : ‘{{ shipping_address.first_name }}‘,
            last_name: ‘{{ billing_address.last_name }}’ !== ‘’ ? ‘{{ billing_address.last_name }}’ : ‘{{ shipping_address.last_name }}‘,
            street: ‘{{ billing_address.street }}’ !== ‘’ ? ‘{{ billing_address.street }}’ : ‘{{ shipping_address.street }}‘,
            city: ‘{{ billing_address.city }}’ !== ‘’ ? ‘{{ billing_address.city }}’ : ‘{{ shipping_address.city }}‘,
            region: ‘{{ billing_address.province_code }}’ !== ‘’ ? ‘{{ billing_address.province_code }}’ : ‘{{ shipping_address.province_code }}‘,
            postal_code: ‘{{ billing_address.zip }}’ !== ‘’ ? ‘{{ billing_address.zip }}’ : ‘{{ shipping_address.zip }}‘,
            country: ‘{{ billing_address.country_code }}’ !== ‘’ ? ‘{{ billing_address.country_code }}’ : ‘{{ shipping_address.country_code }}’,
        },
    };
    let userData = {};
    if (analyzify.user_provided_data === ‘all’) {
        userData = userProvidedData;
    } else if (analyzify.user_provided_data === ‘email’) {
        userData = { email: userProvidedData.email };
    } else if (analyzify.user_provided_data === ‘email-phone’) {
        userData = { email: userProvidedData.email, phone: userProvidedData.phone };
    }
    gtag(‘set’, ‘user_data’, userData);
    const set_id_format = function(format){
        // Set product id format
        if (format === ‘product_id-variant_id’) {
            return function(item){
            return `${analyzify.product_id_prefix}${analyzify.divider}${analyzify.ads_feed_country}${analyzify.divider}${item.product_id}${analyzify.divider}${item.variant_id}`;
            }
        } else if (format === ‘variant_id’) {
            return function(item){
            return item.variant_id;
            }
        } else if (format === ‘sku’) {
            return function(item){
            return item.sku;
            }
        } else {
            return function(item){
            return item.product_id;
            }
        }
    }
    gtag(‘event’, ‘purchase’, {
        send_to: analyzify.ads_conversion_id + ‘/’ + analyzify.ads_conversion_label,
        transaction_id: ‘{{ order.order_number }}’ || ‘{{ checkout.order_id }}’ || ‘{{ order.id }}’,
        value: Number(Shopify.checkout.total_price_set.presentment_money.amount),
        currency: Shopify.checkout.total_price_set.presentment_money.currency_code,
        discount: Shopify.checkout.discount == null ? 0 : Shopify.checkout.discount.amount,
        aw_merchant_id: analyzify.ads_merchant_id,
        aw_feed_country: analyzify.ads_feed_country,
        aw_feed_language: analyzify.ads_feed_language,
        items: Shopify.checkout.line_items.map(item => ({
            id: set_id_format(analyzify.product_id_format)(item),
            quantity: Number(item.quantity),
            price: Number(item.line_price),
            google_business_vertical: ‘retail’,
        })),
    });
}
</script>
<!-- END Cart Data -->
{% comment %}
END Analyzify - Enhanced Conversions Tag V1.3 Detailed guideline: https://analyzify.app/hub/google-ads-enhanced-conversion-setup-on-shopify/
{% endcomment %}
Make sure that you have copied it correctly.

IMPORTANT:

  • user_provided_data: ’email’, // options: all, email, email-phone
    If you want to send only the “email” variable of customers as Enhanced conversion data to Google Ads, you can leave this variable as it is. However, if you are also collecting phone numbers from your customers, you can change this variable to “email-phone” from the options listed in the variable.
  • debug: false, // options: true, false
    Use this variable only for testing purposes.To ensure that your code is working properly, you can change this variable to true and perform a test on an old Order’s Status Page. To ensure that the data is transmitted correctly, you can use Google’s Tag Assistant Legacy chrome extension or check the Network signals in DevTools.
    Please remember to set this variable to false after completing the test process. Otherwise, every time your customers visit the OSP, Conversion data will be resent to Google Ads. This can lead to a double counting problem and affect your campaign optimization.

Once again, ONLY copy; don’t paste it yet.

Before you move on, we have an important note. We keep updating these code blocks with the latest information. Please make sure to visit the related page on our website to make sure that you have the latest code.

The most up-to-date version of the code block on our website.
The most up-to-date version of the code block on our website.

 

Step 6: Variables you need to change

The following section of the code is to be updated with your own values/information. DO NOT change any other section in the code.

And here are the details:

  1. “ads_conversion_id”: Add your conversion ID (from step 2 above) right after “AW-“. Only replace the numbers. “AW-” should still stay there. So if your conversion ID is 123456789 – the updated version of the code should be like AW-123456789.
  2. “ads_conversion_label”: This is your conversion label (from step 3 above) after slash.
  3. “product_id_format” : The product ID format that is used on your Google feed. It will be explained in more detailed below in product ID format section.
  4. “ads_merchant_id”: It is the ID of your Google Merchant account.
  5. “ads_feed_country” and “ads_feed_language”: these fields are quite clear.

Step 7: Product ID format & Merchant Center ID

Let’s quickly double-check your Google Feed product ID format.

Visit Google Ads and click PRODUCTS on the left menu. You will see the merchant ID as marked below – and your product ID format next to that. On our example it starts with “shopify_AU_…” because the native Google Sales Channel is used for product feed on Shopify.

Google - Merchant ID - Product ID
Google – Merchant ID – Product ID

If you are using a different format here, you should adjust our codes accordingly.

All the other fields are quite easy. Don’t forget to replace:

  • Your merchant ID,
  • Product feed country code and language.

After you replace all these values – now it is time to use this code.

Step 8: Paste the updated code into Shopify Checkout Additional Scripts

Visit Shopify Admin > Settings > Checkout > Additional Scripts

And paste the final code there. It should look like this:

Additional Scripts - Added Enhanced Conversions
Additional Scripts – Added Enhanced Conversions

We are done. The enhanced conversion data should be coming into Google Ads shortly. As mentioned above:

This is a new feature, and it is still in “beta”. Even though we tested very well and observed great results, it might not perform perfectly for your case.

We are done! If you are curious, here is the reference from Shopify documentation.

Second Method: Set up Enhanced Conversions with Google Tag Manager

This is a more complex setup and it requires your store to have a set of data layers and a correctly structured Google Tag Manager container to make it work. We will add a separate series of tutorials for this.

For now, we recommend you use the method explained above. If you still want to use Google Tag Manager;

  • You can check the official documentation and follow the steps there.
  • You can purchase Analyzify, and our support team will complete your setup at no extra cost. Analyzify provides countless benefits for your Shopify store. You can check the features on our Analyzify Features page.

 

What is Google Ads Enhanced Conversion?

It’s a feature that allows you to share more data about your conversions with Google Ads so that the conversion tracking will work better. It works quite similarly to Facebook Conversion API.

enhanced-conversion

On regular Google Ads conversion tracking; the order ID, revenue, and optionally purchased products are being sent. With Google Ads Enhanced Conversion – you can also send customer details such as email, name, address, and phone number. Let’s consider an example:

  • Suppose that you run an online bookstore and you are advertising it with Google Ads. You are using Enhanced Conversion tracking to track your results. One of your keywords is ‘buy books online’.
  • A potential buyer, who is logged in to their Google account on Chrome, searches for this keyword and sees your ad on the first page. They click on your ad and visit your website.
  • On your website, they browse through different genres of books, read some reviews, and add one book to their wishlist. However, they decide to buy it later and close your website.
  • A few days later, the same buyer returns to your website and buys the book they had added to their wishlist.
  • When the buyer first visited your website, Enhanced Conversion tracking captured their email address, encrypted it, and sent it to Google in a hashed form. This data is then used by Google to match the buyer’s Google account with their click on your ad attributes their purchase conversion to your original ad.

Google explains:

The feature uses a secure one-way hashing algorithm called SHA256 on your first party customer data, such as email addresses, before sending to Google. The hashed data is then matched with signed-in Google accounts in order to attribute your campaign conversions to ad events, such as clicks or views. Source

Do I need Google Ads Enhanced Conversion?

Conversion tracking has become significantly hard after the new changes in the world of data tracking such as iOS 14.5, Safari ITP, and with arise of adblockers. You can’t optimize and measure your advertising spending if you don’t measure them well. So, the answer is yes if you want to count and attribute more conversions.

Note: After activating Google Ads enhanced conversions, don’t forget to import your Shopify customer data into Google Ads.

Final Words

Setting up Google Ads Enhanced Conversions on Shopify is vital for accurate conversion tracking, especially in the face of recent changes in data tracking. This feature allows you to share comprehensive conversion data, including customer information.

The tutorial offers two methods:

Editing Code Directly: This is a straightforward approach for those comfortable with coding.

Google Tag Manager: A more advanced setup requiring a structured container and data layers.

With Enhanced Conversions, you not only track order details but also capture valuable customer information, enabling more precise attribution of conversions to your advertising efforts.

In a landscape where accurate measurement of advertising ROI is paramount, adopting Google Ads Enhanced Conversions is a vital step toward optimizing your advertising spend.