Dynamic remarketing is used to re-engage users based on content they’ve already seen, hence driving conversions that already have some momentum behind them.

Before you get started, you’ll need to have a Google Merchant Center account and a product feed. You can read up on how to upload your feed here.

 Next, you’ll need to link your merchant center and ad accounts. 

Make sure your Google Analytics is linked as well.

Go to Tools & Settings > Shared Library > Audience Manager in Google Ads.

Click on Audience Sources and under Google Tags, click Set Up Tag. 

To create the Google Ads tag data source, select ‘Collect data on specific actions’ in the Remarketing section and select your business type. Then Save and Continue. 

To install the tag, click Install the Tag yourselfContinue. 

There are two boxes with code inside of each. We’re going to use the second box- the Event Snippet. Be sure to make a note of the audience Source Tag ID for later use. We’ve underlined the audience source tag ID in red in the event snippet below. Click on the image to enlarge it.

Next you’ll need to log into Shopify.

Go to Online Store > Themes. Then click Actions Edit Code. 

Then click on theme.liquid under Layout.

This is where we are going to paste code in order to set up the remarketing tag. This is a little tricky, so read the following steps carefully.

Copy the code below into a text editor to be used later.

<!-- Google Remarketing Tag for Shopify  -->
<!-- ShoppingFeeder -->

<!-- CODE SETTINGS START -->
<!-- CODE SETTINGS START -->

<!-- Please add your Google Ads Audience Source Tag ID -->
{% assign fa_google_ads_audience_tag_id = 123456789 %}

<!-- Please add your alpha2 code, you can find it here: https://help.shopify.com/en/api/custom-storefronts/storefront-api/reference/enum/countrycode -->
{% assign fa_product_id_alpha2_code = 'US' %}

<!-- if you have prices such as 1,000.00 set below to true, if you have prices such as 1.000,00 set below to false -->
{% assign fa_prices_with_decimal_separator = true %}

<!-- set your product id values are default, product_id, parent_id, sku-->
{% assign fa_product_id = 'default' %}

<!-- CODE SETTINGS END -->
<!-- CODE SETTINGS END -->

<!-- ------------------------------------ -->
<!-- Global site tag (gtag.js) - Ads. -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-{{ fa_google_ads_audience_tag_id }}"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'AW-{{ fa_google_ads_audience_tag_id }}');
</script>
<!-- Global site tag (gtag.js) - Ads. -->
{% if fa_prices_with_decimal_separator == true %}
	{% if template contains 'product' %}
		{% assign fa_product_price = product.price_min | money_without_currency | remove:',' %}
	{% elsif template contains 'cart' %}
		{% assign fa_product_price = cart.total_price | money_without_currency | remove:',' %}
	{% endif %}
{% else %}
	{% if template contains 'product' %}
		{% assign fa_product_price = product.price_min | money_without_currency | remove:'.' | replace: ',', '.' %}
	{% elsif template contains 'cart' %}
		{% assign fa_product_price = cart.total_price | money_without_currency | remove:'.' | replace: ',', '.' %}
	{% endif %}
{% endif %}
{% if template contains 'collection' %}
{% assign fa_event = 'view_item_list' %}
{% elsif template contains 'product' %}
{% assign fa_event = 'view_item' %}
{% elsif template contains 'search' %}
{% assign fa_event = 'view_search_results' %}
{% elsif template contains 'cart' %}
{% assign fa_event = 'add_to_cart' %}
{% elsif template contains 'index' %}
{% assign fa_event = 'home' %}
{% else %}
{% assign fa_event = 'other' %}
{% endif %}

<script>
  gtag('event', '{{ fa_event }}', {
    'send_to': 'AW-{{ fa_google_ads_audience_tag_id }}',
	{% if template contains 'product' or template contains 'cart' %}'value': {{ fa_product_price }},{% endif %}
	{% if template contains 'product' %}
    'items': [{
		{% if fa_product_id == 'default' %}
			'id': 'shopify_{{ fa_product_id_alpha2_code }}_{{ product.id }}_{% if product.variants.first.id %}{{ product.variants.first.id }}{% else %}{{ product.variants.id }}{% endif %}',
		{% elsif fa_product_id == 'product_id' %}
			'id': '{% if product.variants.first.id %}{{ product.variants.first.id }}{% else %}{{ product.variants.id }}{% endif %}',
		{% elsif fa_product_id == 'parent_id' %}
			'id': '{{ product.id }}',
		{% elsif fa_product_id == 'sku' %}
			'id': '{% if product.variants.first.id %}{{ product.variants.first.sku }}'{% else %}{{ product.variants.sku }}'{% endif %}',
		{% endif %}
      'google_business_vertical': 'retail'
    }]
	{% elsif template contains 'cart' %}
	'items': [
	{% for item in cart.items %}
	{
		{% if fa_product_id == 'default' %}
			'id': 'shopify_{{ fa_product_id_alpha2_code }}_{{ item.product_id }}_{{ item.variant_id }}',
		{% elsif fa_product_id == 'product_id' %}
			'id': '{{ item.variant_id }}',
		{% elsif fa_product_id == 'parent_id' %}
			'id': '{{ item.product_id }}',
		{% elsif fa_product_id == 'sku' %}
			'id': '{{ item.sku }}',
		{% endif %}
      'google_business_vertical': 'retail'
    },
	{% endfor %}
	]
	{% endif %}
  });
</script>
<!-- Google Remarketing Tags for Shopify -->

 

 

The first part of the code is the only part we will need to make changes to, specifically in the highlighted sections:

  • fa_google_ads_audience_tag_id = _____________
    • This will be the 10 digit audience source tag ID you wrote down in the earlier step
  • fa_product_id_alpha2_code= _______________
    • this will be the code for the country you’re targeting
  • fa_prices_with_decimal_separator =______________
    • this will be either ‘true’ if you are in the US or ‘false’ if you are in the EU

Make sure you’ve saved a copy the code with all the changes necessary in a text editor as we will use it again later. Then paste the updated code between the <head> and </head> tags in theme.liquid.

Once you’ve made the changes in the code in theme.liquid, click Save. Then head to Settings > Checkout. 

Under Order Processing, go to the Additional Scripts textbox. This is where you will paste the code (with changes) for the second time. Then click Save.

All set to go! Now your remarketing tag is set up and you can begin setting up your remarketing campaign!

More guides to follow on our help page, but in the mean time, read more on remarketing campaigns here.