Shopify Google Adwords Dynamic Remarketing Tag



Google Ads conversion tracking can track actions that a person took on your website after clicking on one of your ads. If you want to track these actions, then you need to add a conversion tracking tag to your store. You can create conversion tracking for several different actions, depending on your goals. You can read more about how this feature works before getting started at Google's Help Center. Many merchants use Google Ads to track one conversion event that represents their main goal, like sales, and use analytics to track multiple other conversion events.


The Google Remarketing tag allows you to track and advertise directly to visitors of your website or mobile application. As most eCommerce professionals know, remarketing is a powerful way to increase top of mind awareness and conversion rates. In order for remarketing to work, there needs to be additional customized code added to your website, using either Google Tag Manager, enabling remarketing in Google Analytics, or by manually adding code before the closing body tag in your website’s theme. Here is a quick how-to guide for adding Google remarketing tag to a Shopify store.


Now if you are running ads on Google and you are using a Google shopping or Google smart shopping. You will need to add a conversion tracking code to track your conversions and as well as remarketing. But how can you do this on shopify? Here is a way to do it in few steps.


Step 1 - Login to your Shopify store and Go to themes and click on edit theme



Step 2 - Locate the theme.liquid template file and open it



Step 3 - Login to Google Adwords, then in the top right corner click on the 3dot menu and select Audience Manager from the Shared Library section



Step 4 - If you already installed a tag from Analytics or Adwords, That is good, Then continue by clicking the Audience sources



Step 5 - Click on the 3-dot near the Google Ads tag, Click on "edit source" and go all the way to the bottom. Please take note of the following.



- Make sure the remarketing is set to Collect specific attributes or parameters to personalize ads like the photo below:



- Make sure the following boxes are ticked. The retail , The ecom pagetype and all 3. Then click on Save and Continue.



Step 6 - After clicking on Save and continue. You will see this



INSTALLING THE CODES ON SHOPIFY - PLEASE READ THIS BEFORE YOU START. iT IS IMPORTANT THAT YOU DO NOT MAKE MISTAKES


This is a very important part so please take note of the following. In the places marked XX-XXXXXXX, Please replace it with your own Adwords code, It is right there on the screen as AW-XXXX. example gtag(‘config’, AW-123456798‘);

  1. <script async src=”https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX”></script>

  2. gtag(‘config’, ‘XX-XXXXXXXXX’);

  3. ‘send_to’: ‘XX-XXXXXXXXX’,

  4. Change the ecomm_prodid country code to yours.

  5. For example: if your store is in the US, then change shopify_GB_ to shopify_US_ If your store is in the Philippines use PH. Remember this does not refer to your store target location. It is referring to your LOCATION. If you are not sure of the country you uses, Open your shopify Settings > General. Check the country address you used when you created your shopify account. That is the country code you will use.

Step 1 - Copy the following code and paste it in your theme.liquid file in Shopify


{% if template contains 'product' or template contains 'collection' or template contains 'index' or template contains 'search' %}
<!-- Global site tag (gtag.js) - AdWords. Created by FeedArmy.com -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'page_view', {
    'send_to': 'XX-XXXXXXXXX',
	'ecomm_pagetype': '{% if template contains 'collection' %}category{% elsif template contains 'product' %}product{% elsif template contains 'search' %}{% elsif template contains 'index' %}home{% endif %}',
	{% if template contains 'product' %}
	'ecomm_prodid': 'shopify_GB_{{ product.id }}_{% if product.variants.first.id %}{{ product.variants.first.id }}',{% else %}{{ product.variants.id }}',{% endif %}
	{% endif %}
	{% if template contains 'product' %}'ecomm_totalvalue': {{ product.price_min | money_without_currency | remove:',' }}{% endif %}
  });
</script>
{% endif %}
**Paste this code At the bottom of the file before the closing </body> tag, paste the code below.**

Step 2 - Adding Remarketing Tag To Your Cart Page. Open your cart.liquid file or if it is a sectioned theme, Open cart-template.liquid and paste the code below at the very bottom of the file.


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

  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'page_view', {
    'send_to': 'XX-XXXXXXXXX',
	'ecomm_pagetype': 'cart',
	'ecomm_prodid': [{% for item in cart.items %}'shopify_GB_{{ item.product_id }}_{{ item.variant_id }}',{% endfor %}],
	'ecomm_totalvalue': {{ cart.total_price | money_without_currency | remove:',' }}
  });
</script>

Step 3 - Pasting the code on Thank you pages. Now open your Shopify settings > Go to checkout > Go all the way to order processing.

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

  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'page_view', {
    'send_to': 'XX-XXXXXXXXX',
	'ecomm_pagetype': 'purchase',
	'ecomm_prodid': [{% for item in checkout.line_items %}'shopify_GB_{{ item.product_id }}_{{ item.variant_id }}',{% endfor %}],
	'ecomm_totalvalue': {{ checkout.total_price | money_without_currency | remove:',' }}
  });
</script>
Remember to change the values in XX-XXXXXX to your own ID

See the image below if you are confused on where to paste this.


CHECKING AND VALIDATING THE CODES WE JUST INSTALLED ON YOUR SHOPIFY

There are 2 ways to verify the code. One of them is using Google tag manager or Using the view page source tool. To use google tag manager, You can install the Google Tag Manager Extension.


VERIFYING THE CODE USING PAGE-SOURCE

Visit your website on a browser and right click to view page source codes. Now you can CTRL+F and search for your Google AW-XXXXXX code. You will see the following.


Hope this helps! Happy Advertising


© Odera Joseph Echendu | All Rights Reserved