Created on 23 January, 2016 | Updated on 27 July, 2021

How To Add Google Ads Conversion Tracking to Shopify With 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

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 and select website as your tracking template.

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

Choose to install the tag yourself.

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.

Now choose Install tag yourself.

Click on download snippet for the Event snippet

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.

  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.

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.5 -->
{% 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 == 'yes' %}
{% assign fa_checkout_price = checkout.total_price | divided_by: 100.0   %}
{%- else -%}
{% assign fa_checkout_price = checkout.subtotal_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 = {
  "email": "{{ customer.email }}",
  "phone_number": "{{billing_address.phone}}",
  "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}}"
  }
  };
</script>
{% endif %}
<!-- FEEDARMY END Global site tag (gtag.js) - Google Ads V1.5 -->

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.

Enable Remarketing

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

Enable Micro Conversions

If you like to track smaller 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.5 – 27 July 2021 – Added Enhanced Conversions using Javascript and remvoed CSS
  • V1.4 – 21 July 2021 – Added Enhanced Conversions using CSS

Need Help?

37 thoughts on “How To Add Google Ads Conversion Tracking to Shopify With Enhanced Conversions”

  1. 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?

  2. 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?

  3. 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!

  4. 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!!!

    1. Emmanuel Flossie

      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

  5. 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. 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.

  6. 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

    1. 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]

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

    thanks

  8. 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

    1. 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/

  9. 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.

    1. 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.

      1. 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?

        1. 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.

          1. 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…

          2. 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.

    2. 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:)

  10. 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

    1. Login to Google Adwords > Conversion > and edit your conversion. Than go to value and choose the option : (The value of this conversion action may vary (for instance, by purchase price))
      Than save the code and you should see all the tags. If you continue to have issues, let me know.

      1. Hi can you help out with that, when you choose this option it says : You’ll need to edit your conversion tag to use transaction-specific values

        and thats where it becomes trikey

          1. Emmanual, your a Boss:)

            than you so much,
            like this it will show up my order# in adwords and will prevent duplicate transactions, let me know
            thanks

Leave a Reply

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