Easily add Google Ads conversion tracking to Shopify in less than 15 minutes.
Shopify Pixel
This Shopify Pixel / Customer Event code, has been tested and verified as working for Shopify merchants that have enabled Checkout Extensibility.
The first step is to get your conversion id and label.
Log in to Google Ads and go to Goals > Conversions > Summery
Click on the blue button that says + New conversion action
Select Website as your conversion method.
Enter your website address, and scan.
If you see a banner that says to use Google Analytics, then click on Use Google Ads only
Click on +Add conversion action manually.
- Choose Purchase as your Goal and action optimization
- Enter any conversion name, I will call it Shopify Pixel
- Select Use different values for each conversion
- Leave the rest unchanged and click on done
Check the box to turn on enhanced conversions and click on Agree and continue.
Click on See event snippet
Copy the code and paste in a temporary text file, we will copy some details at a later stage.
Click on Done.
Go to Settings > Enhanced Conversions
Make sure Enhanced conversions is turned on and that Google Tag is selected. Now click on Tag details.
Ensure Allow user-provided data capabilities is enabled and that the Automatically detect user-provided data is checked.
Now go to Shopify > Settings > Customer Events
And click on Add custom pixel
You can give it any pixel name, but I will call it Google Ads Conversion. Now click on Add pixel.
When editing the code below, please do not remove or change the author, and respect who built it.
// Created by FeedArmy V1.02
Paste the below code in the Shopify pixel.
// Created by FeedArmy V1.03
const script = document.createElement('script');
script.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=AW-132456798');
script.setAttribute('async', '');
document.head.appendChild(script);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-1003648725', {'allow_enhanced_conversions':true});
analytics.subscribe("checkout_completed", (event) => {
gtag('event', 'conversion', {
send_to: 'AW-132456798/abcdefg123456789',
transaction_id: event.data?.checkout?.order?.id,
value: event.data?.checkout?.subtotalPrice?.amount,
currency: event.data?.checkout?.subtotalPrice?.currencyCode,
email: event.data?.checkout?.email,
phone: event.data?.checkout?.phone,
first_name: event.data?.checkout?.shippingAddress?.firstName,
last_name: event.data?.checkout?.shippingAddress?.lastName,
address1: event.data?.checkout?.shippingAddress?.address1,
address2: event.data?.checkout?.shippingAddress?.address2,
city: event.data?.checkout?.shippingAddress?.city,
country: event.data?.checkout?.shippingAddress?.country,
countryCode: event.data?.checkout?.shippingAddress?.countryCode,
province: event.data?.checkout?.shippingAddress?.province,
provinceCode: event.data?.checkout?.shippingAddress?.provinceCode,
zip: event.data?.checkout?.shippingAddress?.zip
});
});
From your previously copied code from Google Ads, copy the AW-123456789 id highlighted in the image below.
And paste it twice on row 3, and row 10, by replacing the existing ID AW-123456789 (shown in red in the image above)
Go back to your Google Ads code and now copy the full ID and Label as highlighted in the image below.
Replace the send_to value between the quotes on row 14. (shown in red in the above image)
Now click on save in the top right corner followed by clicking on Connect, accept Shopify terms and conditions. And you are all done.
Testing
You can’t test code on Shopify’s checkout thank you page because it’s in sandbox mode, meaning tools like Google Tag Assistant or GTM Preview Mode won’t work. While you could use console.log to check data, I think it’s unnecessary effort. The code does work. Simply wait for a sale to confirm that it’s tracked in Google Ads as a conversion when it comes from an ad click or wait until you have any sale, Google Ads will show the code is detected.
Change Log
- V1.03 02 March 2024 : Supports multicurrency and used subtotal price instead of total
- V1.02 27 February 2024 : Public Release
Support My Work!
My conversion tracking code is constantly updated and provided free for anyone to use. As I don’t ask for any monitary value in return, I would be grateful if you consider leaving a review: https://www.trustpilot.com/review/feedarmy.com
Additional Scripts
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)
Now go to Tools and Settings > conversions > settings or click here: https://ads.google.com/aw/conversions/customersettings
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.
After you have checked the box and clicked on save, you will get a terms and conditions prompt, read it and confirm.
Now choose Google Tag and click on Tag Details.
Now check the box next to Specify CSS selectors or JavaScript variables
- Change CSS selector to Global Javascript variable
- Enter the following values for Email
- enhanced_conversion_data.email
Repeat the steps for Phone number 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.
If you have two fields such as post purchase and order status, then add the code to the order status field.
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 V2.2 -->
<!-- For the latest and updated code or tutorial: https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/ -->
{% assign fa_send_to = 'AW-123456789/abcdefghijlklmnopq' %}
{% comment %}DO NOT EDIT BELOW{% endcomment %}
{% if fa_google_coding %}{% assign fa_google_coding = true %}{%- else -%}{% assign fa_google_coding = false %}{%- 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});
var checkout = window.Shopify.checkout;
</script>
{% if first_time_accessed %}
<script>
gtag('event', 'conversion', {
'send_to': '{{ fa_send_to }}',
'value': checkout.total_price_set.presentment_money.amount,
'currency': checkout.total_price_set.presentment_money.currency_code,
'transaction_id': '{{ order_id }}',
});
var enhanced_conversion_data = {
{% 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 %}
{% unless checkout.email == blank %}"email": "{{ checkout.email }}",{% endunless %}
{% unless billing_address.phone == blank %}"phone_number": "{{ billing_address.phone }}",{% 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>
{% endif %}
<!-- FEEDARMY END Global site tag (gtag.js) - Google Ads V2.2 -->
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.
Change Log
- 8th September 2023 – updated the steps for enhanced conversion tracking
- V2.2 – 11 July 2023 – updated code to validate every value
- V2.1 – 24 June 2023 – updated checkout price to use presentment_money
- 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
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
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.
We are planning on switching to this code for enhanced conversions but I have a question. Our current script in the Additional Scripts section has this line in the code:
‘value’: {{ checkout.total_price | divided_by: 100.0 }},
Will the divide by 100 be a problem if we switch to yours?
The presentment price is the newer version for adding the checkout price. So yes that is correct.
Is there a version for Microsoft Ads?
Not at the moment, thanks for asking I will put it on the wishlist.
I have tested this to 4 of my accounts. I get the 100% same data of Google and Youtube app conversion data. Are these both work in the same process? or its just the coincident? I use other tracking tool. those have different data.
Yes, the data should be the same. That is correct.
You had another conversion tracking code previously. what will happen to that? Do i need to change to the new one?
In 2025, Shopify will no longer support additional scripts (as of writing), which means the additional script code will no longer be able to be implemented. So, to avoid any issues, use the Shopify Pixel version.
Thank You for clarification. looking forward to have an article on Consent mode from you.
Hi Emmanual,
I did all the necessory steps but it’s still not working…
It’s possible you have other issues or missed a step. For installation service, feel free to reach out to [email protected].
Hi Emmanuel ! Thank you so much for this detailed tutorial 🙂
I followed every step to the T, but the diagnostics of my conversion objective gets “Needs attention” status. The detailed message is “Implement in-page code in addition to Automatic for better results”.
I tried adding the global tag to the theme.liquid, but the message is still here…. It’s been 48 hours. I am not sure what I am missing.
Note that:
– the Google Shopping App Purchase conversion (which comes automatically from the Google and Youtube App in Shopify) also has that message.
– But the Purchase (Google Analytics Event) that I created from Analytics to my GAds does not.
So the issue seems to be coming from my Shopify site.
Do you have any idea ?
Are you using the additional scripts or the Shopify pixel? In either case, there is no need to install anything else in the theme.
You don’t have a message on the GA Event because it does not track enhanced conversions.
Please note that enhanced conversions take 45 to 75 days. So, make sure you have waited long enough after successful installation.
I was using the additional script first and though I did not have this Needs Attention message, I was not able to track conversions from Europe. So now I upgraded to the Shopify pixel. Okay I will wait and see what happens, thanks !
This guide does not talk about installing the Google Tag. Is that installed through the Customer Events?
What if we have the Google & YouTube Channel installed, what do we need to do/change?
Following the pixel method above, the Google Tag is in the code, as well as the previous method additional scripts.
If you have also installed conversion tracking with the Google and YouTube app, go to your conversions actions in Google Ads and set the one Google created to secondary and the new manually installed Shopify pixel to primary.
Is it okay to still keep to Google Tag in the theme.liquid ? Or better to remove it. Wondering if it duplicates anything in the trackings…
It does not duplicate purchase conversions. It may double track other things if you set it up, such as add to cart. Testing is recommended to see if that is the case.
Mmm I think I will get rid of the code I’m the theme.liquid then. Thanks !
Hi,
When I follow these steps for some of the accounts it still asks me to implement the CSS selectors manually. Would this impact any tracking? And why does it not show the enhanced conversion tracking under settings?
It’s possible that some of these accounts are not updated yet to the new system. Google updates accounts in stages, so not everyone will get all the options available.
You could also try to check the enhanced settings in the conversion action, not in the global account settings. It should have the option for automatic detection.
Hello,
Thank you for your guide and help.
I currently use the Google & Youtube app to link to GA4 and import conversions to Google Ads from there – however this doesn’t seem to be supported for setting up enhanced conversions.
I just wanted to check I can still follow this guide exactly as you have laid out and the code won’t conflict with my current setup with the app or lead to duplicate tracking?
And if I set up this purchase conversion would you recommend setting it up as secondary to my GA4 imported one?
Many thanks
Yes, you will have duplicate tracking, so what you need to do in Google Ads > Conversions is either set the other conversion action to secondary, or delete it.
If you set the new conversion action as secondary, it will not be used in the campaigns. If you want it to be used, set it as primary.
I have a few questions for you now that you added a solution for the Shopify Pixel, but first I wanted to say thank you for helping so many business owners by sharing your hard work!
Ok, onto the questions:
If our website needs to run Google Tag Manager for management of other tags, can we still use your method? My understanding is that you should only have one of either gtag.js or gtm.There is additional functionality in the additional scripts install method. Will you be adding this additional functionality to the Shopify Pixel install method?Is there any reason to go with your Shopify Pixel solution instead of the additional scripts solution if you have a Shopify Plus store? (I head Plus stores will retain additional scripts functionality).
Yes, you can use GTM and Google Ads methods.
GTM script and the Google Ads script don’t use the same source. GTM using gtm.js while Google Ads is gtag/js
You ask about additional functionality in the additional script, can you provide more details what extra functionality you are looking at?
What additional functionality are you looking at for Shopify Pixel?
Officially, Shopify will sunset additional scripts in 2025.
HI!
First of all, very clear instructions!
What’s weird with my account though, is that, when I make the Goal in Ads, I don’t get a AW ID + Label. It just says:
“<!– Google tag (gtag.js) event –>
<script>
gtag(‘event’, ‘conversion_event_purchase_3’, {
// <event_parameters>
});
</script>”
Any idea what I’m doing wrong?
Never seen this before, however it might be that you did not select website when you start the setup guide. Or after you clicked on website, you clicked on Create conversion actions from Web and App events. not sure.
Maybe try again?
I came across the same issue. It’s because I connected my GA4 to my Google Ads. When I removed this link from my GA4 admin, i was now able to see the same setup from the video.
Yes, just a week or so ago, I realized the same. However you don’t need to disconnect GA4, just click on the banner use Google Ads instead. Just after you tested the website URL.
Hi would you recommend updating stores with your older code before the Customer Events from Shopify with this new one you ahve created? Any better tracking from this new one?
Both track equally the same values. Only that in 2025 additional scripts will stop working.
i followed the steps, tried troubleshooting. the tag never fired even though its in the src. please help
Hello Kol, are you talking about the Pixel or the Additional Script?
Hello, thank you for the tutorial I have been using it for many clients. One question: Basically if you add this script in the checkout page you could also implement it via GTM because this will create an event right?
I have not looked into this, but I would assume so.
hey my freinds, now shopify use “customer events” to manage tracking code now,can you tell how to convert you code which added on Additional Scripts section to “customer events” section? Many Thanks…
Currently my code is not supported for Pixels or Customer Events.
Super helpful, although on google ads its still listing my conversion as “inactive”. I see the snippet code on the view source page so cannot for the life of me figure out what is wrong. It looks like it’s capturing every action up to clicking “pay now”.
This code, should not track anything else except for the conversion itself, Shopify seems to be having issue with the if first time check. A few months ago, I heard it was causing Shopify to block the data from being sent. You might want to try and disable this.
I have the same problem, what do you mean with first time check?
Shopify has a bug that if you use {% if first_time_accessed %} it will not work. So, remove this from the code. Not sure if Shopify will ever fix it, because now we are migrating towards Pixels. I recommend you install the pixel, and not the additional script.
I configured the enhanced conversion (Using Google Tag) as per the provided reference. However, as per the Google Tag Configuration, It takes up to 45 days to validate the data. Is there any way the validations can be confirmed earlier? The purchase conversion is verified and it’s recording conversion properly.
From Google’s side no, from your side, you can perform a test purchase and using Tag Assistant you can view the values submitted.
Hi,
I think the guide might be out of date by now as there are 2 additional code sections under Checkout section in Shopify now? In your guide just one field / section.
Please advise.
Seems I got it working by adding to the Post-Purchase page. Shopify is officially adding code to Order Status field instead.
The tutorial is not out of date, some merchants have two field, some don’t. It depends if you have enabled a feature or app that allows for post purchace processing. The code should be added in the order status field. I will update the tutorial to include this info. Thanks.
Thanks – good to know 🙂
What if I desire the prices to be sent to GA in shop currency instead of presentment currency?
From what I can see, Shopify does not expose the prices in Shop currency, only presentment currency. Is there a way around this? (Additionally, would not want GA doing the FX conversion for reasons such as they do not know the FX rate used for the transaction, etc.)
If you only list your products in the shop currency, when a user reaches the checkout and, ultimately, the thank you page, the conversion value sent to Google will be the shop currency price. The presentment currency and price will match what you charge at the checkout.
Hi Emmanuel!
In the last code versione V2.2 , where can I edit fa_include_tax_and_shipping? I’m using V1.8, where I’ve {% assign fa_include_tax_and_shipping = ‘no’ %} text code but don’t found it in code template V2.2. Am I missing something? Thank you!
Hello Fabrizio, including or excluding tax and shipping is no longer available in the new code, as new version is using better but limited coding.
Great Guide, I feel like a lot has changed since you wrote this.
1) Currently, I am not developing the Pixel version, as of writing it’s very inconsistant in when it works vs not works. Installing my code, does not require checkout.liquid and the code can be used by any Shopify subscription.
2) You can configure the settings near the drop down by clicking tag details. Google just did not make it clear.
This is awesome! Thankyou.
One question, when setting up my Google Ads tag and enhanced conversions, it automatically linked the tag creation to my existing gtag on site. Is this normal and is there anything extra I need to do?
Will it still work? I followed everything you did.
Yes, you will always use the same GTAG account id, regardless of conversion or remarketing tracking. It’s the data that follows that defines what info is sent.
Great article Emmanuel. I have a few questions…
I recently noticed that I was missing a lot of conversions inside my Google ads account. This was after the migration to GA4. However, after doing more research and tests, I noticed that some users bounce back from my post-purchase page after they buy and because of this, I wasn’t able to track the conversions.
I’ve been using enhanced conversions through GTM and then added the tracking scripts from my order status page to the post-purchase page.
However, after reading the Shopify official document about this, it seems that liquid code isn’t accepted on the post-purchase page, which from what I understand is the base on which is build the enhanced conversions tracking code…
Also, detailed address attributes like street, city, and region were not listed among the provided fields for the post-purchase page.
Would this mean that we can’t send enhanced conversion data in order to effectively track conversions that bounce from the post-purchase page?
If liquid coding is not supported in the post purchase page, then my recommendation is to use the javascript variables, namely Shopify.checkout
However, you need to check if address details are within the variables.
Hi.
I have set this up as descibed.
However the google ads pages have been updated.
The questions i have are as follows
-If i was not able to put in my enhanced conversion tracking information for variable, email, address etc, would your code still work as its meant to?
-Do we still add our google tag code to our shopify code between the <head></head>?
Thanks
To add the ehanced javascript variables, go to Conversions > Settings tab. Here you will see enhanced conversions, and you can configure it here.
Conversion tracking is only added in the additional scripts.
I have added the conversion code to the Shopify checkout section.
After that I got 2 sales.
Conversion status in Google Ads dashboard changed from “Inactive” to “No recent conversions”.
Last seen – “today”. Conversion value – 0. When I check Google Ads dashboard, there are 0 conversions.
What could be the reason? Maybe it’s because my website currency is in GBP, yet my conversion value in Google Ads is in EUR?
Thank you.
The reason could be that you have not yet had a conversion that originated from Google Ads. When the status is No recent conversions, it means the code is detected, which will be from a non-Google Ads conversion.
Only clicks on an ad that led to a conversion will be tracked.
There is no issue with Google Ads being in EUR, it will automatically convert to EUR values.
how can I add this conversion to GA4?
This is not for GA4, so you can not. This code is for Google Ads.
Now that Shopify allows users to make purchases in their native currencies, how will this convert the transaction value to the currency of the Google Ads account?
Please see below what Digital Darts says on the topic:
https://www.digitaldarts.com.au/google-ads-conversion-tracking-shopify
Firstly, it uses the currency and currency code from the user at checkout. The currency someone checks out with is called the “customer currency” or “presentment currency“. Shopify makes this available through JavaScript at checkout. This saves us a load of pain in having to format the ever growing number of currencies accepted in Shopify.
Many currencies like the Euro use a comma for the decimal point. The Norwegian Krone has a comma for decimals then separates three digits with a full stop. Google requires the purchase value to be free of commas and to have the decimal point a full stop. Shopify handles this for all currencies with
Shopify.checkout.total_price_set.presentment_money.amount
so let’s not recreate the wheel.Google will accurately convert the currency to match the billing currency on your ad account. Google documentation says, “…if the Google Ads account driving a click that converts has a different billing currency, the conversion value will be converted to that account’s currency using the average daily foreign exchange rate.”
Hello Yoni, thank you for pointing this out. The code is now updated to use presentment money. If the currency in the checkout is different from the currency in Google Ads, then Google will convert it to the Google Ads currency using the currency rate of the time of purchase. Using Google Finance.
For info, for several websites, the conversions tag doesn’t seem to be triggered anymore. The tag is not found on the thank-you page when I do a test.
I think you are testing it incorrectly. Please note that if you view the source (which is the second page view), part of the code will not be visible, because it will only show when you first view the page, any subsequent views will remove the conversion trigger to avoid double tracking. I also daily check my clients accounts and all are tracking sales.
Shouldn’t {{ checkout.currency.iso_code }} be used instead of {{ currency }}? I believe {{ currency }} outputs the symbol of the currency, but google wants the ISO code…
To allow for multi-currency support, which a lot of merchants have, checkout.currency.iso_code is required to ensure the correct currency code is added depending on the checkout currency. If this is not used, then the default currency will always show, which is not what we want.
I think you misunderstood my original question. I was asking if the code should read as follows:
gtag(‘event’, ‘conversion’, {
‘send_to’: ‘{{ fa_send_to }}’,
‘value’: {{ fa_checkout_price }},
‘currency’: ‘{{ checkout.currency.iso_code }}’,
‘transaction_id’: ‘{{ order_number }}’
But after doing some testing myself, I see that {{ currency }} is correct (checkout.currency.iso_code does not output anything on the thank-you page), and even chatGPT got this one wrong (this will age well!). All resources I found indicate that checkout.currency.iso_code should be used, but as I said previously after testing it you are indeed correct.
I see, I did not test your code example, and assumed it was a valid code. I am not able to test myself at this moment as Shopify is having an issue accessing my developer store. However as you have already done the test if checkout.currency.iso_code does not work, then it doesn’t work.
ChatGPT is not updated, and uses data prior to 2021. ChatGPT also does not credit where it gets its info from.
Hi. Thanks for the post. I don’t have an “additional scripts” form in my checkout -> order processing. Did this change recently when they added the post purchase form to checkouts?
Depending on other 3rd party apps you are using that affects the checkout, yes it will be order processing in this case.