Just follow the steps carefully and have your Google Ads Enhanced Conversion working on your Shopify store.

You all probably have received the emails from Google Ads saying you can now set up your Enhanced Conversions. But let's be honest, it wasn't quite possible to set it up on Shopify when it was first launched. We tried to make it work for a long and tried all the possible methods - and we finally have a fully working solution that we are happy to share.

This is a free and fully functional tutorial so you will not have to purchase Analyzify or another app. Just follow the steps carefully and have your Google Ads Enhanced Conversion working on your Shopify store.

🎯
Want to make sure this is done correctly?
We got you covered. Analyzify support team can complete and validate your Enhanced Conversions setup. Learn how we can help ✔️


Things change quite fast in the data analytics world - especially for Shopify merchants. And I know it is quite too hard to catch up! Make sure to subscribe to Analyzify Hub where we share tutorials and best practices.

Note: This tutorial has been updated on March 2022 with the most up-to-date information and code blocks.

Are you using an ad blocker? The tutorial contains a lot of images - and 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.

What is Google Ads Enhanced Conversion?


It works quite similarly to Facebook Conversion API. 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.

As an example, 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. The data is being sent as encrypted as 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.

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 either create a new conversion or apply it to your existing conversion. 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

Finding Conversion Settings on Google Ads
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.

Going to 'Conversion Actions' on Google Ads
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.

Finding how to turn on enhanced conversions on Google Ads
Turn on enhanced conversions on Google Ads

Method 1: 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 0: 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.

Checking out the Global Site Tag
Google Ads Enhanced Conversions Global Site Tag Control
Step 1: 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.

Using event snippet on Google Ads
Enhanced Conversions - Global Site Tag Setup - Event snippet
Step 2: 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.

Finding the Conversion ID and the Conversion Label on Google Ads
Conversion ID & Label - Google Ads 
Step 3: 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

Finding the Additional Scripts on Shopify
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 4: 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:

An example of 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 5: 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.3
	SECTION 1: ONLY EDIT HERE
	Add your relevant values here. Detailed guideline: https://analyzify.app/hub/google-ads-enhanced-conversion-setup-on-shopify/
	{% endcomment %}


	{% assign gads_aw_id = "AW-111111111" %}
	{% assign gads_send_to = "AW-111111111/conversionlabelhere" %}
	{% assign product_id = "product_id_variant-id" %}
	{% assign product_id_prefix = "shopify_us_" %}
	{% assign gads_merchant_id = "222222222" %}
	{% assign gads_feed_country = "US" %}
	{% assign gads_feed_language = "EN" %}


	{% 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', '{{ gads_aw_id }}', { 'allow_enhanced_conversions': true });
	</script>
	{% if first_time_accessed %}

		<!-- START Google Ads Enhanced Conversions  V1.3-->
		<script>
		var enhanced_conversion_data = {
		{% unless checkout.email == blank %}"email": "{{ checkout.email }}",{% endunless %}
		{% unless billing_address.phone == blank %}"phone_number": "{{ billing_address.phone }}",{% endunless %}
		{% unless billing_address.first_name == blank %}"first_name": "{{ billing_address.first_name }}",{% endunless %}
		{% unless billing_address.last_name == blank %}"last_name": "{{ billing_address.last_name }}",{% endunless %}
		"home_address": {
			{% unless billing_address.street == blank %}"street": "{{ billing_address.street }}",{% endunless %}
			{% unless billing_address.city == blank %}"city": "{{ billing_address.city }}",{% endunless %}
			{% unless billing_address.province_code == blank %}"region": "{{ billing_address.province_code }}",{% endunless %}
			{% unless billing_address.zip == blank %}"postal_code": "{{ billing_address.zip }}",{% endunless %}
			{% unless billing_address.country_code == blank %}"country": "{{ billing_address.country_code }}"{% endunless %}
		}
		};
		</script>
		  <!-- END Google Ads Enhanced Conversions  V1.3-->

		<!-- START Cart data V1.3-->
		<script>
		gtag('event', 'purchase', {
			'send_to': '{{ gads_send_to }}',
			'transaction_id': '{{ order.order_number }}',
			'value': Shopify.checkout.total_price_set.presentment_money.amount,
			'currency': Shopify.checkout.total_price_set.presentment_money.currency_code,
			'discount': discount(),
			'aw_merchant_id': {{ gads_merchant_id }},
			'aw_feed_country': '{{ gads_feed_country }}',
			'aw_feed_language': '{{ gads_feed_language }}',
			'items': items()
		});
		
		function discount(){
			return (Shopify.checkout.discount == null) ? 0 : Shopify.checkout.discount.amount;
		}

		function items(){
			var jsonarray = [];
			for (var line_item_count = 0; line_item_count < Shopify.checkout.line_items.length; line_item_count++){
				jsonarray.push({
					id: {% if product_id == "product_id_variant-id" %}'{{ product_id_prefix }}' + Shopify.checkout.line_items[line_item_count].product_id + '_' + Shopify.checkout.line_items[line_item_count].variant_id{% elsif product_id == 'variant-id' %}Shopify.checkout.line_items[line_item_count].variant_id{% elsif product_id == 'sku' %}Shopify.checkout.line_items[line_item_count].sku{% endif %},
					quantity: Shopify.checkout.line_items[line_item_count].quantity,
					price: Shopify.checkout.line_items[line_item_count].line_price
				})
			}
			return jsonarray;
		}
		</script>
		<!-- END Cart data V1.3-->
	{% endif %}
	{% comment %}
	END Analyzify - Enhanced Conversions Tag V1.3 Detailed guideline: https://analyzify.app/hub/google-ads-enhanced-conversion-setup-on-shopify/
	{% endcomment %}
    
Google Ads Enhanced Conversion Code Snippet for Shopify

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.
Getting the most up-to-date Shopify Enhanced Conversion code blocks
The most up-to-date version of the code block on our website.
Step 7: 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.

	{% assign gads_aw_id = "AW-111111111" %}
	{% assign gads_send_to = "AW-111111111/conversionlabelhere" %}
	{% assign product_id = "product_id_variant-id" %}
	{% assign product_id_prefix = "shopify_us_" %}
	{% assign gads_merchant_id = "222222222" %}
	{% assign gads_feed_country = "US" %}
	{% assign gads_feed_language = "EN" %}

And here are the details:

  1. "gads_aw_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. "gads_send_to": This is your conversion ID and conversion label (from step 2 above) after slash.  
  3. "product_id" : 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. "merchant_id": It is the ID of your Google Merchant account.
  5. feed_country  & feed_language fields are quite clear.
Step 8: 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.

Finding the Product ID on Google Ads
Google - Merchant ID - Product ID

If you are using a different format here, you should adjust our codes accordingly. As an example if you are only seeing your variant ID instead of Shopify's classic format - then just update our related lines to these ones:


	{% assign product_id = "variant-id" %}
	{% assign product_id_prefix = "" %}
    
Example Using Only Variant ID as a Google Product Feed Variable 

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 9: Paste the updated code into Shopify Checkout Additional Scripts

Visit Shopify Admin > Settings > Additional Scripts

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

Pasting the updated code into Shopify Checkout Additional Scripts
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.


Method 2: 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 using 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.

Final Words

Google Ads Enhanced Conversions feature is quite new and still in beta. You might not receive a huge spike in your conversion reports. We always recommend adopting these changes as early as possible. There is no harm in that.

Thanks for reading our tutorial. Make sure to subscribe to Analyzify Hub where we share tutorials and best practices.

You can also leave your questions as comments and we will do our best to get back to you! Also feel free to share your comments, appreciations, frustrations, or any other feelings :)

Leave your questions & comments, get help from the Analyzify team & community.

Table of Contents
Great! Next, complete checkout for full access to Analyzify Hub.
Welcome back! You've successfully signed in.
You've successfully subscribed to Analyzify Hub.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.