How to Setup Google Ads Conversion Tracking in Shopify

202 Comments

After completing over one hundred audits of Google Ads (AdWords) accounts for Shopify businesses, I am dumbfounded at the number of accounts that don’t have accurate conversion tracking setup. Agencies and store owners will spend tens of thousands each month with no idea what, if any part of the campaigns, generate sales. Other businesses may track a sale as one conversion, but they have no revenue data—the sale of a $10 product looks the same as a $1000 product.

Yet another mistake we see every month in Shopify is the failure to consider multiple currencies due to Shopify Markets or the multi-currency feature. Users can shop in their local currency. A 20,000 South Korean won purchase equal to US$17 ends up looking might fine when Google receives it as US$20,000.

The most common Google Ads tracking mistake we see in Shopify is someone installs some version of a tracking code. When it’s time to setup a shopping feed in Shopify, they need a simple solution given their lack of technical skills so they move on to install Shopify’s Google channel. The channel installs its own conversion codes. The result is usually a doubling-up of purchase data to bloat the account manager’s ego that they are raking in coin. Here’s an example of this from an audit we did two days ago:

Google Ads Conversion Tracking Not Working in Shopify

You have to know what searches, ads, products, and audiences succeed or fail at bringing in your ROAS goal. That requires accurate tracking.

This tutorial covers how to create the most perfect Google Ads conversion code you can with the latest features of cart data (basket data) and enhanced conversions. These two features result in more purchase data and reported conversions that drives profit. You’ll get the exact solution that we use on client stores to help Shopify stores grow through Google Ads.

Previously known as Google AdWords, Google Ads has three ways to setup conversion tracking in Shopify.

Option 1: If you accurately track sales in Google Analytics, the quickest solution is to import your transactions as a conversion goal. See the steps to import transactions from analytics to Google Ads. We never use this method.

Option 2: Google channel in Shopify. This option is better than the first because it is more foolproof. With that said, I did say people still stuff this by doubling up with other purchase conversion events. You get a variety of additional conversions automatically created like “Add to Cart” and “Begin Checkout” that can be used to leverage bidding algorithms. The data doesn’t distort reporting because the events are excluded from the “Conversions” reporting column and associated metrics. The downside of this option is it makes no use of cart data or enhanced conversions that result in more data and more conversions. You’ll see what you’re missing out on soon.

Google channel in Shopify with various conversions

Option 3: Manual implementation with full features covered in this guide. The tutorial covers why you need to edit the existing Google Ads conversion code and how to do it for the best data using the latest features for ecommerce. We use this solution to help Shopify stores grow.

I also like this option over importing a purchase conversion through Google Analytics because my testing has repeatedly shown sales through Google Ads are lost to the (direct)/(none) traffic source in Google Analytics due to cross-domain tracking limitations or other marketing channels depending on your attribution settings. This means your advertising would lack the proper attribution it deserves for generating sales. For one of my Google Ads clients I was able to attribute more than double the sales of Google Ads with the conversion tracking code compared to analytics. That level of data accuracy can be the difference between the death of an ecommerce business and it thriving.

You will learn how to setup Shopify with gtag.js tracking for Google Ads. One benefit of gtag.js is its simplicity. The second benefit is its increased accuracy over the older ga() functions to combat intelligent tracking prevention in Safari. Here we go.

1. Create your conversion in Google Ads

1. In your Google Ads account from the top-right, click the spanner icon. Under the “Measurement” column, go to “Conversions”:

Google AdWords conversion tab

2. Create a new conversion. Click “Website”.

Use the following settings for your conversion:

  • Name: The name can be anything. I recommend you make it “Sales”
  • Category: “Purchase/Sale”
  • Value: “Use different values for each conversion” and select the currency used in your Shopify store. It is okay if this currency is different to your ad account as Google will do the currency conversion. You could enter your average order value (AOV) taken from Google Analytics as the default value. Your average order value can be gather from the “Conversions” > “Ecommerce” > “Overview” section. However, as you’ll see, this value is never empty because we’ll replace this with a liquid variable that contains the order amount in dollars.
  • Count: “Every”.
  • Conversion windows: “30 days”. If your products cost more than $200 or you know customers take weeks to research a product before buying, extend the value to “90 days”.
  • View-through conversion window: “1 day”.
  • Include in “Conversions”: Tick this option. The setting lets you decide if these conversions should be included in your “Conversions” and “Conversion value” columns
  • Attribution: “Linear”. Let’s say a person clicks one ad then returns to Google for another search. They then click another ad and buy. The first ad should receive recognition for the sale so you can more accurately optimise campaigns with this data. The linear model means each ad and search term will get 0.5 of a conversion. If you used the last-click option, the first ad would get 0 and the second ad would get 1 conversion. Never use the last-click option because it ignores the effect of upper funnel ads. We will geek out on the various models soon. Linear is a good default.

Your event tag options will look something like:

Google Ads conversion options for Shopify

3. Save to finish creating your conversion code in Google Ads. Select the option to “Install the tag yourself”.

4. Click “The global site tag isn’t installed on all your HTML pages” option for the global site tag.

5. Click the “Page load” option for the event tag.

We will need to modify the event tag then add the global tag and the modified event tag to your Shopify store to complete setup. But first, I want to educate you about attribution.

Picking the Perfect Attribution Model

If someone clicked on you Google Shopping ad, looked at a product but didn’t buy, then later returned to the site through a branded search ad before purchasing, would you attribute 100% of that purchase to the branded keyword? Unfortunately, most stores use an attribution model that ignores earlier interactions.

Attribution modelling in Google Ads and Analytics is a set of rules that determines how each transaction or conversion is credited. Within Analytics, the last-click model (most commonly used by novices to measure sales and goal completions) attributes 100% of the sale to the last action associated with how the user accessed the site such as organic, paid search, or other channel. The first click does the opposite which grants 100% to the first interaction. Realistically, ecommerce stores often see a journey with a variety of interactions before a user becomes a customer. This is why you must consider what model is best.

There are a number of attribution models available to use.

Linear: I recommend this model when you first set up your attribution modelling. It attributes the sale evenly across all touchpoints or interactions the customer has had throughout their buying cycle. This will help you understand how each platform in your multi-channel marketing strategy has benefited your revenue. For example, if the customer originally came to the site through a Facebook product ad, came back again through Google Shopping, then came back via a search ad and eventually came to the site organically, the linear attribution model will award 25% of the sale to each channel.

First click: This model awards 100% of the conversion or sale to the first interaction or touch-point the customer had. It is useful to identify how your customers are finding you, but the model disregards later touch-points the visitor has with your business. You will not know what led to the sale when there is more than one click.

Last click: The opposite of first click attribution—it attributes 100% of the sale to the last interaction had by the customer. It is badly favoured by many online retailers. Given businesses get customers on many marketing platforms, it’s vital to know the influence each platform has had on the sale. Last click doesn’t give you this information.

Position-based: This is a mixture of all of the above but with the majority of the conversion (about 80%) split between the first and last click. The remaining 20% is attributed to the middle of the funnel. This can work for many ecommerce retailers. Those with more expensive items may find the middle touch-points are not attributed enough as larger items are usually a longer consideration process for the customer.

Time decay: The most complex model of all of them. Time decay puts the most emphasis on the last click, however it attributes a percentage to other touch-points in the journey. The touch-points furthest away from the sale get the least attribution, building up to the most attribution at the final touch-point. This model is worth considering if your customers take a longish time-to-purchase.

Data-driven: An automated attribution method that uses real historical data. Google will look at many data points to build your own attribution model. You may not have this model available as it initially requires 600 conversions through a single conversion action over 30 days. Use it when you meet the requirements. You can learn more about data-driven attribution.

For further help with selecting the best attribution model when your campaigns progress, refer to the Model Comparison Tool. You will be able to test the affect different models have on your data.

2. Enable Enhanced Conversions

Enhanced Conversions is a new Google Ads tracking feature that improves the accuracy of conversions through hashed first-party data. The hashed data is matched with signed-in Google accounts for better attribution. This tutorial matches customer data from their Shopify purchase to their Google Ads account.

1. When viewing details of the conversion, tick to enable enhanced conversions:

Enhanced Conversions

2. Select “Global site tag or Google Tag Manager”.

3. In the Shopify admin, go to a customer order. Under “More actions”, select “View order status page”. Copy and paste the URL in Google Ads to check the URL.

4. You’ll then need to confirm how you want to set up enhanced conversions. Select “Edit Code”. Save.

5. The enhanced conversions code is not yet set up. You’re about to do that. Once conversions come in, the tracking status of the conversion will say “Recording (processing enhanced conversions)”:

Processing enhanced conversions

3. Configure the Conversion Code

The standard event code responsible for tracking that Google gives you will look something like:

<!-- Event snippet for Sales conversion page -->
<script>
  gtag('event', 'conversion', {
    'send_to': 'AW-880346044/44BbCP7Vz3AQvIfkowM',
    'value': ,
    'currency': 'AUD',
    'transaction_id': ''
  });
</script>

Do not add this to your Shopify store. It’s useless.

We’re not just going to put sparkles and perfume on this bad boy. We’re putting the standard tracking code under full anesthetic for a total body transformation. The good news is you don’t need technical knowledge.

Here’s the template code to copy:

<!-- START Google Ads enhanced conversions and conversions with cart data by DigitalDarts.com.au v1.7.1 -->
{% assign UA-ID = "UA-PROPERTY_ID" -%}{%- comment -%}Google Analytics tracking ID.{%- endcomment -%}
{%- assign AW-ID = "AW-GOOGLE_CONVERSION_ID" -%}{%- comment -%}Google Ads conversion ID.{%- endcomment -%}
{%- assign product-id = "product-id_variant-id" -%}{%- comment -%}The format of the product IDs in the feed. 3 accepted values "sku" (SKU of the variant e.g. aga-012), "variant-id" (variant ID e.g. 21283160948841), or "product-id_variant-id" (product ID underscore then variant ID e.g. 28541777444969_21283160948841).{%- endcomment -%}
{%- assign product-id-prefix = "shopify_US_" -%}{%- comment -%}Prefix to product-id. Leave blank if there's no prefix. This is likely needed if product-id_variant-id is selected so 28541777444969_21283160948841 becomes shopify_AU_28541777444969_21283160948841.{%- endcomment -%}

{%- comment -%}Below sets variables for Google conversions with cart data.{%- endcomment -%}
{%- assign send_to = "AW-XXX/XXX" -%}{%- comment -%}The send_to variable from the Google conversion code.{%- endcomment -%}
{%- assign aw_merchant_id = "YYY" -%}{%- comment -%}The Google Merchant Center ID{%- endcomment -%}
{%- assign aw_feed_country = "AU" -%}{%- comment -%}The country associated with the feed. Use CLDR territory codes.{%- endcomment -%}
{%- assign aw_feed_language = "EN" -%}{%- comment -%}The language associated with the feed. Use ISO 639-1 language codes{%- endcomment -%}

{%- comment -%}DO NOT EDIT AFTER HERE{%- endcomment -%}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ UA-ID }}"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', '{{ UA-ID }}');
  gtag('config', '{{ AW-ID }}', { 'allow_enhanced_conversions': true });
</script>

{% if first_time_accessed %}
<!-- START enhanced conversions -->
<script>
var enhanced_conversion_data = {
  {% unless checkout.email == blank %}"email": "{{ checkout.email }}",{% endunless %}
  {% unless billing_address.phone == blank %}"phone_number": "{{ billing_address.phone }}",{% endunless %}
  {% unless billing_address.first_name == blank %}"first_name": "{{ billing_address.first_name }}",{% endunless %}
  {% unless billing_address.last_name == blank %}"last_name": "{{ billing_address.last_name }}",{% endunless %}
  "home_address": {
    {% unless billing_address.street == blank %}"street": "{{ billing_address.street }}",{% endunless %}
    {% unless billing_address.city == blank %}"city": "{{ billing_address.city }}",{% endunless %}
    {% unless billing_address.province_code == blank %}"region": "{{ billing_address.province_code }}",{% endunless %}
    {% unless billing_address.zip == blank %}"postal_code": "{{ billing_address.zip }}",{% endunless %}
    {% unless billing_address.country_code == blank %}"country": "{{ billing_address.country_code }}"{% endunless %}
  }
};
</script>
<!-- END enhanced conversions -->

<!-- START conversions with cart data -->
<script type="text/javascript">
  gtag('event', 'purchase', {
    'send_to': '{{ send_to }}',
    'transaction_id': '{{ order.order_number }}',
    'value': Shopify.checkout.total_price_set.presentment_money.amount,
    'currency': Shopify.checkout.total_price_set.presentment_money.currency_code,
    'discount': discount(),
    'aw_merchant_id': {{ aw_merchant_id }},
    'aw_feed_country': '{{ aw_feed_country }}',
    'aw_feed_language': '{{ aw_feed_language }}',
    'items': items()
  });
  function discount(){
    if (Shopify.checkout.discount == null) {
      return 0;
    } else {
      return Shopify.checkout.discount.amount;
    }
  }
  function items(){
    var jsonarray = [];
    for (var line_item_count = 0; line_item_count < Shopify.checkout.line_items.length; line_item_count++){
      var jsonobj = {
        id: {%- if product-id == "product-id_variant-id" -%}'{{ product-id-prefix }}' + Shopify.checkout.line_items[line_item_count].product_id + '_' + Shopify.checkout.line_items[line_item_count].variant_id{%- elsif product-id == 'variant-id' -%}Shopify.checkout.line_items[line_item_count].variant_id{%- elsif product-id == 'sku' -%}Shopify.checkout.line_items[line_item_count].sku{%- endif -%},
        quantity: Shopify.checkout.line_items[line_item_count].quantity,
        price: Shopify.checkout.line_items[line_item_count].line_price
      };
      jsonarray.push(jsonobj)
    }
    return jsonarray;
  }
</script>
<!-- END conversions with cart data -->
{% endif %}
<!-- END Google Ads enhanced conversions and conversions with cart data by DigitalDarts.com.au v1.7.1 -->

You’ll now edit the top part of the code:

  1. Replace UA-PROPERTY_ID with your Google Analytics tracking ID.
  2. Replace AW-GOOGLE_CONVERSION_ID with your Google Ads conversion ID.
  3. Set the ID variables based on your shopping feed:
    1. There’s three accepted values of sku (SKU of the variant e.g. aga-012), variant-id (variant ID e.g. 21283160948841), or product-id_variant-id (product ID underscore then variant ID e.g. 28541777444969_21283160948841). To see what to select based on the ID format you’re using in the feed, log into Merchant Center, click “Products” then “All products”. View the column “Item ID”. You may also find it helpful to log into the Shopify admin then cross-check a product’s settings with Merchant Center. Bonus advanced tip: when editing product pages in the Shopify admin, the last number in the URL is the product ID. You can see if this value is used in the ID format of your feed.
    2. Replace shopify_US_ with the prefix for the ID format in your feed. Leave blank if there’s no prefix. A prefix is only needed 99% of the time if you select product-id_variant-id. This is so 28541777444969_21283160948841 becomes shopify_AU_28541777444969_21283160948841 in order for the format to match the “Item ID” values you see in Merchant Center.
  4. Set your variables for Google conversions with cart data. AW-XXX/XXX is the send_to variable from the Google conversion code. This value is inside the “Event snippet” of the conversion.
  5. Replace YYY for the aw_merchant_id variable with your Google Merchant Center ID. You can get this number from the very top-right corner of your Merchant Center account. It is typically a seven to nine digit number.
  6. Replace AU with the country associated with the feed. Use CLDR territory codes.
  7. Replace EN with the language associated with the feed. Use ISO 639-1 language codes.
  8. Save the code in a notepad (.txt) file or some other document that will not modify characters. Do not use Microsoft Word as that alters characters. Alternatively, you can skip straight onto the next step without the preamble explanation about this code.

Here’s a summary of what happens with this Google Ads conversion tracking code.

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

Secondly, the snippet uses the transaction_id parameter to prevent duplicate conversions when customers visit the thank you page a second time.

Thirdly, for whatever reason, implementing transaction_id does not always stop duplicate conversion data. The code we want to only run once is wrapped in the following liquid, which runs scripts only on their first time of the order status page: {% if first_time_accessed %}...{% endif %}

Fourthly, it uses cart data. The cart data feature adds a layer of information on top of each conversion. In Google Ads you get to see what items are purchased via ad clicks, which products convert better, what items are top sellers, and what profit was made. Thanks to cart data, you get to see what product was purchased even if it was different to the SKU clicked on in the shopping ad. I won’t go more in-depth as to what it does for Google Ads management. I was the first to write about cart data early 2020 in a guest blog where you can read more about it.

4. Add the Google Ads Conversion Code to Shopify

1. Log into the admin section of your Shopify store. Go to “Settings” > “Checkout”. Under “Order status page” and the field “Additional scripts”, paste your code.

2. Click “Save” in Shopify and you’re done! You will now start receiving conversion cart data with enhanced conversions inside Google Ads.

How to Test the Code

We’ve never run into issues implementing the above code for our Google Ads Shopify clients. If you want to test what is output, you can view most of it from the source code. Edit the code by putting {% if first_time_accessed %} right before its closing {% endif %} tag then review the source code of a past order.

Not all values will be visible because the conversion tracking code contains the Shopify.checkout object. You need competency in Chrome Developer Tools to view what parameters are sent to the Google Ads script. You can also insert the following code before the last </script> tag then view the console in the browser’s developer tools to see what the variables contain:

console.log({
  'value': Shopify.checkout.total_price_set.presentment_money.amount,
  'currency': Shopify.checkout.total_price_set.presentment_money.currency_code,
  'discount': discount(),
  'items': items()
});

For other debugging, go to the conversions section in Google Ads, click on the conversion, then click on “Webpages” from the top to view what pages are triggering the conversion. There’s also an enhanced conversions diagnostics report.

Alternative: Google Analytics Import

The primary method shared above will work with everyone. However, there is another way that requires Google Analytics. You may want to resort to this solution while you get the better method implemented.

1. Go through my Google Analytics setup for Shopify to get clean data in Analytics. Your goal is to have your source/medium report in Google Analytics with conversion data attributed to traffic sources like google / cpc :

2. Create a new conversion. Click “Import”.

3. Select the type “Transaction” from the primary view you use in Google Analytics that has the most complete and accurate data.

4. Click “Import and Continue”.

5. Once you’ve created the goal, click on it to edit it. The only value I suggest you change is the attribution model from “Last Click” to “Linear”. Your settings will look like:

You are done importing transaction data from Google Analytics into Ads.

As a Shopify Marketing Expert and Google Partner, we’ve helped many Shopify stores grow with Google Ads. If you’d like us to take away the stress of doing paid advertising well, read about our Google Ads service for Shopify stores.

Liked this article? Get more free Shopify guides:

Related Posts

202 Comments. Leave new

  • Thanks for your article, it’s been really helpful 🙂
    Just one issue I’m experiencing: conversions are being tracked by Adwords like twice the real amount… I have set the “{% if first_time_accessed %} -tracking code- {% endif %}” tags to avoid the code running again when the user comes back to visit the status page, but even doing that the issue persists… Do you know what could be wrong? We can’t take the information Adwords give us seriously to take campaigns decisions, it’s a real problem. Thanks for your help!

    Reply
  • Mine is set up right according to your instructions, but no conversion data is being shown in Adwords (and there should be.) Initially, conversions were being attributed to “referral traffic” so I added the “checkout.shopify”, paypal, and my own domain, to the “referral exclusions list”, however still no conversions are being attributed to Adwords. I went back through my GA Import steps and all are set up as you outline. One note, I decided to change from “last click” to “first click” attribution just in case something about the click attribution is throwing off the tracking. Any thoughts?

    Reply
  • Thanks for this tutorial. But if I just pasted this code provided without some further edits it would be wrong correct? Just want to make sure, in step #2, with web browsers with javascript disabled. I can’t just paste that code provided here, without also making sure my conversion_id, conversion_label and conversion_currency match my original code provided by Google right?

    Reply
  • Does this work if I’m using the Shopify Lite version which is just the “Buy Button”?

    Reply
    • I haven’t tested on Shopify Lite, but if you get to the thank you page on checkout.shopify.com after payment, which loads the code, it will work.

      Reply
      • I too am using the Shopify Buy button and Shopify Lite. So everything is hosted on my own website at one domain then at checkout it opens a second window with the .myshopify.com URL.

        Will your instructions work or is this cross domain thing mean I need extra steps?

        Reply
  • Hey Joshua, thanks for the tutorial,
    In the script i get from Google i don’t have the line : var google_conversion_value = 1.00;
    Should i add anyway : if ({{ subtotal_price }}) { var google_conversion_value = {{ subtotal_price | money_without_currency }}; }

    Reply
    • When setting up the conversion code in AdWords, select the value field that is suggested in the guide. This insert the google_conversion_value line. It may work if you insert the custom-coded line, but just follow what is suggested.

      Reply
  • Thanks for the tutorial Joshua..
    In the “Shopify additional content & scripts” in the checkout tab, I already have a code for google trusted stores, so can I just put both codes together; one after another? or this won’t work?

    Reply
  • Hi Joshua,

    Thanks for this, very useful!

    How do you stop duplicate conversions being tracked in Google Analytics when someone revisits the thank you page?

    Reply
  • Just wanted to know if i can use 2 separate codes in additional script section?

    Reply
  • Hi Joshua,
    In an email, I asked you if I should use the same conversion tracking tag for two separate Shopify stores and you told me to create a new conversion code for the second store.
    However, when I try to create a second code, Adwords just keeps giving me a code with the same conversion ID. So, how do I go about creating a second tag with a unique conversion ID?
    Thanks!
    Norma

    Reply
  • Hi Josha – i just edited per your instructions within the additional scripts box on Shopify. But, I pasted the original script from Google right beneath the affiliate conversation tracking script – is this OK?

    Reply
  • Avatar for Anthony Donbavand
    Anthony Donbavand
    October 18, 2017 11:59 pm

    Will this now need updating inline with the new Google Conversion tracking pixel? E.g I have received this email from google “We strongly recommend that you replace your pixel-only conversion tags with the new website conversion tracking tag in AdWords. The pixel-only conversion tags that you are currently using on your site(s) are unable to measure conversions on Safari. If you don’t take any action you will no longer be able to measure conversions on Safari.

    The new tag consists of two snippets that are only available in the new AdWords experience, which is now accessible to all advertisers. Here are the steps you should follow to create and implement the new tags:
    1. Log into the new AdWords experience (the Conversions page)
    2. Click the website conversion action for which you want to update the tag
    3. Expand the “Tag setup” panel at the bottom of the page
    4. Follow the instructions on this page to install both tag snippets:
    a. The global site tag snippet should be placed on all pages of your website so it can set new cookies on your domain, which will store information about the ad click that brought a user to your site. You only need one global site tag snippet across your entire website, even if you track multiple actions.
    b. The event tag snippet should be installed on the conversion page(s)”

    Reply
    • Yes Anthony, it can be updated. Accounts are still in transition to the new AdWords interface and following the above tutorial still works great for everyone and will continue to. I will update it probably in a few weeks. It’s a lot simpler to do. The code you’ll want to use for registering a conversion is:

      <script>
        gtag('event', 'conversion', {
            'send_to': 'XXXXX/XXXXX',
            'value': {{ subtotal_price | money_without_currency }},
            'currency': 'AUD',
            'transaction_id': '{{ order.order_number  }}'
        });
      </script>
      Reply
      • Hi ! Where do we post the global site tag?

        Reply
        • It will need to go in the “Additional Google Analytics Javascript” section. However, you cannot copy and paste the code. I have started to work on a solution for the new tag, but this is not confirmed to work:

          (function(d){
          var s = d.createElement("script");
          s.src = "https://www.googletagmanager.com/gtag/js?id=AW-XXXXX";
          s.async = 1;
          d.body.appendChild(s);
          })(document, window);

          You should use the old tag as that is the most supported solution.

          Reply
          • Looks the old code like this:
            ga(‘set’, ‘userId’, “cid”);

            Thanks for the article, very clear and helpful.

  • Hi Joshua
    Thanks very much for your instructions which I have followed for our website at http://www.losari.com.au.
    Some of our clients use discount codes and I have just noticed that the sale amount are being reported in Analytics with the full purchase price, rather than the discounted price. Are you able to please tell me how to amend the Adwords conversion code to take the discount into effect?
    Many thanks
    Jonathan

    Reply
  • Hi Joshua,
    How come my conversion code is so different? Below is the Event snippet. How do we replace with the new generated revenue tracking?

    function gtag_report_conversion(url) {
    var callback = function () {
    if (typeof(url) != ‘undefined’) {
    window.location = url;
    }
    };
    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-937539801/hL49COrXsHkQ2fGGvwM’,
    ‘value’: 1.0,
    ‘currency’: ‘USD’,
    ‘transaction_id’: ”,
    ‘event_callback’: callback
    });
    return false;
    }

    Reply
    • Hi Kelvin,

      If you’re using the new AdWords interface, which most AdWords accounts are now, you will get the new gtag code. I do not advise using it because Shopify is not yet setup for that tracking code. Swap back to the old interface and you will be able to get the “old” code I suggest.

      Reply
      • Hey Joshua,

        But if he swaps back to the old code, doesn’t that mean he will miss conversions from Safari? (if he’s in any of the western countries, Safari would not be an insignificant volume of traffic).

        Reply
  • Joshua Thank You for this Info.
    I need to start simply by tracking all leads to my site; what should I change the tag to in my case ?

    Reply
  • Hey dude did you figure out what to do with the new code yet?

    So far we’ve got this, which we put in Checkout -> Additional Scripts :

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘XXXXX/XXXXX’,
    ‘value’: {{ subtotal_price | money_without_currency }},
    ‘currency’: ‘AUD’,
    ‘transaction_id’: ‘{{ order.order_number }}’
    });

    BUT where tf are we supposed to put the Global Site Tag? Will it still work if it’s just in the HEAD section?

    Reply
  • I set up Google Ad words tracking exactly like this but I’m still not getting an accurate reporting. When I look at my Google Anaylitcs report for Adwords it’s different than the number of conversions I have in Google Adwords dashboard. Is it cause conversions are set to 30 days from the first click? or something else that could cause Google Adwords to report more conversions than I’m getting daily?

    Reply
  • Will tracking conversions this way work when embedding the shopify store with in a wordpress website?

    Reply
  • Can I paste the google conversion tracking straight below my Facebook pixel code in “additional scripts”.

    Or is it just possible to have either the fb pixel oder google conversion tracker pasted there?

    Reply
    • It sounds like you’re not using Shopify’s native Facebook pixel integration as that has its own field. If your FB pixel is in the additional, yes, the Google Conversion Pixel code can also be in there. Other codes can be inserted there.

      Reply
  • Hi – Is it still a problem to use the tracking code from the new Adwords interface?
    Thanks.

    Reply
  • You can Jared. You just need to put the universal gtag snippet also on the thank you page. Page views may double fire though given the standard ga pageview snippet will still be sent through.

    Reply
  • I have finally updated the guide to use gtag. I recommend the solution given it works more accurately with Safari.

    Reply
    • Awesome thanks!

      Reply
    • Hi Joshua, I added the code as per your tutorial however my conversions aren’t being tracked anymore. Do I need to the event snippet for sales conversion page on the thank you page that you mentioned? I can’t see that page in my files. Thanks in advance.

      Reply
      • I’ve had Shopify look at the code and I’m waiting for a reply.
        Also, I realised that the shopify thank you page is the page where the code is added under settings.
        Everything is setup correctly as per your tutorial but no conversions are coming through now so I’ve reverted back to the old code.

        Reply
        • If you’d like to me to resolve any tracking or analytics issues Jared, I suggest reaching out to me on the contact form. It is something you want right, otherwise you will just mindlessly blow through ad spend.

          Reply
          • Thanks for the offer. It’s working now.
            Turns out I was missing a single quote in one of the values 🙁

  • Hello Joshua, great guide ! thanks !

    I have a question. I have configured the Global Configure Tag as part of the Google Analytics Tracking code in the Online Store Preferences as I want to measure conversions in other pages (signups and similars). So I guess that my Global Configure Tag is for all pages and not only for the checkout page.

    Should I use the “{ ‘send_page_view’: false })” under this configuration or it applies only when the Global Tag is set only for the checkout page?

    Thank you very much

    Reply
    • Hi Carlos,

      gtag does not work with Shopify’s default analytics setup so I do not suggest using it there. If you want to use it “site wide” (which will exclude the checkout and is unavoidable), put the same global tag mentioned in the guide that excludes sending pageview data, in the theme.liquid file.

      Reply
  • Thanks Joshua,

    Let me see if I understand. In OnlineStore>Preferences>Google Analytics I pasted the Google Analytics Tracking Code and I added my AW conversion ID, in my case: gtag(‘config’, ‘AW-963238833’);

    But this does not work, correct?

    I am not familiar with Theme.Liquid, I am too rocky.

    Is it safe to just copy and paste the Global Tag directly into the Theme.Liquid?

    For the checkout page I guess I have to follow your indictions and paste the global tag and the event snippet in “Settings” > “Checkout” > “Additional scripts”. Correct?

    Thank you very much for your attention

    Reply
    • To setup Google Analtyics how I recommend, follow my analytics guide.

      If you also want to use gtag.js, paste the global site tag snippet I provided above inside the theme.liquid. It is safe to edit. Put it right after the opening <head> tag.

      Reply
      • Thanks Joshua, you are very kind.

        I have only one problem now.

        When I use the original snippet everything runs ok. Google´s Tag Assistant identifies both the Global Site Tag and the Adwords Conversion Tracking.

        But when I change

        ‘value’: 1.0,

        with

        ‘value’: {{ subtotal_price | money_without_currency }},

        Google’s Tag Assistant does not identify the Adwords Conversion Tracking. It only sees the Global Site Tag.

        What can it be?

        Reply
        • Interesting observation Carlos. Don’t worry about Google’s Tag Assistant in that case. You can confirm the value yourself by:

          You can immediately test the tracking is working by viewing the thank you page for an order then search the source code for the snippet to confirm the values inserted for the order ID and conversion value are what you want. If you’re using {% if first_time_accessed %} around your AdWords tracking, temporarily remove that so you can view the order status of an existing order.

          Reply
  • Avatar for Carl Kaltoft
    Carl Kaltoft
    May 5, 2018 8:29 pm

    Thanks Joshua, really helpful blog post.

    I happend to be using Danish Kroner as currency. I don’t really understand how to change the | remove: ‘.’ | replace: ‘,’, ‘.’ and where to insert the code

    Reply
    • Hi Carl. I’m unsure how your exact currency is displayed. If the remove and replace filter example is right for you (which you can test by viewing it on the order status page – see the guide on how), then use: {{ subtotal_price | money_without_currency | remove: '.' | replace: ',', '.' }}

      Reply
      • Avatar for Carl Kaltoft
        Carl Kaltoft
        May 9, 2018 5:28 pm

        Thank you Joshua. Really kind of you to reply so fast. And thanks for all this valuable content. Keep it up!

        Reply
  • Avatar for Joshua Stack
    Joshua Stack
    June 9, 2018 6:34 am

    How do I do this with Google Tag Manager instead of installing the snippet into the theme.liquid? If I’m guessing correctly, I still have to use the snippet on the Setting > Checkout page in Admin and in the Additional Scripts box unless there is a way to make that Conversion Linker Tag work.

    GTM fields are:
    Conversion ID (Adwords gives me a value to input)
    Conversion label (Adwords gives me a value to input)
    Conversion Value (Is there where I input {{ subtotal_price | money_without_currency }}?)
    Order ID (Is there where I input {{ order.order_number }}?)
    Currency Code (guessing USD)

    Then of course there are Conversion Linking and Tag Firing sections with fields as well. Or should I not even be using Google Tag Manager with Adwords for Shopify?

    Reply
    • AdWords tracking in GTM is completely different to what this tutorial teaches. I suggest you read GTM tutorials if you’re asking about tag firing sections. They will help you more. I prefer to use the method in this article for all clients as it’s quick.

      Reply
  • Thanks Josh!
    Just checked on the order status page and I see the code which is great, but it is situated in the tags, I thought it had to be in the tags? does this matter?

    Reply
    • Not sure what you mean by “in the tags”, Alex.

      Reply
      • Sorry missed a word out there, found code in “body” tags not in “head” tags – I’ve checked and it has started tracking (thanks for the guidance by the way) but does the above matter?

        Reply
        • The only issue with having it in the <body> like it is, is if people leave the page before the code gets a chance to load. This is so unlikely for someone who has just made a purchase. By the time the words on the page load, the tracking will have loaded.

          Reply
  • Great post – just what I was looking for! Your Shopify guides have been really helpful over the past couple of years! For this one, the conversion script is straight forward, but I’m still a little unclear as to where the gtag/Global Site tag should be located. We currently have the following installed in the two areas of Shopify:

    *****Shopify > Online Store > Preferences > Google Analytics*****

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘UA-###’);
    gtag(‘config’, ‘AW-###’);

    *****Shopify > Settings > Checkout > Additional Scripts*****

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘AW-###’, { ‘send_page_view’: false });

    Is this the suggested setup? I’m just unsure if we should have a version of the Global site tag in both the Shopify online store preferences and ALSO in the Shopify settings checkout scripts area. Any additional pointers would be greatly appreciated!

    Reply
    • Hi LC,

      This is a guide for Google Ads conversion tracking, but I answered your question in the tutorial. If you want to install gtag, you can use the suggested global gtag that has the send_page_view option set to false. I suggest putting it in the theme.liquid file. I don’t know if putting it in the additional scripts section is functional, though that is pointless given Shopify is not gtag compatible and you’d get everything you need.

      Reply
  • Good post, thanks for sharing. Can I clarify why gtag('config', 'AW-880123456', { 'send_page_view': false }); is needed? I thought this was to stop sending page view data to GA, however it appears you have appended this to the Google Ads account. Thanks.

    Reply
  • Why do you recommend bother searching for and inputting AOV when the code is going to be changed anyway? Also, I think you should make it clear when adjusting the gtag not to get the adwords code mixed up with your sample code.

    Reply
  • Thanks Joshua for the article, I need some help with this can you spare a couple minutes for me?

    Reply
  • This is pretty cool. I especially like the localisation side of switching decimals to comma’s and the run once, which I’d never come across with Shopify, but makes sense from having localisations and internationalisation experience in other e-commerce and wider software. Thanks for writing up, especially the tips.

    Reply
  • Hi Joshua – your tutorial is by far the best I have found. However I am still having issues when debugging (and verifying) the installed solution to Google Ads. My conversion actions page still indicates unverified. I have seen and verified the solution like you explained and it seems to be correct in the page but however when debugging through Chrome webdeveloper your script doesn’t trigger googleadservices.com like said in the Google Ad debugging instructions. Also when using the Google Tag Assistant I only see the global site tag but not the triggering conversion. Any ideas?

    Reply
  • Hi Joshua, nice article. I have a little confusion on your “Alternative: Google Ads With Google Analytics Global Site Tag” section.

    In that section you state

    If you use Shopify’s Google Analytics setup and install the global site tag in your theme, you will send duplicate page view data. You need to use the send_page_view parameter like { ‘send_page_view’: false } to disable duplicate page views sent to analytics.js.

    This solution combines the Google Ads conversion tracking with the Google Analytics global site tag. It stops duplicate page view data when the store uses Shopify’s settings for Google Analytics. You would use this solution if you wanted to send other data in gtag.js like dynamic remarketing or an event via gtag.js.

    I would like to add the Global Site tag everywhere on my site in order to enable remarketing and I understand why it makes sense to set send_page_view to false. However, could I instead just not include the line “gtag(‘config’, ‘UA-76118106-1’);” in the Global Site tag (both in the theme and on the checkout page) at all?

    We are using Shopify’s standard Google Analytics setup so I don’t know why I’d also want to include “gtag(‘config’, ‘UA-76118106-1’);” in the Global Site tag. It seems like it would be repetitive to include and lead to double counting page views unless there is some other interdependency that requires keeping that line of code?

    I’m just not sure why I’d want to include “gtag(‘config’, ‘UA-76118106-1’);” in the Global Site tag in the theme and/or the additional checkout scripts if I also use Shopify’s standard Google analytics tag? Is it required in the Global Site tag to use remarketing? Maybe some other functionality / reason requires it in the Global Site tag even though we also use Shopify’s standard Google Analytics implementation?

    Thanks,
    Will

    Reply
    • Hi Will,

      My understanding is the gtag config command is required setup if you want to do anything with Google Analytics gtag (such as dynamic remarketing.) The setup you quoted that I described will work well and not double count page views. I don’t know why you’re looking to exclude the config.

      Reply
      • Ahh, that makes sense. Thank you.

        It sounds like if we do standard Adwords remarketing we could implement the Global Site tag without the line gtag(‘config’, ‘UA-76118106-1’, { ‘send_page_view’: false }); because standard Adwords remarketing only needs the Global Site Tag and a conversion event tied to our Adwords gtag. Basically, standard adwords remarketing doesn’t require a Google Anlytics gtag so we wouldn’t need to include it at all?

        But to do Dynamic Remarketing we would want to include gtag(‘config’, ‘UA-76118106-1’, { ‘send_page_view’: false }); since Dynamic Remarketing requires the use of Google Analytics gtags? Further, not only do we need to include the Google Analytics gtag, we also need to use ‘send_page_view’: false to avoid double counting page views. The same would be true of anything else that required the use of Google Analytics gtags.

        Reply
  • Thank you very much! I did that for our Goggle Ads conversion tracking and it works NOW! I don’t know why Shopify doesn’t update the instructions. Thank you again!

    Reply
  • Hi Joshua

    I have implemented the conversion tracking as described above. However the source code of the order status page (which I assume is the “thank you page” mentioned above) returns an error called “unexpected token” for the value line:

    ‘value’: {{ checkout.total_price | money_without_currency }},

    The total price is not shown, instead I see the error. At the same time, the Id is represented correctly in the source code.

    Any idea what could be wrong here?

    Thanks

    Reply
    • Your currency settings could be different to the standard store so the money filter is outputting something unintended. Review your settings. Remove the money filter. Test other money filters.

      Reply
      • Thanks for the reply Joshua.

        I finally found the problem: The order I was testing with has not been placed online via the checkout process, but was generated as draft. This results in {{ checkout.total_price | money_without_currency }} having no value.

        So there is not really problem, as we are measuring online conversions here, which is not the case for manually generated orders. It is just a bit confusing if you end up doing your tests with such draft-based orders…

        Thanks

        Reply
  • Hello Joshua, Thanks a lot for making this page. It really goes into details regarding the setup of the tracking.

    Reply
  • Thanks for this wonderful content, pls I want some clarifications, At the moment, I am tracking call conversions and form submissions on my website and I have installed the global site tag on every page of the website.

    Now, I want to configure the purchase conversion in my store which is a shopify.

    This is my question, should I install another global site tags or should I only cope the event snippet and edit it as you outlined in your guilded steps here. Thank you

    Reply
    • You will need to follow the guide as whatever is inserted into your Shopify theme will not carry across to checkout. The global site tag script needs to be installed in the checkout as described.

      Reply
  • Hi Joshua,
    thank you very much for your step-by-step guide. I did everything you teached, but when i go in my shopify backend to paste in the code there is no field for addtional script. I go to “settings” –> “checkout” but there is no text-box for additional scripts.

    1. Do you have any idea why i don’t have the textbox for additional scripts?
    2. Where else can i past my block of code?

    {% if first_time_accessed %}

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘UA-xxx’, { ‘send_page_view’: false });
    gtag(‘config’, ‘AW-xxx’);

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-xxx’,
    ‘value’: {{ checkout.total_price | money_without_currency }},
    ‘currency’: ‘{{ shop.currency }}’,
    ‘transaction_id’: ‘{{ order.order_number }}’
    });

    {% endif %}

    I would be really thankfull for your help!
    Best regards,
    Bakbert

    Reply
    • I’ve never heard of a store that doesn’t have it as the admin is near-universal.

      More directions from Shopify: “From your Shopify admin, go to Settings > Checkout. In the Order processing section, find the Additional scripts text box.”

      Reply
  • Hi Joshua,
    I installed the Google Ads tags as you’ve shown above, however when checking the setup with Google Tag Assistant it shows 2 tags installed when a purchase is completed.

    I’m really hoping you can please clarify 1 thing for me:

    Should I remove the Google Analytics account number from the box above the Additional Google Analytics JavaScript box? Or do I leave my Google Analytics account number in this box as well as adding the Global site tag into the Additional Google Analytics JavaScript box? I think this may be why I’m getting 2 tags firing on checkout when I test the code, but I may be wrong. I’m a newbie at this!

    Thank you so much!

    Reply
  • Had a call with the Google Implementation Team which helped us implement the gtag for one of our accounts on the Shopify platform.

    Some background info:
    We have two separate AdWords accounts. One houses the text ads and remarketing, the other houses the PLAs.

    The issue has been how do we add the new gtag tracking for both accounts?

    It seemed that what the Google Implementation Team did work, however, now some conversions are tracking the correct conversion value, but the majority are not and are showing the value as 0.

    Below is the source code on an order confirmation page which was implemented into the “Additional Scripts” box. Wondering what you think about this implementation and if you have any suggestions? We have had issues switching over to the gtag, (or Tag Manager) with a lot of our accounts. Any help would be much appreciated.

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘AW-931570196’);

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-931570196/jOMzCLuOgHEQlMSavAM’,
    ‘value’: 579.99,
    ‘currency’: ‘USD’,
    ‘transaction_id’: ‘18262’
    });

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘AW-808547907’);

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-808547907/qO5oCMi-lIABEMPsxYED’,
    ‘value’: 579.99,
    ‘currency’: ‘USD’,
    ‘transaction_id’: ‘18262’
    });

    Reply
  • Avatar for Alex Czartoryski
    Alex Czartoryski
    January 31, 2019 4:13 am

    Hi Josh,

    Thanks for another great writeup.

    To simplify implementation of this (allowing easier cut/paste) I assign the Google Conversion Id and Google Tag Id in a liquid variable at the top of the page and inject them later down in the script.
    Code here: https://github.com/Czarto/ShopifyScripts/blob/master/settings/checkout/adwords-conversion.liquid

    Best,
    Alex

    Reply
  • Avatar for Siva Gounder
    Siva Gounder
    March 28, 2019 5:23 pm

    Really awesome article. Concise, to the point and helpful! I think Shopify should be paying you guys royalties for this info. Their help docs certainly aren’t as good. cheers
    Siva

    Reply
  • Thanks for this very good article!

    We’ve seed recently by installing the new Shopify Google Shopping App that some of this setup is being made automatically. But, I’m not quite sure how it is doing compared to your article (eg. doing it programmatically). So, I’m wondering now which one I should do : letting the Google Shopping App do everything automatically or uninstalling it and implementing the javascript proposed into this article?

    I would say I like the Google Shopping App synchronizing all of our products with our Google Merchant account. I would not want to loose that.

    Anyone experienced the new Shopify Google Shopping App and how’s the success who had with it? Does all the conversion goals are well received by Google Ads?

    Many thanks.
    Pierre
    https://www.boutique-lollipop.com

    Reply
  • Hi Joshua,

    Thank you so much for your brilliant articles. Absolutely amazing!

    I’ve followed all the steps and successfully implemented the Ad Conversions and Re-marketing.

    I have just a small question. If I’ve added the re-marketing snippet in the “Settings” > “Checkout”. Under the field “Additional scripts, Do I need to include the ‘Google Ads conversion tracking’ snippet AS WELL AS the Remarketing Code For The Checkout snippets? i.e.

    [CODE]
    {% if first_time_accessed %}

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘UA-76118106-1’, { ‘send_page_view’: false });
    gtag(‘config’, ‘AW-880123456’);

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-880123456/44BbCP7Vz3AQvIfdafM’,
    ‘value’: {{ checkout.total_price | money_without_currency }},
    ‘currency’: ‘{{ shop.currency }}’,
    ‘transaction_id’: ‘{{ order.order_number }}’
    });

    {% endif %}

    +++++++++++++++++++++++++++++++++

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘UA-PROPERTY_ID’, {‘send_page_view’: false, ‘custom_map’: {‘dimension1’: ‘ecomm_prodid’, ‘dimension2’: ‘ecomm_pagetype’, ‘dimension3’: ‘ecomm_totalvalue’}});
    gtag(‘config’, ‘AW-GOOGLE_CONVERSION_ID’);

    gtag(‘event’, ‘page_view’, {
    ‘ecomm_pagetype’: ‘purchase’,
    ‘ecomm_prodid’: [{% for item in checkout.line_items %}’shopify_US_{{ item.product_id }}_{{ item.variant_id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
    ‘ecomm_totalvalue’: {{ checkout.total_price | money_without_currency | replace: ‘,’, ‘.’ }},
    ‘non_interaction’: true
    });

    Thank you so much!
    Don

    Reply
    • I don’t know why you’d want to just implement remarketing without conversion tracking—perhaps if you were importing transactions through Google Analytics rather than using the Google Ads conversion snippet. You only need one instance of gtag so you can remove the first paragraph of code. The gtag should also load before events so you’d want to move the second lot of gtag you have to the top above the if statement.

      Reply
  • Hi Josh, thanks so much for your reply.

    Apologies, my initial question was unclear.

    I would like to implement the re marketing tracking using Google Analytics with Conversion Tracking using Adwords.

    Will the following code work?

    
    
    
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-xxxxxxx12-3', {'send_page_view': false, 'custom_map': {'dimension1': 'ecomm_prodid', 'dimension2': 'ecomm_pagetype', 'dimension3': 'ecomm_totalvalue'}});
      gtag('config', 'AW-xxxxxx77);
    
    
    
      gtag('event', 'page_view', {
        'ecomm_pagetype': 'purchase',
        'ecomm_prodid': [{% for item in checkout.line_items %}'shopify_GB_{{ item.product_id }}_{{ item.variant_id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
        'ecomm_totalvalue': {{ checkout.total_price | money_without_currency | replace: ',', '.' }},
        'non_interaction': true
      });
    
    
    {% if first_time_accessed %}
    
    
      gtag('event', 'conversion', {
          'send_to': 'AW-880123456/44BbCP7Vz3AQvIfdafM',
          'value': {{ checkout.total_price | money_without_currency }},
          'currency': '{{ shop.currency }}',
          'transaction_id': '{{ order.order_number  }}'
      });
    
    {% endif %}

    The remarketing code for Google Analytics uses GA property ID in the while the conversion is using the Google Adword ID (i.e. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx12-1&quot; vs

    Also the GA version is adding {‘send_page_view’: false, ‘custom_map’: {‘dimension1’: ‘ecomm_prodid’, ‘dimension2’: ‘ecomm_pagetype’, ‘dimension3’: ‘ecomm_totalvalue’}}); which is not in the Adwords Conversation tracking.

    Can I mix the 2 examples in such a way??

    I really appreciate your help with this!
    Don

    Reply
  • Hi Joshua
    I have added both the global tag and purchase conversion tag to the additional scripts box in shopify settings. I have just done a test purchase and checked the code on the thank you page. I can see the global site tag code but i cannot see anything referencing the conversion tag. Any ideas why?

    Thanks
    Paul

    Reply
    • Hi Paul. Remove {% if first_time_accessed %} from the conversion code, then view the thank you page. See if that shows. Chances are you reviewed the code the second time you viewed the thank you page.

      Reply
      • Hi Joshua, thanks for your reply, yes code is there now and it’s showing as verified on google ads. I did a test purchase yesterday yet the number of conversions purchases is still showing as 0 in google ads. Any ideas why that would be?

        Reply
        • Performance data isn’t available instantly. Google have a general, clear guideline now saying to allow for 3 hours. Review the conversions in Tools > Conversions to see if it is recording a conversion there. If it is, but not inside Google Ads columns, you’ll need to check “Include in ‘Conversions'” as advised in the guide.

          Reply
          • Hi Joshua
            It’s been two days now and none of the purchases i’ve done have been recorded as a conversion.
            Everything seems set up fine other than that!

            One other question. Will the conversion show on google ads if i’m just going direct to my website and making a purchase? I don’t have any ads set up yet.

          • The whole point of Google Ads conversion tracking is to track sales in Google Ads from Google Ads—not other traffic sources. So yes, you need to be clicking on one of your ads for the data to show.

  • Hi Joshua,
    I have added the code for Google Ads Conversion Tracking in Shopify according to your instructions and my Adwords sales are beeing tracked. But it seems the code is not working for dynamic remarketing as there is still an issue showing in Adwords under Audience sources saying I need to fix the tag for dynamic remarketing.

    How can I get your code to work for dynamic remarketing as well?

    Reply
  • Hi Josh,

    Thanks for this great article. I have a question, though, which may be out of topic. I have been researching on this for days but I still don’t know how to change the currency from USD to PHP in my Google Analytics.

    I’m able to change the currency symbol but the actual numbers stay the same, they’re not converted from USD to PHP. Any thoughts on this? TIA.

    Reply
    • Hi Haze,

      See step 10 in my Google Analytics tutorial to learn how to change the currency. Also:

      Changes to the global currency type of a view (profile) will affect future ecommerce data and will not be applied to data retroactively. Previous ecommerce data will not be converted to the new currency.Google Analytics

      Reply
  • Hi Joshua, thank you for this great tutorial article. I’m so grateful find your site.
    I added gtag code into my shopify theme.liquid and purchase conversion code into my shopify checkout script as the following:
    in shopify theme.liquid:

    
    
    
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'AW-708180525');
    
    
    ====
    in shopify Checkout script:
    
    
    
      gtag('event', 'conversion', {
          'send_to': 'AW-708180525/t-KQCPSxtasBEK3019EC',
          'value': {{ checkout.subtotal_price | money_without_currency }}     
          'currency': '{{ shop.currency }}',
          'transaction_id': '{{ order_number  }}'
      });
    
    

    However, today I still see that the ‘Google Shopping App Purchase’ conversion tag still shown as unverified in my google ads account.
    Note that I enable Google Analytic thru shopify preference setting and do not include the gtag.js into the checkout script as I follow the shopify instruction. Could this be the problem? I also tried the suggested test, ie. viewing the order status of an existing order.
    Thank you so much in advance for your time and help.

    Reply
  • Hi Joshua,

    If the currency on the website is different than “euro”, how can we make sure that it’s passed already converted (to euros) to the Google Interface?

    Reply
    • I don’t know what currency your website is or what you’re setting it to with the tracking code. Regardless, whatever you set it to, if it’s different to the Google Ads currency, Google will convert it based on current exchange rates:

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

      Reply
  • Hi Joshua,
    First of all thanks so much for all the work you have put in.

    My issue is, I did everything exactly as you have stated and all of the conversions track properly EXCEPT when a user purchases on a 2nd session. “converted after direct visit” type of deal.

    Shopify does however track the 1st session with the proper UTM and I have tried “first click, last click, linear attribution” with no result.

    Do you have any idea why conversions that show more than one session are not tracking properly?

    Thanks for your help!

    Reply
    • Hey Steffan,

      What you’re saying is counter to what Google Ads is suppose to do with attribution. Google Ads is going to credit revenue to an ad campaign, ad group, ad, or keyword based on the last click even if the sale happens on another channel. Google Analytics solves what you’re asking with Google Ads influence in a multi-channel strategy. Even in that case with Google Analytics, it would attribute the sale to the channel that came before direct.

      By default, Google Ads attributes conversions to the last Google Ads click. (You can also change to other attribution models.) On the other hand, for all reports except the Multi-Channel Funnels reports, Analytics uses a last click attribution model across all channels (excluding direct). For example, let’s say a user clicks on a creative from your Google Ads account, then returns the next day via a Google organic search result and reaches your Goal page or triggers a Transaction. Analytics will attribute the Goal or Transaction to google/organic. By default, Google Ads will attribute the conversion to the Google Ads campaign.Google support: Comparing Analytics and Google Ads conversion metrics

      Reply
  • Hi Joshua, your directions on how to ad AdWords conversion tracking using the Google Analytics global site tag have been really helpful. I use Shopify’s Google Analytics setup, but if the integration uses Google universal analytics vs the global site tag, does that mean I actually don’t have a global site tag implemented on my site? In addition to your directions, should I be adding the AdWords global site tag to my theme.liquid file? And if so, do I need to add all of the tag or just the config command? Thanks.

    Reply
    • Hey Maria. I don’t know what’s on your site as everything can vary, but Shopify’s Google Analytics setup does not use the global site tag. This article is about conversion tracking for Google Ads, which doesn’t require the global site tag in the theme.liquid file.

      Reply
  • I really want to know if I have already added google analytics and google ad tracking code. so I added both codes but currently only works for google anlytics and not work for google ad tracking conversation code. so my question is what shoud I do only add to google analytics code or google ad tracking code?

    Reply
  • Hello Joshua! Thank you for this instruction. Have you tried to setup conversion tracking with reporting conversions with cart data? Does this implementation have any benefits for ads optimization process? Thanks!

    Reply
    • Hi Eugeniu. Yes, we have set it up the new Conversions with Cart Data. However, it was extremely inconsistent in reporting, missing conversion values but also the extra data you’re suppose to get with it in the Google Ads interface. It has many new benefits for reporting and will become the new standard when Google fix the beta bugs. I will update this guide when it’s proven to work.

      Reply
  • Hi Joshua,

    Thank you for writing this detailed article. Would you say using the Google analytics import method is easiest and best since all you would have to do is import the data from analytics into google ads? It wasn’t clear to me but can you skip all the previous steps you mentioned in this article if you use this method?

    Reply
  • Your guide is very helpful. Thank you very much.

    I currently have Google Analytics setup on my store through “Online store – Preferences” in Shopify. I am not sure whether I should follow the instructions in section “Alternative: Google Ads With Google Analytics Global Site Tag.” Could you advise?

    Thank you in advance!

    Reply
    • The tutorial answers that Jason. If you use analytics import, the only conditions I recommend that are if you follow my whole recommended analytics setup for Shopify stores.

      Reply
  • Hey Joshua, great tutorial mate, thank you so much.

    Currently our store just launched multi-currency and so some of our countries use commas in the order price (like countries with EUR, they say 1,95 instead of 1.95).

    But some countries, the commas is actually a comma for example 1,000 USD. So I can’t just directly use:
    {{ checkout.total_price | money_without_currency | replace: ‘,’, ‘.’ }} or | remove: ‘.’ | replace: ‘,’, ‘.’

    Is there any way around that? Maybe some sort of IF statement?

    Reply
  • this article says that analytics import only works if google ads is last non-direct click. Is this true?
    https://www.searchenginejournal.com/why-using-conversions-imported-from-analytics-to-google-ads-does-not-actually-make-sense/346036/

    Reply
  • Hi Joshua,
    I installed the pixel according to your instructions in admin>settings>checkout:

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘AW-000’);

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-000/xxx’,
    ‘value’: {{ checkout.total_price | money_without_currency }},
    ‘currency’: ‘{{ shop.currency }}’,
    ‘transaction_id’: ‘{{ order.order_number }}’
    });

    When I inspect the checkout summary with google tag assistant, I don’t see the conversion tag. Global site tag (green), google ads remarketing and analytics are there (both blue).

    Any idea whats going wrong here?

    Thanks
    Zin

    Reply
  • Avatar for Nick Mascetta
    Nick Mascetta
    May 8, 2020 9:46 pm

    Do you or your agency set this up for people? If so, how much do you charge ?

    Reply
  • Avatar for Thomas Eastwards
    Thomas Eastwards
    May 17, 2020 1:52 am

    Your guide is great, thanks! However, in the recommendations of my ad campaign, Google Adwords keeps saying I should finish setting up conversion tracking.

    It describes two steps:

    1Your conversion action has been created
    2 Set up your conversion tracking tag

    The first one is detected and done, but Adwords keeps saying I still have to do the second step.

    I checked if the conversion tag is live with the Google Chrome Tag Assistant, and it’s there. Also, Analytics tracks the conversion. But it doesn’t seem to work with Google Adwords…

    Adwords and Analytics are linked.

    What could be wrong here?

    Reply
  • What about the new updated Google Sale Channel?? If am just starting my account. Do i still need to do all theses setup? Or they are being sync automatically? They the seem to be included now as i see that i have “Conversion” that were setup automatically thought the app.. What do you think?

    Reply
    • If you’re referring to Google Surfaces, but you’re not running Google Ads, there’s no point in setting up Google Ads tracking. But Google Ads can run across extra Surfaces placements, in which case tracking should be setup.

      Reply
      • Thanks for your response. No im not talking about surfaces placement. Sorry i might not have been clear with my question, here more details. Within Shopify you can add various sale channels ” fb,amz,ig,pos,google, etc” Google just release not to long ago an updated version witch allow you to connect your GG ads, analytic & GMC.. I did the tag assistant and all tag seem to have been setup and look like are firering just fine. You can create only 1 Smart shopping campaign for all your product. When i created the campaign within the app/sale channels. It automatically created conversions in my gg ads witch they seem to be well setup tracking purchase, atc, view, etc. Now im going to create more campaigns in gg ads Do you think i still need to create more conversions and setup the code for all the new ones? Or no

        Reply
  • Thanks. I import from Google analytics and waiting for its result.

    Your tutorial is different from Shopify:https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/tracking-adwords-conversions.

    It told me to Install the event snippet to “Settings > Checkout.” But you sa “Adding The Google Ads Conversion Code To Shopify to Checkout”—–adding global site tag to checkout

    Reply
  • Damn good article. I think if you look at the Google analytics user stats, my time on page is probably close to 45mins.

    Reply
  • Hello,

    Great article! I got issues getting tracking working (tag inactive error message). I realized your guide and Shopify’s one are different, where Shopify recommend to install the gtag on theme.liquid whereas you mention only as an additional script. Google also mentiones that gtag needs to be on all pages of your site so looks like adding it in theme.liquid is the best way? In anyway on either method I will get the same error. When I go to webpages it appears empty. Any ideas what I could be doing wrong? Thanks

    Reply
    • The tag being reported as inactive within the Google Ads conversion section can just mean you haven’t had a sale from someone clicking the ad. The best way to verify the code is with the last step shared in the main method.

      Reply
  • Hello Joshua,

    I followed your other guide https://www.digitaldarts.com.au/google-analytics-shopify for Google Analytics. I have also just followed this guide for the Google Ads Conversion tracking.

    However, If I am interested in running remarketing ads in the future, do I need to also create a separate remarketing tag to add into the additional scripts section in the Checkout section of Shopify? Where would I place this tag if I do?

    Reply
  • Hello and thanks for the article!
    When I use Google Tag Assistant, I see that both the Universal analytics and the Global site tags (google ads and google analytics) are green and active. No warnings or optimization suggestions.
    Is it fine in your opinion?

    Thank you very much.

    Reply
  • Hello,

    thank you for this great guide. I included the version like described in the section (“Alternative: Google Ads With Google Analytics Global Site Tag”) because we need remarketing data.

    I am now just wondering as GTAG does not show up in the Google tag assistant chrome plugin on every page? But isn’t this needed so that the tag could gather all the data?

    Reply
  • my google conversion is working now thanks to this article but now its says this

    Fix your audience source that’s not sending a required parameter
    Your campaigns can’t tailor dynamic ads based on user activity when your audience source doesn’t send the required parameter. Make sure the required parameter is being sent correctly.

    Your audience source may not have the required parameter for your business type on all relevant pages or events. Check that you’re passing the required parameter for your business type anytime users interact with products or services you want to advertise. Note that Google Analytics refers to parameters for remarketing as Dynamic Attributes. Learn more

    and asks me to update my code and says use the new code instead of the previous. how do I do it where do it out it

    Reply
  • Hello and thank you.

    Do I also need to do the following step in the Google Shopping for Shopify guideline, when I have integrated the code like on this page in section “Google Ads With Google Analytics Global Site Tag”

    “With that done, your theme is setup for dynamic remarketing. However, an alternate version of the code needs to be inserted on the order confirmation page because it is not connected to your theme.

    Go to “Settings” in Shopify then “Checkout”. In the “Additional scripts” section, copy-and-paste the following:”

    Reply
    • Can you show me which code that is?

      Reply
      • Hi Bilal,

        We are encountering the same issue. After following the guide, everything works, but google ads is complaining

        “Your campaigns can’t tailor dynamic ads based on user activity when your audience source doesn’t send the required parameter. Make sure the required parameter is being sent correctly.”

        Did you manage to fix it?

        Reply
  • Hi Joshua or Anyone who knows what they are doing!

    Shopify non Plus member here. Hoping you can clarify something between three of the separate Google/Shopify related guides since they are segregated (rightfully so) into their own dedicated pages, but each have some potential overlap which is causing some real confusion for me =( I will try my best to ask this questions in chronological order of which guides I followed, first to last. I really hope you can help me. If you need compensation for such a response, name a price for an hour of your time and I will be happy to oblige. If there is anyone else lurking around that might be able to help me if Josh doesn’t respond, this also applies.

    I started first with your Analytics guide. Having previously followed your Google Analytics guide, I opted to download your Shopify Goal Checkout Template using regex since I am a non-plus Shopify user. I also setup my own funnel per your instructions in step #9-Setup Funnels & Goals not knowing any better. So that leaves me with two goals within my filtered primary Analytics view. Should I delete one of these or turn one of them off? And I guess where the confusion comes in is when following this current guide under the “Alternative: Google Analytics Import” section, I followed your instructions and selected transaction from the primary view, clicked Import & Continue to create goal, and changed it to linear. So in my Google Ads account, I have both of these two goals showing as conversions now.

    Now I am following this Conversion Tracking guide it appears that you start it off by creating a new conversion in the beginning of this guide. Because I previously followed your Analytics guide, I opted to take your instruction to use the “Alternative: Google Ads with Google Analytics Global Site Tag”. That being said, I now have a total of three conversions in my google ads account: 2 of which are your Regex template and “Checkout Complete” method imported from Google Analytics, and now another one that I created per the beginning of this guide named sales.

    The two goals which were imported from Google Analytics are showing they are tracking my conversions, however the one labeled as “Sales” with the source of Website is remaining unverified even after having checked that it is within the page source with “if_first_time_accesed” temporarily removed, and testing a fake purchase on my shopify store via a google search campaign.

    Which of the three conversions/goals should I be using going forward? I ask because there is no conversion values showing up in google ads either.

    If anyone comes across this post that can help, reach out to a brother here trying to level up in this Google/Shopify game. I will be periodically checking the comments to see if there is any feedback, and perhaps we can connect outside of Joshua’s site out of respect to him.

    Thanks in advance.

    Reply
    • Hi Jayco,

      Don’t use a checkout goal inside your Google Analytics as a conversion inside Google Ads. It is inferior without revenue information, which this guide provides. You should still have the goal in analytics, but don’t import it into Google Ads.

      We prefer to use Google Ads conversion snippet in this guide rather than importing transactions. So once you get it working, you don’t want both imported as conversions in Google Ads.

      Reply
      • Thanks Josh! Apologies for the book I wrote previously, but I figured the more details I provided the better it is for someone to assess my error. For what it’s worth, I’ve been using your Analytics guide for 3 years now for three different ventures. It’s just as of more recently I made the decision to utilize Google Ads in conjunction with Facebook Ads and your other guides are becoming just as imperative to use.

        I have been scratching my head creating bald spots trying to damn near reverse engineer all your guides, Googles guides, reddit, Youtube, etc… to try to understand WTF I was or was not doing correctly for over a week. You have pointed me in the right direction. You are the G.O.A.T.

        If I ever find myself in your neck of the woods, steaks & beers on me. Cheers from the USA.

        Reply
  • Hey Joshua,
    Great article!

    I have one remaining question: If Google Ads is set up via the Google channel, should the tracking code listed above be removed from the checkout pages to prevent duplicate conversions?

    Reply
    • Yes. Possible alternatives is to remove the conversion inside Google Ads which stops the reporting or changing the column to not be included in the conversions column. The later lets you compare data if you wish while not messing with reporting.

      Reply
  • I pasted in the Google Analytics gtag in the theme.liquid before doing Adwords. If I use your first method do I then delete that code from the theme.liquid? So there is not duplication.

    Reply
  • Thanks to your article I’ve got everything tracking beautifully now in GA! One thing I am noticing is that Recharge recurring subscription payments and Shopify Mobile for iphone data are not capturing in GA – any suggestions on how to correct?

    Reply
  • Quick comment on the checkout additional scripts for those with multi currency sites:

    There appears to be a bug in your code that prevents saving the checkout additional scripts:
    ‘value’: {%- if order.currency == “EUR” -%}{{ checkout.total_price | money_without_currency | remove: ‘.’ | replace: ‘,’, ‘.’ }}{%- else -%}{{ checkout.total_price | money_without_currency | remove: ‘,’ }},

    is missing a {%- endif -%} at the end. It should be:
    ‘value’: {%- if order.currency == “EUR” -%}{{ checkout.total_price | money_without_currency | remove: ‘.’ | replace: ‘,’, ‘.’ }}{%- else -%}{{ checkout.total_price | money_without_currency | remove: ‘,’ }}{%- endif -%},

    Hope that helps some other people!

    Reply
  • Avatar for Darleen Witmer
    Darleen Witmer
    May 8, 2021 11:38 pm

    Shopify Google Ads channel is not always adding tracking or not enough tracking. There are two versions apparently. Shopify help has documentation but it’s not accurate – as states can determine which is being used abd how to add extra events. In the past I have setup tracking fir Shopify stores missing google ads tracking code with Shopify’s Google shopping app installed
    Following your articles.
    There are two issues I am finding – no google ads tracking code found but impressions and tracking found in Google Ads.
    Retargeting data is not being tracked and
    Error message noted in google ads for retargeting audience.
    Other situation is that impressions are not being tracked in google analytics.
    When the google Shopping Channel is being used we have Berne told to not add tge code in checkout due to possible duplicate data will be tracked.
    A concise accurate method of tracking all data correctly would be wonderful 🙂
    Also in one situation – one Shopify store using a Google Ads Expert has been told not all events are being tracked
    Where can I find accurate information to be sure correct tracking is setup for Shopify stores using the Google Channel ?
    Thanks

    Reply
  • Hi ,
    Would you help me ?
    Our website link is :https://joyasdechina.myshopify.com/
    Here is our problem with Google ads tracking and Google Analytics tracking.
    I asked the Google team for help to check our tracking code, and there are all correct.but right now there are still could not figure out why mine is not working, i.e. Google Ads conversion action status is still stuck in ‘Unverified’ state and conversions are not being tracked by Google Ads although I think I configured everything as suggested and tested it via a test order on my store.
    I following this Shopify help center document to setting Google ads tracking https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/tracking-adwords-conversions

    Thanks so much

    Reply
  • Thanks for providing the steps. I followed the steps and the google Ads conversion started working, but the dynamic remarketing stopped working.

    Can you please advise how to fix dynamic remarketing issue.

    Reply
  • Hey Joshua,

    it is an amazing article. I would further like to ask you something regarding setting up the GA tracking properly.

    Initially i connected Shopify with GA by doing the following thing: Preferences > google Analytics > then put the GA account number starting with : UA-****

    After I read your article I have put the tracking code
    in the liquid.theme header tag.

    Just wanted to clarify if I have done it right or not? is it I should have pasted the modified tag that you mentioned in the “Additional Google Analytics JavaScript” under Preferences where I put the GA account Number?

    Reply
  • Hi Joshua, following this example I was creating the conversion tracker for ”add to cart”, but where in Shopify should i place the event snippet for it?

    Reply
  • Hi Josh,

    After having followed this conversion guide, your analytics guide, and your remarketing guide – I am showing three Global site tags with my analytics (UA-XXXXXXXXX-X) in Google Tag assistant on my product pages.

    Two of them are green that show up as (gtag.js), and one is blue which I suspect is the Google Analytics code entered in the Online Store>Preferences box.

    Is this normal?

    Reply
  • Avatar for Marcus Cent
    Marcus Cent
    July 21, 2021 9:19 pm

    My Adwords conversion tracking wasn’t working. I followed the instructions here and now I am seeing more conversions than clicks. i.e. something isn’t right. Can you advise how to debug that problem and what might cause it. Thanks

    Reply
  • I can see that you’ve recently made a huge update to your conversion tracking code. It would be interesting to know why the old code had been removed. Is it because it didn’t take into account the newish enhanced conversions feature? Would it do any harm leaving the old code in? It seems to be doing a decent job to date (November 2021).

    Anyhow, very rarely do I give up on a tutorial, but this time I’m stumped! I just don’t understand step #3: Set the ID variables based on your shopping feed. I’m also not completely sure about #4 & #5. Where do I find this info? Is there a clearer way you can phrase this?

    Thank you anyway. Generally I find your work very informative and useful!

    Reply
    • Hey Dave,

      As you see on the date of the guide, it was recently upgraded. This is what we use internally for clients so it’s the first time “outsiders” have seen it. I expect a few things to be unclear. I will clarify those points you asked in the guide over the coming week. Might have to wait after Black Friday madness.

      The old code is removed because it’s inferior. It’s void of two new tracking features plus it accommodates for multi-currency.

      Reply
      • This has been updated Dave. If the steps are still unclear, let me know where you’re getting stuck.

        Reply
        • It’s much better now Joshua! Sorry my confirmation has taken a little time. I needed to see if the ‘Check enhanced conversions’ in red would go away before I replied and eureka! It seems now to be recording and processing enhanced conversions correctly. It took about 3 days for the ‘error’ or ‘tracking warning’ to be replaced with the correct status. Worth mentioning this to anyone else who’s trying to set up enhanced conversions for the first time. Don’t worry – just be patient and hopefully all will work fine. Thank you again!

          Reply
  • Hello Josh. Quick question:

    In Ads I have set up a conversion action applying the linear attribution model and using your new conversion code with enhanced conversions. In Ads, the status says: ‘Recording (processing enhanced conversions)’ – so everything looks good.

    Temporarily I have kept my original conversion action which is based on Google Analytics conversions. I know this is naughty of me (!) but I wanted to check them both side-by-side for a short while to compare datasets.

    In your introduction you said: “For one of my Google Ads clients I was able to attribute more than double the sales of Google Ads with the conversion tracking code compared to analytics”. With that in mind, would you think it was unusual – perhaps even impossible for my original conversion action from the Google Analytics source to be tracking about 30-50% MORE conversions than your new action with enhanced conversions containing your code. If anything, shouldn’t it be the other way around?

    What are your thoughts?

    Reply
    • You’re unlikely to get that many more conversions with enhanced conversions. If you want to test side-by-side, disable the analytics conversions from appearing in the conversions column. It’s likely time is a factor if you’ve just set one up and not the other as conversions come through over time.

      Reply
  • Hi Josh,

    I really appreciate you sharing this code! Everything seems to be working for us, except for one issue. When I run the diagnostics, under “Customer data validity,” it says ,”Make sure your customer data is formatted correctly.” There seems to be a syntax error when I add it to a javascript ui. Any idea how to fix?

    Reply
    • I haven’t seen any diagnostic issues with the current version of the code. If it’s saying customer data isn’t formatted correctly, are there any samples or more information? You can remove the {% if first_time_accessed %} conditional statement then view a few sample orders to see the liquid output for the customer details (how customer data is formatted).

      Reply
      • Hi Joshua,

        Thanks for the quick response. I use Shopify to add the code in our checkout page. Once I remove the {% if first_time_accessed %} from the code, how would I be able to view sample orders? would it be through “All orders > select orders > View order status page?

        Reply
  • Hey Joshua,

    First of all, loving all your detailed articles. Seriously amazing. Thank you!

    I had two questions for you:

    – First, my conversion doesn’t have an option for ‘Enhanced Conversions’ – maybe I’m not eligable for some reason, but I thought I’d flag it in case this is a new change. Will this impact the code I entered?

    – Second, now that I’ve added yuor beautiful code to my order page via the additional scripts, does that mean I should get rid of the auto-generated Google sales converion from the Shopify-made App? What about the rest of them?

    To try and help, I’ve added a screenshot that includes examples: https://screenshot.click/13-21-lz7z4-cr3o8.png

    Thank you again!!

    Reply
    • Hi Jordan,

      Being a beta feature, not all accounts have access to Enhanced Conversions. If you do not, you can remove the lines between <!– START enhanced conversions –> and <!– END enhanced conversions –>. This maybe unnecessary, but it is untested keeping it there without the feature present.

      There’s no harm in keep the non-purchase conversion events through the Shopify app. If you know what you’re doing, they can help you. You do need to remove the purchase one.

      Reply
      • Fantastic. Thank you for all of your help – and the quick reply. You’re a saint!

        Reply
      • Hey!

        >Being a beta feature, not all accounts have access to Enhanced Conversions. If you do not, you can remove the lines between and . This maybe unnecessary, but it is untested keeping it there without the feature present.

        What lines need to be removed?

        Reply
  • Just for anyone else that has any trouble – I had to put the Google Tag Manager snippet below the Digital Darts code in the checkout section on Shopify. Then it worked without trouble.

    Reply
  • Thank you Joshua for this helpful guide. I have 2 problems when applying this guide:
    1. My Store use multiple languages and currencies. I also have multiple feeds in google merchant with many languages for many countries.
    => Which aw_feed_country / aw_feed_language I should use in this case? or I have to use many lines of code for each language?
    2. Do you have a guide for GA4 ?

    Reply
    • Hi Albert,

      1. I think multiple languages and currencies (from multiple feeds) is a challenge. There is no way to tell 100% of the time at checkout what feed someone came from. There’s nothing from Google on how they expect you to deal with such a situation.

      To do it, it is contingent on assumptions. You could set the {{ aw_feed_country }} and {{ aw_feed_language }} variables based on the delivery address of the customer or the currency they checked out with.

      The main thing to get right is the consistency of IDs (whether they use SKUs, variant IDs, etc.) in all feeds.

      2. No guide for GA4. It is unsupported in Shopify. All the hacky solutions for it are incomplete (tracking code on pages with purchase information at checkout.) Very few stores benefit from going on it. I suspect Shopify will upgrade to it in 2022.

      Reply
      • Thank you Joshua for fast reply.
        At this time I have 2 stores with main domain and sub domain (2 Shopify stores, one for US and one for EU countries). Do I have to create 2 conversions in Google ads manager (each conversion for each sites) or Is it okay to keep one only for both?

        Reply
        • If you are using the one Google Ads account, it is fine to use the one conversion code pasted then configured in both stores. We like to create new conversion codes per store though for clarity of separation if you are driving traffic to the right country served by a store, which you should be doing.

          Reply
          • Thank you.
            I tried to setup in my store with new Conversion.
            However after finishing, Google ads show that the conversion is “Unverified” with Troubleshoot button.
            I troubleshoot and tag config show that they did not recognize the conversion info though I added right AW id and conversion label.

  • Hello Joshua, thank you very much for all the guides you publish, they are very helpful!

    How does this new feature and code relate to your other guides for Shopify conversion tracking and analytics reporting? What do we need to remove? What do we need to modify? And what code can be safely kept on-site?

    Thank you very much for all your help 🙂

    Reply
  • Great tutorial. One small improvement:
    {% assign UA-ID = “UA-PROPERTY_ID” -%}

    Notice the first {% does not have a hyphen, but the closing -%} does. This should be corrected to:
    {%- assign UA-ID = “UA-PROPERTY_ID” -%}

    This will ensure whitespace is trimmed successfully.

    Reply
  • Hi,
    Thanks for the article!
    I have a question on the match status troubleshooting. The thing is that after setting this up and letting it run for 2 weeks, I noticed that on Google Ads account under this ”Enhanced conversion by tags” Diagnostics tab, the Match Status shows up as ‘Your match status has some issues’ -> ‘Increase your matches by providing more customer identifiers and ensuring that your customer data is valid and correctly formatted.’
    I wonder what might be wrong and how to fix it. The email field is almost certain issue free, and the ‘first name’ & ‘last name’ should also be just fine, so the issue is likely appearing either because of some input discrepancies in one of the address fields or I’m also thinking that it could be because of the different phone number formats that is accepted by Shopify and Google. I found out that Google apparently prefers phone numbers without symbols or dashes, while Shopify basically doesn’t care- you can type into the phone number field on Shopify checkout a phone number in whatever format you want. Anyway, all of this still doesn’t help me to fix the Match Status issues on Google Ads account for this particular Enhanced Conversions tracking setup. Does anyone have any experience troubleshooting and fixing this? Could you please advise on the steps in this process? Thanks!

    Reply
    • You can view the orders in Shopify to see the below data you’re collecting. Then take the next step, follow the directions “How To Test The Code” to confirm what’s output for several orders. The phone plus email, or address and name plus phone, must be available:

      1. Email address (preferred)
      2. Name and home address (street address, city, state/region and postcode)
      3. Phone number (must be provided in addition to one of the other two pieces of information above)

      Reply
      • Thanks for your response, appreciate it!

        Well, yes, I already viewed the orders in Shopify to see what data I’m collecting (unfortunately I can’t add any screenshots to this msg here)-> it all seems fine – email, first&last name, address, phone number- all of them are collected just fine without no apparent issues (checked this for around 10 orders). On top of that, the email is collected with 100% accuracy as far as I can tell. When it comes to name, address, phone number-> these are recorded/collected just fine, too, for the most part at least. Yes, I noticed that here and there a customer might type a company name in the last name field, or provide an inaccurate address not according to the format Shopify requires- but these are ‘one-off’ instances. Besides, they are outside of our control anyway. So, everything (Enhanced Conversion Tracking code) seems to be set up just fine, however, I still see the same msg in the Diagnostics tab on Google Ads under Tools&Settings->Measurement->Conversions->Sales Conversions->Diagnostics. The error msg reads as follows:
        ‘Increase your matches by providing more customer identifiers and ensuring that your customer data is valid and correctly formatted.’

        Any other idea how to troubleshoot this further?
        Thanks for your time!

        Reply
  • Hello!
    An inquiry please.
    I have configured Shopify with Google Universal Analitycs, I have also created the sales funnel in Analitycs.
    Then I have linked Google Analitycs with Google Ads and I have created a conversion method doing the “Alternative: Google Analytics Import” step and it has created “Transactions” in the conversion action.

    My question is, is it now?
    But… do I also have to add the global tag in shopify in the shopify checkout in the additional script?? or is it not necessary to do this?

    Reply
  • Hi there,

    I am attempting to implement the code but am not sure if its done right.

    Step 2: Is the AW-GOOGLE_CONVERSION_ID the conversion ID you can see in the google tag manager tab?

    Step 3: How do I select my value of SKU in the code? Do I need to delete the other SKU types? Mine is ‘product-id_variant-id’. If so, how do I do this?

    If I have selected my options in each step do I need to delete other parts of the code? Like parts that outline instructions?

    Reply
  • Avatar for Malte Z P Bregendahl
    Malte Z P Bregendahl
    February 27, 2022 8:15 am

    Thank you for this (somewhat) easy-to-follow guide, Joshua! Quick question; the whole script needs to be placed in just one place under “Additional Scripts” > “Order status page” – correct?

    Reply
  • Is there a way to implement GA4 into Shopify yet? Or is it too soon.

    Reply
  • Avatar for Hamdan Ur Rehman
    Hamdan Ur Rehman
    March 23, 2022 1:34 am

    Hi Joshua, excellent and well detailed instructions, just a quick question regarding an Update on Dynamic Remarketing code? As in your Google Shopping book it’s v1.3, is there any new updated code? If yes, will appreciate if you can provide link to it 🙂
    Thanks

    Reply
    • G’da Hamdan, yes there is. I will update it some time in the next few months. It is simple though. For the line with ecomm_totalvalue, it can be , 'ecomm_totalvalue': Shopify.checkout.total_price_set.presentment_money.amount, 'non_interaction': true });.

      Reply
  • Hi Joshua, thanks for this guide. Sadly when I disconnected & reconnected the Google Ads link in Shopify, the conversion tags were no longer active so your guide has come handy to fix the issue. Question… I can’t locate the Additional Scripts box in my Checkout settings so I’m guessing I’ll need to post in the Order status page scripts. Please excuse my lack of skills in the coding area… Should I paste the code above or below current script? Thanks for your help.

    Reply
  • Avatar for Kim Roberts
    Kim Roberts
    May 9, 2022 6:42 am

    Hi Joshua

    I hope you are well.
    This is such a great guide! Thank you very much for sharing!

    I have a quick question please.
    With regards to the aw_feed_country variable: {%- assign aw_feed_country = “EN” -%}{%- comment -%}The country associated with the feed. Use CLDR territory codes.{%- endcomment -%}

    We are using multiple manual feeds in GMC per country. For example, we have EN, IE, US, CAN, NZ, AUS feeds – so my question is, what country would we put there? I have put EN – however, we have 6 country feeds.

    Thank you for your time.
    Kim

    Reply
  • If my product item ID inside Merchant Center is in the “product-ID_variant-ID” form with “Shopify_US_” already in front of it, do I still need to include the “assign product-ID-prefix” section of the code? It says do not include if there is no prefix. But mine is already showing this prefix and I’m just worried it will double add it if I include this section of code!

    Reply
    • Yes, you need to include because it is used for you inside Merchant Center. It’s about matching the product IDs in the code at checkout to what’s inside Merchant Center.

      Reply
  • Avatar for Alexander E.
    Alexander E.
    June 16, 2022 10:54 am

    Hi there, fantastic article.

    I have a few questions:
    – Is the this upgraded event code meant to be placed under the standard Google Site Tag?
    – How long after implementing this code should events start to be recorded in Google Ads?
    – Does this event code require eCommerce settings to be enabled in UA?

    Thank you!

    Reply
    • Hi Alexander. The placement is described in the article. Events can take up to 48 hours to appear. I don’t know what you mean by ecommerce settings, but you should have revenue, checkout steps, etc. setup anyway. You just need your UA ID to use the tracking code.

      Reply
  • What if the business has a weird setup like this:

    1 Domain URL (no subdomains or different .com/.ca/etc)
    1 Google Ads Account
    1 Merchant Center Account
    2 Merchant Center Feeds Each Targeting A Different Country Of Sale (US & Singapore)
    2 Performance Max Shopping Campaigns Each Targeting 1 Country Of Sale

    Do they create 2 conversion events inside Google Ads with each one for a specific country to match the feed? Do they create a dynamic country of sale like “address.country” (if that’s even possible). How do we make this as streamlined as possible? With different subdomains this would be easy, but with it all on one URL, I’m not sure how to proceed.

    Thanks for the help!

    Reply
    • The domain, ads account, merchant center, and P Max change nothing. The tweak needed is to accommodate different feeds. You want to make sure the product ID, currency, merchant ID, country, and language line up with each feed. You can customize the one code snippet to suit where only one event fires.

      Reply

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.

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

Get Your Free 4 Rules of Store Growth:

Follow For Weekly Shopify Marketing Tips

Get Your FREE Google Ads Audit(For serious Shopify businesses only.)

Discover the exact ways you're wasting ad spend and how to grow in profit through Google Search, Shopping, and video. Our goal is that you'll love what you see and want to work with us.