Adding Adwords Conversion Tracking to Shopify

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

Step 1

Login to your Shopify Admin Panel

Shopify Login Admin

Step 2

Click on Settings (Gear Icon) and choose Checkout

Shopify Checkout

Step 3

new UI

Login to Google Adwords and click on the 3dot menu in the top right corner and select Conversions under Measurement column.

Google Adwords Menu Conversions

Click on the big blue plus sign and select website as your tracking template.

Than do the following :

  • Conversion name
    • enter any name
  • Category
    • Purchase / Sale
  • Value
    • Use different values for each conversion
  • The rest can be as defaulted

Click on Create and continue

Create your website conversion action

There are two parts, click on download snippet for both the Global site tag and Event snippet

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

Shopify Additional Scripts

First past your Global site tag such as the example below (do not use this example, use your own downloaded code snippet)

<!-- Global site tag (gtag.js) - Google AdWords: 123456789123 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=xx-123456789123"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'xx-123456789123');
</script>

Than right after that we paste the event snippet, before we do this we need to edit the code. replace the following lines from your downloaded code snippet to the code example below :

  • ‘send_to’: ‘xx-123456789123/lkadsjKDweLK45W’,
    • change this line with your snippet

Code Example (change the send_to to your code snippet)

{% if first_time_accessed %}
<script>
  gtag('event', 'conversion', {
      'send_to': 'xx-123456789123/lkadsjKDweLK45W',
      'value': {{ total_price | money_without_currency | remove:',' }},
      'currency': '{{ shop.currency }}',
      'transaction_id': '{{ order.order_number }}'
  });
</script>
{% endif %}

old UI

Scroll down until you see Order Processing, at the bottom of this section you will have a field where you can paste the code which is labeled Additional Content and Script. Here you can paste the below code.


Note!
Do not copy paste the below code, first edit it as instructed

Please edit the below code, by replacing the capitalized words listed below with your values supplied by Google Adwords, the values can be found following step 4 or step 4.1.

  • CONVERSION_ID (twice)
  • CONVERSION_LABEL (twice)
{% if first_time_accessed %}
<!-- Google Code for conversion Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = CONVERSION_ID;
if ({{ order.order_number }}) { var google_conversion_order_id = "{{ order.order_number }}"; }
var google_conversion_label = "CONVERSION_LABEL";
if ({{ subtotal_price }}) { var google_conversion_value = {{ total_price | money_without_currency }}; }
var google_conversion_currency = "{{ shop.currency }}";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/CONVERSION_ID/?value={{ total_price | money_without_currency }}&currency_code={{ shop.currency }}&oid={{ order.order_number }}&label=CONVERSION_LABEL&guid=ON&script=0"/>
</div>
</noscript>
{% endif %}

Step 4 Finding your code values

Login to Google Adwords and click on Tools > Conversions at the top of the page.

Google Adwords Conversions

 


Note!
If you already have a conversion code please skip to step 4.1

Click on the red button + Conversions (new UI, big blue plus button)

Select Website

Choose a name and in Value choose : Use different values for each conversion

Category, choose Purchase / Sale

Click on Done, now you can copy the values of your tracking code to the above code.

Step 4.1

Click on your existing conversion

Google Adwords Click On Existing Conversion

Than copy your existing conversion code


Note!
Make sure you have enabled the value to be Use different values for each conversion

Copy existing conversion code

Testing

You will need to make a test payment to check if the conversion tracking is correctly installed. When you are on the final thank you page of the checkout, use Tag Assistant to validate the code.

Need Help?