Created on 23 January, 2016 | Updated on 11 December, 2022

How To Add Google Ads Conversion Tracking to Shopify With Optional Enhanced Conversions

Easily add Google Ads conversion tracking to Shopify in less than 15 minutes.

Supported Functions

  • Automatically supports multi currencies.
  • Automatically converts European prices with commas to dots.
  • Optional choice for disabling tax and shipping in your checkout value.
  • Includes the new Google Ads enhanced conversion option

Requirements

  • Access to Google Ads > Conversions
  • Access to Shopify > Settings

Step 1: Open Shopify Checkout Settings

Open a new tab in your browser and log in to your Shopify Admin Panel

Navigate to Settings (Gear Icon) and choose Checkout

Shopify Checkout

Step 2: Setup & Copy Your Google Ads Conversion Code

In a second browser tab, login to Google Ads and click on the tools and settings menu in the top right corner and select Conversions under the Measurement column.

Google Ads Conversion

Click on the big blue plus sign (New Conversion Action).

Now select website as your tracking template.

It will now ask you to scan your website URL. Enter your URL and click on scan.

Scroll to the bottom and choose to install the conversion action manually.

Then do the following :

  • Conversion name
    • enter any name
  • Category
    • Purchase / Sale
  • Value
    • Use different values for each conversion
  • Attribution model
    • Choose Position-Based (recommended for growth based businesses)
  • The rest can be as default

I have written a great article on how to choose your attribution model.

Click on Create and continue

Create your website conversion action

Now you can click on Save And Continue

Google Ads Continue Conversion Action

Click on See Event Tag

Google Ads See Event Tag

Copy your Event Snippet and save it in a temporary file, for later use.

Google Ads Copy Event Snippet

Click on Done

Google Ads Conversion Action Done

Click on the recently added conversion action

Google Ads Conversion Action

Enabling Enhanced Conversions is optional and not required. Some accounts may not see this option yet. So you can continue the steps below, excluding those related to enhanced conversions. (Skip to Step 3)

Check the box next to Turn on enhanced conversions and enter your website URL and click on Check URL.

By enabling enhanced conversions you allow Google to improve its accuracy to track conversions. This seems to be required due to Apple’s IOS14 no tracking prompt.

Turn On Enhanced Conversions

If you have multiple tags installed, you can choose which tag to use. I recommend selecting Global Tag

If you can not select Global site tag, make sure to install Google Ads Remarketing.

Then enter your domain URL again and append ?v1 this will force Google to recheck. If you add the same URL it will not recheck.

Google Ads Enhanced Conversions Choose Global Tag
  • Leave the Tag type alone.
  • Check the box next to Email and choose Javascript
  • Enter the following values
  • Email
    • enhanced_conversion_data.email

Repeat the steps for Phone and Name and Address

  • Phone
    • enhanced_conversion_data.phone_number
  • First name
    • enhanced_conversion_data.first_name
  • Last name
    • enhanced_conversion_data.last_name
  • Street address
    • enhanced_conversion_data.home_address.street
  • City
    • enhanced_conversion_data.home_address.city
  • State
    • enhanced_conversion_data.home_address.region
  • Country
    • enhanced_conversion_data.home_address.country
  • Postal code
    • enhanced_conversion_data.home_address.postal_code
Google Ads Enhanced Conversion Tracking for Shopify Using Javascript

You might ask, why the javascript values? Well on your thank you page, the javascript selector for all the values is added as a javascript variable when using the conversion tracking code below (From V1.5). This will only work if you use the code below.

Step 3: Editing and Pasting Your Google Ads Conversion Tracking

Go back to Shopify and scroll down until you see Order Processing (from step 1), at the bottom of this section you will have a field where you can paste code that is labeled Additional Scripts.

Shopify Additional Scripts

Copy the send_to value (image below) and replace fa_send_to value with your value in the code template below.

  1. replace the value for fa_send_to
    • replace the value AW-123456789/abcdefghijlklmnopq with your event snippet send_to value
  2. Choose yes or no for fa_include_tax_and_shipping
    • choose yes if you want to include tax and shipping in the checkout value or no to not include tax and shipping values.

Sometimes on rare occasions, when you set fa_include_tax_and_shipping to no, it would still include the shipping. I’m not sure why this sometimes happens, but it might have to do with the account country. So if you notice shipping is included, set the value to yes, and it will remove shipping.

Code Template (change the fa_send_to value with your code snippet send_to value)

<!-- FEEDARMY START Global site tag (gtag.js) - Google Ads V1.8 -->
{% assign fa_send_to = 'AW-123456789/abcdefghijlklmnopq' %}
{% assign fa_include_tax_and_shipping = 'no' %}

{% comment %}DO NOT EDIT BELOW{% endcomment %}
{% if fa_google_coding %}{% assign fa_google_coding = true %}{%- else -%}{% assign fa_google_coding = false %}{%- endif -%}
{% if fa_include_tax_and_shipping == 'no' %}
{% assign fa_checkout_price = checkout.subtotal_price | divided_by: 100.0  %}
{%- else -%}
{% assign fa_checkout_price = checkout.total_price | divided_by: 100.0   %}
{%- endif -%}
{% assign fa_google_ids = fa_send_to | split: "/"  %}
{% if fa_google_coding == false %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{fa_google_ids[0]}}"></script>
{%- endif -%}
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', '{{fa_google_ids[0]}}', {'allow_enhanced_conversions':true});
</script>
{% if first_time_accessed %}
<script>
  gtag('event', 'conversion', {
      'send_to': '{{ fa_send_to }}',
      'value': {{ fa_checkout_price }},
      'currency': '{{ currency }}',
      'transaction_id': '{{ order_number }}'
  });
  var enhanced_conversion_data = {
  "first_name": "{{ billing_address.first_name }}",
  "last_name": "{{billing_address.last_name}}",
  "home_address": {
  "street": "{{billing_address.street}}",
  "city":"{{billing_address.city}}",
  "region": "{{billing_address.province}}",
  "postal_code": "{{billing_address.zip}}",
  "country": "{{billing_address.country_code}}"
  }
  };
  if("{{ customer.email }}"){
    enhanced_conversion_data.email = "{{ customer.email }}";
  }
  if("{{ billing_address.phone }}"){
    enhanced_conversion_data.phone_number = "{{ billing_address.phone }}";
  }
</script>
{% endif %}
<!-- FEEDARMY END Global site tag (gtag.js) - Google Ads V1.8 -->

Verifying and Testing

Verifying

You can verify if the code is working if you go to Google Ads > Tools and Settings > Conversions > here check if the status is verified.

Testing

First open up Tag Assistant when the new window opens up make a test payment to check if the conversion tracking is correctly installed. When you are on the final thank you page check the data within Tag Assistant.

Tip:
first_time_accessed is for the page, not for the customer. Subsequent orders will run a first_time_access again for the same person if it is a new browser session.

Trouble Shooting Enhanced Conversions

Make sure you have waited at least 3 to 7 days. Google requires time to compile the data.

Coverage:

You may encounter issues with regard to coverage. This can happen when customers pay through a third-party payment processor (PayPal), which may require that they enter customer data on a different domain instead of directly on your website like they do when they do not use a third-party payment processor. 

Google Ads Enhanced Conversion By Tags

Match status:

If you are having issues with the match status, not all users fill out all the fields in your checkout. What you could do is remove the attributes in your Google Ads conversion list to only track emails or only track mandatory fields in your checkout.

By removing non-mandatory fields, you will avoid submitting empty fields to Google.

Google Ads Enhanced Conversions Match Status Issues

Enable Remarketing

Track your existing website visitors by installing remarketing for Shopify. A returning visitor is twice as likely to convert as a first-time visitor. Use this data for display remarketing ads and audience targeting.

Enable Micro Conversions

If you like to track more minor conversion actions ie, micro-conversions such as add to cart, view cart, add a delivery address. Then install Google Analytics Goals.

Support My Work!

My conversion tracking code is constantly updated and provided free for anyone to use. As I don’t ask for anything in return, I would be grateful if you consider leaving a review: https://www.trustpilot.com/review/feedarmy.com

Change Log

  • V1.8 – 10 August 2022 – Added enhanced conversion checks for email and phone number
  • V1.7 – 07 June 2022 – Fixed incorrect total value when changing shipping and tax settings
  • V1.6 – 28 April 2022 – Fixed the country code not adding the value correctly as highlighted by Jon Yildiz
  • V1.5 – 27 July 2021 – Added Enhanced Conversions using Javascript and removed CSS
  • V1.4 – 21 July 2021 – Added Enhanced Conversions using CSS
  • Due to server migration, older changes are not listed

Need Help?
Do You have a question or need specialist support? Get in touch!

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

80 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
George
7 days ago

Hi – have you got an update for this for G4 tracking? Many thanks, George

Stephen
Stephen
1 month ago

Hi, for UK market we get Issues detected with your enhanced conversion setup, I believe this is because they do not use a “State”, if we leave State blank in the Enhanced Conversions setup page we still get errors, is there another enhanced_conversion_data. that should be used?

Jonathan Reed
Jonathan Reed
1 month ago

awesome! It works. I have a question, I have two accounts, how to merge and paste their enhanced conversion codes? Or do I need to paste the code twice?

Dmitry
2 months ago

Hey, Emmanuel . Please help, I have left my comments in this question https://stackoverflow.com/questions/73611320/ga4-purchase-event-duplicate/74266851#74266851
We have doubling of events when debugging in Tag Manager – view_item, add_to_cart, begin_checkout, purchase. Everything doubles. Seems that in TagManager all these events are pushed to dataLayer. How can we turn off this doubling of conversions in Ads as we don’t need it.
There is no shopping app in Shopify, but Ads and Merchant Center are connected to Shopify. Appreciate your help.
Thank you

Dmitry
Reply to  Emmanuel Flossie
1 month ago

Hi Emmanuel! Thank you for your answer . I found this trekkie when inspecting the code so I suppose it is it who doubles my events. They are pushed with dataLayer with the conversion labels exactly the same as my Google Ads tag ‘AW-…’ Moreover the names of events are the same as reserved GA4 ecommerce events – view_item, add_to_cart , etc. But there is no GA4 configuration in GTM set up twice.
Also I found comment on December 3, 2020 at 5:51 am in this article https://business.czarto.com/2020/09/29/shopify-google-ads-conversions/. I think it is Google Shopping app who creates them automatically and sends to Ads.

Odera Joseph
2 months ago

What the FFFF! It works. Love this!!!

Taha
Taha
6 months ago

Hey,
I setup everything as you mentioned.
Google conversions says “Recording enhanced conversions” in the diagnostics tap.
But I can’t see any of the test purchase data with Tag Assistant!

Thanks!

Taha
Taha
6 months ago

Did it work for you?

Gregory
Gregory
7 months ago

Hi Emanuel! Thanks for your great blog!

Can we just use javascript variables from the Shopify object?
Like
Shopify.checkout.email

Shopify.checkout.phone

Shopify.checkout.shipping_address.first_name
Shopify.checkout.shipping_address.last_name
Shopify.checkout.shipping_address.address1
Shopify.checkout.shipping_address.city
Shopify.checkout.shipping_address.province
Shopify.checkout.shipping_address.country_code
Shopify.checkout.shipping_address.zip

Thanks =)

Jon Yildiz
Jon Yildiz
8 months ago

Two things: The “country” variable you’re passing from the billing_address object passes the full name of the country, but Google expects the ISO country code, which is billing_address.country_code

Also, can I ask why we’re making changes to the code but then using the code to pass javascript variables? What’s wrong with choosing “website code” as the implementation method and just passing those in the “order page additional tracking” edit?

Gene
10 months ago

Hi, before install this Google Ads Enhanced Conversion Code, should I need to delete the original Google Ads Conversion code which be installed before? Is the Enhanced conversion code can replace the conversion code?

Vincent
11 months ago

Hello Emmanuel

I dont have the option of enhanced option to check you know why ?

mathias
mathias
11 months ago

Is there a way to delete the tracking caused by the app in the first place?
as in I replaced the tracking with my own tracking and the feed from the app is no longer needed.

Gooner Fermat
Gooner Fermat
1 year ago

Hi,

I set up following your guide and there are some problems:
1. There are 2 google site tag in my site (duplicated, I also add remarketing tag from your guide)
2. When I made a test payment and check via Tag Assistant:
– There is no enhanced code. It seemed not work
– There is a “purchase” event that I believe from Remarketing setup
– In “Conversion” event, the label did not come from our account
– There are more 6 google site tags in final checkout page (total 8 google site tags), it seemed duplication

Can you help resolve this problem ?

Raman
Raman
1 year ago

How to added enhanced conversion tracking for shopify rechargeapp?

imran
imran
1 year ago

little off topic Emmanuel, in the default shopify app is there anyway to exclude some variants of a product from syncing to merchant center? right now i am manually deleting that specific variants everyday from merchant center because app is auto uploading everyday.

Agata Matusz
1 year ago

I have Google Sales Channel App installed and hence all conversion tracking is installed automatically. Having read the comments and also having tried to implement the enhanced conversion, it seems that the enhanced conversion for Shopify (NOT Shopify Plus) can only be installed with the conversion tracking set up in a way this tutorial outlines – and not through Google Sales Channel App. Is this correct?

Derrest S Williams
1 year ago

Why would you get rid of the App? Just make conversion action sets and add it to AD Word Campaigns

Tejo Ramakanth Ravuri
1 year ago

Hi Emmanuel,
After implemtation of this script in Shopify additional scripts, few conversions are counted twice.

Craig Berger
Craig Berger
1 year ago

Thanks for the response Emmanuel! Much appreciated.

Craig Bergerg
1 year ago

Hello Emmanuel,

I am trying to used Enhanced Conversions and have completed the steps you listed in this article, and I am getting the below error message under Diagnostics of Enhanced conversion by tags.

“Your customer data setup has some issues. Make sure your customer data is formatted correctly.”

Would you know how to correct this?

I am currently using the Google Shopping Sales channel, and also wanted to know if there is anyway to disable or remove the automatic tracking code that the Sales channel uses and insert my own code for Google Ads tracking, while still keeping the product feed from the Google Shopping Sales Channel.

Thanks for your help!

Suhail
1 year ago

Hi,

I used this code and made a test order. When viewing the source I noted the value was “59999” not “599.99”, can you help resolve this?

Ali
Ali
Reply to  Emmanuel Flossie
1 year ago

I have an error in Enhanced conversion by tags. 1 out of 4 will show some error \”Your match status has some issues \” that is match status. All other three Current status, Coverage, Customer data validity are fine.
Can you please guide me on how I can solve this issue?

Mike
Mike
3 years ago

ok…so this is completely different from what Shopify says to do- and what we think was done by our developer. We had google analytics installed first. What if the GlobalTag snippet is already in the “theme.liquid. code? right under <head>do we add it again in the in the “order processing” field?

Sérgio Chaves
Sérgio Chaves
3 years ago

Hi Emmanuel, just to confirm This global site tag, defintly is not to put as i already put your remarkting in checkout right? also google tag assitance dont work to check convertion, and has to be inspecting the code is that? just to double check! keep blasting!

Mari
Mari
3 years ago

Hi Emmanuel, Thanks for this tutorial! I want to confirm we add the global tag and the snippet to the checkout page, but we don’t add any tags to the theme.liquid? I currently don’t have any global tag on my theme.liquid to test it. When I did have it, google tag assistant wouldn’t recognize it, with your tutorial I took it out and just added both tags to the checkout page. My store is not shopify plus. Thanks!!!

Amandeep Sandhu
Amandeep Sandhu
5 years ago

1) What was the purpose of writing “order.order_number” after transaction_ID? I saw a video that did it without that so i’m just curious what exactly it does.

2) I’ve heard that if someone refreshes the checkout page or clicks the back button to the checkout page, then it can cause another conversion to fire. Have you encountered this problem before? I saw in a video someone entered if statement (the 2 lines of code i pasted below), and all the other code you talk about in the instructions is entered in this if statement. I’m just wondering if you’ve had the issue of multiple conversions firing from a single purchase and if it’s worth entering the code below?

{% if_first_time_accessed %}

{% endif %}

Emmanuel Flossie
Reply to  Amandeep Sandhu
5 years ago

1) This is to avoid duplicate orders. It registers the order id to avoid the same order being registered more than once.
2) It fires the code, not another conversion as the order ID is already registered. If you check the tutorial I have added a second fail safe with if_first_time_accessed

Hope it helps.

Chris Sauthat
Chris Sauthat
5 years ago

Hi,
Thanks Emmanuel for this tuto, but I do the same that you wrote, but when I test with Google assistant for see if the code is installedvery well , I have a message ‘some product are not valide’ and I have already synch with merchand center. I don’t know why.

Each tile to try to validate, I have still same error.

Could you help me please?

Thanks

Emmanuel Flossie
Reply to  Chris Sauthat
5 years ago

You will need to make a test payment to check if the conversion tracking is correctly installed. When you are on the final thank you page of the checkout, use Tag Assistant to validate the code. You can not view the conversion tracking on any other page than the single final page in the checkout. Also you can not check with Merchant Center if the code works, conversion tracking has nothing to do with Google Merchant. I think you are confused with the remarketing code, which is something completely differently. Please go to the previous mentioned URL. As currently you are asking questions regarding conversion tracking. If you want personal assistance, please email me [email protected]

Chris Sauthat
Chris Sauthat
5 years ago

Hi,
i would like also add conversion code for add to cart and remarketing, where i can put these code please on shopify?

thanks

Emmanuel Flossie
Reply to  Chris Sauthat
5 years ago

For conversion tracking, please follow the tutorial above, for remarketing please check here : https://feedarmy.com/adding-google-adwords-remarketing-tag-to-shopify/

Stan Grzs
Stan Grzs
5 years ago

Hi,
I’ve done your tutorial, thanks a lot, this is really helpful.
But i cannot see the global site tag on my website page.
Do you know how to add it on my entire website through shopify admin please ?
thanks

Emmanuel Flossie
Reply to  Stan Grzs
5 years ago

Conversion tracking is only installed on the final page after the payment is made, the code is not visible to the rest of the website. Otherwise it would trigger a conversion every time someone visits a random page. If you want to check the code, you need to make a test purchase and check the code in the final page of the checkout. If you want to install remarketing on every page, please visit this tutorial here : https://feedarmy.com/adding-google-adwords-remarketing-tag-to-shopify/

Eliran
Eliran
5 years ago

Hey, and thank you for this.

One question though,
I did exactly as you said and pasted those codes into the Checkout Additional Code field. The thing is I’m not sure if it was done correctly, since I can’t see that on the Tag Assistant Chrome Extension (All I see is the Google Analytics).
Perhaps I’ve done something wrong?

I’m on the basic plan on Shopify if it matters…

Thank you.

Emmanuel Flossie
Reply to  Eliran
5 years ago

If you are installing the new GTAG code, Tag Assistant does not support it yet, it only supports the old conversion tracking code. The best way is to check in the sourcecode if you want to see the values of the conversion. You can also confirm if the code works in Google Adwords, by going to conversions tab and view the tag activity.

Eliran
Eliran
Reply to  Emmanuel Flossie
5 years ago

Thanks for the reply.
I’m not sure how to check in the source code to be honest.
When I go to the Conversion tab on Adwords, it says Unverified, and it’s been 12 hours.
So I’m guessing it is not installed correctly?

Emmanuel Flossie
Reply to  Eliran
5 years ago

Have you had a sale in Shopify? If not, than the code can not trigger. If you want to test if it works, make a test sale. Also I recommend waiting at least 1 day. Conversion tracking only works when a person has visited the final checkout page.

Eliran
Eliran
Reply to  Emmanuel Flossie
5 years ago

I didn’t have a sale.
So, I found this app: https://apps.shopify.com/adwords-conversion-pixel
But I’ll tell you the truth, it’s kind of scary to link my adwords account to some third partis. Who knows what they are doing with my information…

So to cut things short, as long as I make everything just as the guide you wrote, I should be fine in term of conversion tracking? I did install the app, but it’s something I’d rather delete to be honest…

Emmanuel Flossie
Reply to  Eliran
5 years ago

Yes hundreds of people have installed it using my tutorial, and I install it personally for all my advertising clients. So I can confirm it is correct as long as you have followed the tutorial.

Eliran
Eliran
Reply to  Emmanuel Flossie
5 years ago

Alright.
One last thing, remarketing tag, do you have tutorial for that too?

Eliran
Eliran
Reply to  Emmanuel Flossie
5 years ago

Thank you so much! I’m truly grateful 🙂

Emmanuel Flossie
Reply to  Eliran
5 years ago

pleasure

Clean Grin
Clean Grin
Reply to  Eliran
5 years ago

Hi just place a test transaction and on the thank you page with the Tag Assistant Chrome Extension you will see the result show a conversion linked to your adwords account and than you know its properly installed:)

Tarek Alight
Tarek Alight
5 years ago

This saved my day, I couldn’t figure if I should put both snippets in same place or if one should go somewhere else in my website!

Thank you

Emmanuel Flossie
Reply to  Tarek Alight
5 years ago

pleasure

80
0
Would love your thoughts, please comment.x
()
x