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
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.
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
Now you can click on Save And Continue
Click on See Event Tag
Copy your Event Snippet and save it in a temporary file, for later use.
Click on Done
Click on the recently added 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.
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.
- 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
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.
Copy the send_to value (image below) and replace fa_send_to value with your value in the code template below.
- replace the value for fa_send_to
- replace the value AW-123456789/abcdefghijlklmnopq with your event snippet send_to value
- 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 afirst_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.
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.
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
Hi – have you got an update for this for G4 tracking? Many thanks, George
Yes, I have a service that offers the setup, you can read more here: https://feedarmy.com/google-analytics-4-shopify-event-tracking/
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?
I have re-tested the code and there are no errors, so you may have other conflicting issues. You can reach to me for personal support at [email protected]
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?
Hello Jonathan, yes, you will need to install the code twice. Each with the correct identifiers (account id and conversion label).
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
Hello Dmitry. Apologies for the late reply. Your message ended up in the trash. Usually, the doubling is caused by the GTM GA4 configuration being set up twice. Which means the code is submitted twice.
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.
Correct, the free google shopping app in Shopify, sets up conversion and remarketing automatically.
What the FFFF! It works. Love this!!!
Pleasure Odera.
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!
For a conversion to be shown in Google Ads, wait at least 24 hours.
For enhanced tracking to show / confirm tracking wait up to 75 days.
Did it work for you?
Yes, it works. You need to wait 24 hours for normal conversions, and 75 days for enhanced conversions.
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 =)
You can use Google Tag Assistant to see if data is available, if yes, I would assume it would work.
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?
Hello Jon, thank you for your comment, you are right it does need to be the ISO code. I have updated the code. Thank you.
However, I do not understand your question with regards to what is wrong with choosing website code. Do you mean the automatic method? There are multiple ways you can track enhanced conversions, I have chosen this method, to ensure the data can be submitted.
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?
That isn’t easy to answer. Depending on how the original conversion action was created, you may or may not need to remove it to replace the existing installation. If you don’t know the answer, I recommend beginning a new conversion action. However, it is possible to use the existing one, but this can only work depending on how the action was created. Via an app or manually.
Hello Emmanuel
I dont have the option of enhanced option to check you know why ?
Yes, if you are in niche that is considered sensitive, you can not track enhanced conversions. Such as healthcare, I have the full details here: https://feedarmy.com/kb/why-enhanced-conversions-are-not-available-in-google-ads/
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.
Hello Mathias, Yes simply click on the radio button and choose delete.
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 ?
Hello Gooner, thank you for your question and sorry for the late reply. Your message ended up getting flagged. Yes I am happy to help. Please email me at [email protected]
How to added enhanced conversion tracking for shopify rechargeapp?
Hello Raman, simply follow the instructions. And install the code the same way.
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.
You can not remove products in Google Merchant Center, as the content API from Shopify will submit it again the following day. To exclude products, you can follow this guide: https://feedarmy.com/kb/how-do-i-remove-products-in-google-shopping-adwords-campaigns/
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?
That is correct. If you are using the free shopping app, the automatically included code, can not be updated. However you can still add this code, and simply remove the automatically created conversion tracking in Google Ads.
Why would you get rid of the App? Just make conversion action sets and add it to AD Word Campaigns
If you are replying to Craigs question, this is because the user asked how to remove the free shopping app tracking, without removing the app itself. As that was the question, you can not remove the automatically integrated tracking with the Shopify free shopping app. The only way to remove all the extra tracking is by removing the app itself.
Hi Emmanuel,
After implemtation of this script in Shopify additional scripts, few conversions are counted twice.
The possibility is that you have other conversion tracking codes installed. Make sure only one is tracking conversions. If you only have one conversion code and it’s tracking twice, it’s possible users are buying multiple times. Each sale, even with the same user, is counted as a unique sale. And make sure the code is correctly installed. If you continue to struggle, please email me at [email protected]
Thanks for the response Emmanuel! Much appreciated.
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!
Hello Craig, thank you for your question. It can take a few days for Google to receive and check all data. You can test what data is on the thank you page by creating a test purchase. Then on the thank you page right-click save file. Now open your saved file in a browser and right-click view source and search for FeedArmy, here you should see all the values.
You can not disable tracking in the free shopping app you are using. Instead, you will need to use a different app that only creates the feed.
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?
Hello Sunhail, what is your currency?
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?
Hello Ali, make sure you have waited at least 1 week after installation. Google needs time to track data. If you have waited this long, then this needs to be analyzed. You can contact me on [email protected]
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?
While the Google Ads JavaScript file are the same the ID for Google Analytics starts with AU and for Google Ads it starts with AW. So essentially they are different.
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!
You can use Google’s new tag assistant: https://tagassistant.google.com/
And create an order to check the data.
If you already used the remarketing tag global tag, you do not need to use another global tag for Google Ads.
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!!!
The global tag can be installed everywhere as this is also used for remarketing tracking. However the conversion code can only be installed in the checkout section as we don’t want to track page views, just conversions. Also do not use Tag Assistant this does not work. You need to visually look in the source code or if this is beyond your abilities, wait till Google verifies the code which is usually within 24 hours or when a conversion takes place. You can see if its verified in Google Ads > Tools > Conversion Tracking
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 %}
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.
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
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]
Hi,
i would like also add conversion code for add to cart and remarketing, where i can put these code please on shopify?
thanks
For conversion tracking, please follow the tutorial above, for remarketing please check here : https://feedarmy.com/adding-google-adwords-remarketing-tag-to-shopify/
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
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/
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.
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.
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?
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.
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…
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.
Alright.
One last thing, remarketing tag, do you have tutorial for that too?
https://feedarmy.com/adding-google-adwords-remarketing-tag-to-shopify/
Thank you so much! I’m truly grateful 🙂
pleasure
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:)
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
pleasure