d
Topic
Posts:
7
January 31, 2014
g
7

How to add Google Dynamic Remarketing code in Shopify

Hi,

I've been working on this this morning and none of the existing forum threads had the answers, so now that I've got it running I thought I'd add a post here in case anyone else is struggling with the same thing!

Where to sign up for Remarketing:
Go to your Google Adwords homepage and click on the Campaigns tab. Low down on the left hand menu there is an option called Remarketing. Follow the instructions and it will email you a custom piece of code.

Where to place your code:
You need to copy and paste this code into your Shopify template page. In your Admin, go to Themes, click Template Editor then choose theme.liquid. Paste the piece of code just above the /body closing tag.

How to customise your code:
There are three parameters in the code you need to customise. You need to fill these with the following Shopify variables:

ecomm_prodid: '{{ product.id }}',
ecomm_pagetype: '{{ template }}',
ecomm_totalvalue: '{{ product.price_min | money_without_currency }}',

Hope that helps someone :)

 

www.littlegoatgruff.co.uk Toys, clothing and more for babies and toddlers ages 0-3
i
Replies
Posts:
11
Last edited February 01, 2014

Thanks for the info. I get a critical error but its just non standard implementation so I assume everything should work out ok.

Posts:
7
February 01, 2014
g
1
upvotes

Hope it works out for you Jeremy.

Love the website by the way - we are big fans of Kongs in our household!

www.littlegoatgruff.co.uk Toys, clothing and more for babies and toddlers ages 0-3
Posts:
155
February 01, 2014

Good to see more people exploring remarketing efforts. So many store owners overlook this. We always get people going on remarketing. Especially established stores with solid traffic numbers. 

Have you tried doing anything like abandon cart retargeting yet?

Former SEO of Inc Top 500 Retailer AmericanMuscle.com who Co-Founded Online Retail Marketing Company, Rocket Dove (http://www.rocketdove.com) where we drive millions in revenue across various ecommerce industries.
Posts:
11
February 02, 2014

Thank Kate! We are too, KONG makes great products.

Posts:
1
February 04, 2014

Hi Kate, Not sure if you have this fully implemented yet.  I've been working on this myself.  This post details pretty well how to set up dynamic remarketing as well.  Did you happen to implement the ecomm_pagetype:'purchase' anywhere?  I have 'cart' added, but I don't think this will catch if the item was purchased or not, meaning I'll be remarketing to people who have actually executed a purchase?  This would not make so much sense for my particular product line.

Posts:
4
March 14, 2014

Thanks Stacy.. I've been looking for something like this.  Can you tell me if the values you added are working well and populating your google audience lists precisely?

Posts:
4
March 30, 2014

As per this thread, I have inserted the script below on my template.liquid. The problem is that Google is giving me the following error:
"Some values for the custom parameter ecomm_pagetype are missing".

My fear is that my audience lists are not being populated precisely.  Has anyone else run into this and found a solution?

This is the script in my template.liquid:

--------------------------------------------------
<script type="text/javascript">
var google_tag_params = {
ecomm_prodid: '{{ product.id }}',
ecomm_pagetype: '{{ template }}',
ecomm_totalvalue: '{{ product.price_min | money_without_currency }}',
};
</script>
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1067729617;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</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="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1067729617/?value=0&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
--------------------------------------------------

Posts:
4
May 20, 2014

I am having the same issue. Has anyone figured this out?

Chris Member
Posts:
1
May 21, 2014
g
1
upvotes

I've installed this tag as well and on the product pages all of the custom fields are populating.  However, on collections or category pages the product id and product total fields are blank.  Shouldn't all the products in a collection populate here?

Also on my shopping cart pages the pagetype of cart is populating but the total of all items and the product ids in the cart are not populating?  How can I correct this?

Posts:
7
May 24, 2014

I've actually turned this off on my shop now as I wasn't getting enough abandonments to make it worth paying for, so I can't help with checking error messages unfortunately.

Chris, I wouldn't worry too much about the collection and cart pages - so long as the product IDs are being grabbed when people look at the products, that will populate your remarketing adverts. Presumably on a collection or cart page, it doesn't know which product the customer is actually looking at so can't track interest...?

www.littlegoatgruff.co.uk Toys, clothing and more for babies and toddlers ages 0-3
Posts:
21
August 22, 2014

Here is my detailed post about how to setup dynamic remarketing on shopify website. Please take a look and let me know if something went wrong. I will be able to help!

http://ecommppc.com/2014/08/20/how-to-setup-dynamic-remarketing-tag-on-your-shopify-store/

My Adwords Website http://ECOMMPPC.com | Current Adwords Certification http://goo.gl/5TgBGS
Posts:
1
October 14, 2014

Hello and Thank you so much for uploading this! So simple and easy!

Posts:
21
Last edited October 14, 2014

Thanks Tamara!

Also discover articles like implementing Google Analytics User Id tracking on Shopify

Upcoming Article are

Implementing Mixpanel on your Shopify Store

Implementing Woopra on Your Shopify Store

Siva.

My Adwords Website http://ECOMMPPC.com | Current Adwords Certification http://goo.gl/5TgBGS
Jan Member
Posts:
2
Last edited November 22, 2014

(DELETED - Sorry, wrong thread)

Posts:
8
March 06, 2015
g
2
upvotes

To get the product ID in my tag to match the product ID in Google Merchant Center I had to format the ecomm_prodid as 'shopify_US_{{ product.id }}_{{ product.variants.first.id }}'. I hope this helps someone!

Posts:
151
March 06, 2015

Hey Ben!

Thanks for your post. I'm struggling with this too. I stuck at the stage of putting remarketing tag inside Shopify code. Tried to use GTM, but the tag isn't being fired. 

Will you please share, how you implemented the code. 

I'd be very thankful!

Cheers,

 — Stas

★ Shopify Customer/Order Auto Tag App → 99rabbits.com ★
Posts:
8
March 07, 2015

Hey Stas,

I just copied the code from my Adwords account and pasted it into my theme.liquid file just before my closing </body> tag. Did you do that and it's still not working?

Posts:
151
March 09, 2015

I see. So you just use it for regular retargeting, right? 

In order to create dynamic retargeting campaigns, you need to send adwords some data from shopify (such as product id, price).

★ Shopify Customer/Order Auto Tag App → 99rabbits.com ★
Posts:
8
March 09, 2015

Correct, and to do this you follow the instructions in the first post on this thread.

Posts:
151
March 09, 2015

Ok, thanks. I've seen other versions of the code.

For example, I don't think it's correct to use ecomm_pagetype: '{{ template }}'. Shopify home template is called 'index' and Adwords needs it to be 'home'.

★ Shopify Customer/Order Auto Tag App → 99rabbits.com ★
stickleback Member
Posts:
3
March 09, 2015

Has anyone managed to set htis up through GTM?

I tried adding the params to the GA tag - another screenshot on its way after this one....

 

 

Screen shot 2015 03 09 at 18.34.11 thumb
stickleback Member
Posts:
3
March 09, 2015

... but got the understandable error that GTM thought I was referring to another macro...

So how can we add the params within GTM - or can it simply not be done?

 

Screen shot 2015 03 09 at 18.33.55 thumb
stickleback Member
Posts:
3
Last edited March 09, 2015

Hmmm... just added a new constant string macro containing: 

ecomm_prodid: '{{ product.id }}',

ecomm_pagetype: '{{ template }}',

ecomm_totalvalue: '{{ product.price_min | money_without_currency }}',

and then added this to the GA tag .... didn't throw up any errors, but that probably means little....

 

Posts:
2
Last edited March 23, 2015

To get the product ID in my tag to match the product ID in Google Merchant Center I had to format the ecomm_prodid as 'shopify_US_{{ product.id }}_{{ product.variants.first.id }}'. I hope this helps someone!

Thank you for posting this! Had the same issue and couldn't figure this out for a long time. This works.

Posts:
2
May 27, 2015

Scott or anyone,

Is this because you're using the Shopfiy app to get your data into Google Merchant Center that you needed to update the code per your post here:

To get the product ID in my tag to match the product ID in Google Merchant Center I had to format the ecomm_prodid as 'shopify_US_{{ product.id }}_{{ product.variants.first.id }}'. I hope this helps someone!

Thank you for posting this! Had the same issue and couldn't figure this out for a long time. This works.

 

Thanks!

Posts:
13
May 30, 2015
g
1
upvotes

For the ecomm variables I'd suggest either adding them just to the product page template or using an IF statement like the below:

{% if template == 'product' %}
<script type="text/javascript">// <![CDATA[
var google_tag_params = {
ecomm_prodid: 'shopify_CA_{{ product.id }}_{{ product.variants.first.id }}',
ecomm_pagetype: '{{ template }}',
ecomm_totalvalue: '{{ product.price_min | money_without_currency }}',
};
// ]]></script>
{% endif %}

Also it's worth noting that when using the Shopify Google Shopping app, the code will change based on the location of your store. For example UK stores would need to use:

ecomm_prodid: 'shopify_GB_{{ product.id }}_{{ product.variants.first.id }}',
ecomm_pagetype: '{{ template }}',
ecomm_totalvalue: '{{ product.price_min | money_without_currency }}',

Specifically the country identifier in the ecomm_prodid changes (GB in the above) and you can find this by going to merchant centre and taking a look at the details of your feed.

If anyone has got to the bottom of this thread and is still looking for some advice / info on setup Dynamic Remarketing within Shopify, I've actually created a walkthrough video on the process. 

It's Shopify + AdWords specific, and should give you all the info you need to get setup.

Including the liquid code you need for ecomm product info etc:

http://www.ppcwins.com/how-to-setup-adwords-dynamic-remarketing-for-your-shopify-store/

Posts:
5
February 04, 2016

Hi John, 

The video is great help - thanks for sharing! 

I've added the code for UK, using the one that relates to Shopify Google Shopping.

ecomm_prodid: 'shopify_GB_{{ product.id }}_{{ product.variants.first.id }}',

ecomm_pagetype: '{{ template }}',

ecomm_totalvalue: {{ product.price_min | money_without_currency }}

 

However when viewing a product page, using the Tag Assistant, it still shows an error message of:

Tag Paramater object could not be parsed.

 

Also, when going to my adwords account, it still shows the following error message:

There are problems with some of your custom parameters for Retail (AdWords)

 

Do you have any suggestions on what to do here to finalise Google Dynamic Remarketing?

 

Thank you

Hellen

 

Posts:
1
April 12, 2016

Has anyone figured out the ecomm_totalvalue totalling all the values on the cart page?  I'm trying to set up Shopping Cart Abandoners list in Adwords, but nothing is populating and I think this is the problem.

Posts:
1
April 15, 2016
g
2
upvotes

I just figured out how to do the Google Dynamic Remarketing part (that is, the product ID, pagetype and total value). It took forever, but it checks out now and passes the correct values on both the product and cart pages. The problem (stated above) is if you're using the Google Shopping for Shopify app, the product ID doesn't pass correctly. Google Shopping has a special format that is different on the cart pages than it is on the product pages. Here's the code I used:

 

<script type="text/javascript">
	{% if template contains 'product' %}
		var google_tag_params = {
		ecomm_prodid: 'shopify_US_{{ product.id }}_{{ product.variants.first.id }}',
		ecomm_pagetype: 'product',
		ecomm_totalvalue: {{ product.price | money_without_currency }}
		};
	{% elsif template contains 'cart' %}
		var google_tag_params = {
		{% if cart.item_count > 1 %} 
			ecomm_prodid: [{% for item in cart.items %}'shopify_US_{{ item.product_id }}_{{ item.variant.id }}'{% if forloop.last != true %},{% endif %}{% endfor %}],
		{% elsif cart.item_count == 1 %}
			ecomm_prodid: {% for item in cart.items %}'shopify_US_{{ item.product_id }}_{{ item.variant.id }}'{% endfor %},
		{% else %}
			ecomm_prodid: '',
		{% endif %}
			ecomm_pagetype: 'cart',
			ecomm_totalvalue: {{ cart.total_price | money_without_currency }}
		};
	{% elsif template contains 'search' %}
		var google_tag_params = {
		ecomm_prodid: '',
		ecomm_pagetype: 'searchresults',
		ecomm_totalvalue: ''
		};
	{% elsif template contains 'index' %}
		var google_tag_params = {
		ecomm_prodid: '',
		ecomm_pagetype: 'home',
		ecomm_totalvalue: ''
		};
	{% else %}
		var google_tag_params = {
		ecomm_prodid: '',
		ecomm_pagetype: 'other',
		ecomm_totalvalue: ''
		};
	{% endif %}
</script>

 

Posts:
3
May 07, 2016

This informaiton is indeed helpful. However there are following 2 issues

- ecomm_totalvalue: {{ product.price | money_without_currency }}

The Goolge Tag Assistant is give a parse error becuse of a comma in the price. E.g. 2,300.00

- ecomm_totalvalue: ''

The Goolge Tag Assistant is give a parse error becuse of number values cannot be qouted.

Any help will be appreciated.

Thanks

Posts:
3
May 08, 2016

Here is the fix to the problem

- ecomm_totalvalue: {{ product.price | money_without_currency | replace: ',', '' }}

- ecomm_totalvalue: 0

Posts:
5
May 09, 2016

Hi

Does anyone know what the code would look like for UK businesses?  I notice the code above has this: shopify_US_

should UK businesses use this?  

 

Thanks

Hellen

Posts:
15
June 07, 2016

Hi Hellen, this post is quite old now, so I hope you found the answer earlier, but if you didn't, you have to change the shopify_US_ to shopify_GB_

Does anyone know how to stop the remarketing code from parsing your sold items? I'm getting an error because my sold items aren't included in my Merchant Center Feed...

Thanks for any help anyone can give!

Dan Wood Shopify Partner breakdigital.com
Posts:
37
June 10, 2016

Thank you!

Digital marketing and marketing tech expert. I help businesses build wholistic customer flows from advertising, landing pages, ecommerce, lead capture to crm, email marketing, retargeting and more.
Dan Wood Shopify Partner breakdigital.com
Posts:
37
Last edited June 23, 2016

Does anyone know how to implement this using Google Tag Manager?

I've tried to enter the ecomm variables as customParams while configuring a tag:

Key: ecomm_totalvalue

Value: '{{ product.price | money_without_currency | replace: ',', '' }}'

and it get the error: The value is not properly formatted.

It will only allow me to save if I enter this instead:

{{ product.price | money_without_currency }}

I've tried the replace: command with single and double quotes. Maybe I need to add it as a custom 

Digital marketing and marketing tech expert. I help businesses build wholistic customer flows from advertising, landing pages, ecommerce, lead capture to crm, email marketing, retargeting and more.
Posts:
2
June 23, 2016
g
2
upvotes

Good stuff. I had to tweak your code slightly for it to work on my store. As below:

 

{% if template == 'product' %}

<script type="text/javascript">// <![CDATA[

var google_tag_params = {

ecomm_prodid: 'shopify_AU_{{ product.id }}_{{ product.variants.first.id }}',

          ecomm_pagetype: '{{ template }}',

ecomm_totalvalue: {{ product.price | money_without_currency }}

};

{% elsif template contains 'cart' %}

var google_tag_params = {

{% if cart.item_count > 1 %} 

ecomm_prodid: [{% for item in cart.items %}'shopify_AU_{{ item.product_id }}_{{ item.variant.id }}'{% if forloop.last != true %},{% endif %}{% endfor %}],

{% elsif cart.item_count == 1 %}

ecomm_prodid: {% for item in cart.items %}'shopify_AU_{{ item.product_id }}_{{ item.variant.id }}'{% endfor %},

{% else %}

ecomm_prodid: '',

{% endif %}

ecomm_pagetype: 'cart',

ecomm_totalvalue: {{ cart.total_price | money_without_currency }}

};

{% elsif template contains 'search' %}

var google_tag_params = {

ecomm_prodid: '',

ecomm_pagetype: 'searchresults',

ecomm_totalvalue: ''

};

{% elsif template contains 'index' %}

var google_tag_params = {

ecomm_prodid: '',

ecomm_pagetype: 'home',

ecomm_totalvalue: ''

};

{% else %}

var google_tag_params = {

ecomm_prodid: '',

ecomm_pagetype: 'other',

ecomm_totalvalue: ''

};

  {% endif %}

// ]]></script>

<script type="text/javascript">

/* <![CDATA[ */

var google_conversion_id = (insert your unique ID);

var google_custom_params = window.google_tag_params;

var google_remarketing_only = true;

/* ]]> */

</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="//googleads.g.doubleclick.net/pagead/viewthroughconversion/(insert your unique ID)/?value=0&amp;guid=ON&amp;script=0"/>

</div>

</noscript> 

Posts:
5
8 months ago
g
1
upvotes

The post immediately above is not outdated as of 2/3/17. Thank you citydan. That code snippet worked great for me.

Maybe most folks already know this, but shopify_AU_  needs to be changed based on your country, so in the US it's shopify_US_ and in Canada it's shopifiy_CA_ etc. Anyone copying and pasting also needs to include their unique google adwords id number at (insert your unique ID).

 

 

Posts:
249
8 months ago
g
1
upvotes

I suggest stores just setup their analytics correctly then using remarketing through that as opposed to the dynmaic remarketing code.

Want to increase your Shopify conversion rate? Get the most detailed guide for free that stores have used to double their sales at: https://www.digitaldarts.com.au/shopify-conversion-rate-optimization
Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
8 months ago
http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
4
8 months ago

everyone is giving different answers and we are getting confused...

Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
Last edited 7 months ago

Hi Yasir,

Here is a writeup on how I implement dynamic remarketing on the sites I manage, and it works as it is supposed to:

https://business.czarto.com/2017/02/07/shopify-dynamic-remarketing-setup/

In a nutshell, you need to install this code in your checkout scripts (available on github here):

<!-- Google Dynamic Remarketing -->
{% comment %} Enter your account specific value below {% endcomment %}
{% assign google_conversion_id = 0 %}
{% assign shopify_store_country  = 'US' %}
{% if shop.currency == 'CAD' %}
{% assign shopify_store_country  = 'CA' %}
{% endif %}
<script type="text/javascript">
var google_tag_params = {
  ecomm_prodid: [{% for item in order.line_items %}'shopify_{{ shopify_store_country }}_{{ item.product.id }}_{{ item.variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
  ecomm_pagetype: 'purchase',
  ecomm_totalvalue: {{ total_price | money_without_currency | remove: ',' }}
};
</script>
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = {{ google_conversion_id }};
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
/* ]]> */
</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="//googleads.g.doubleclick.net/pagead/viewthroughconversion/{{ google_conversion_id }}/?guid=ON&amp;script=0"/>
</div>
</noscript>

Then you need to install this code at the bottom of your theme.liquid (available on github here):

{% comment %} Enter your google conversion id below {% endcomment %}
{% assign google_conversion_id = 0 %}
{% assign shopify_store_country  = 'US' %}
{% if shop.currency == 'CAD' %}
{% assign shopify_store_country  = 'CA' %}
{% endif %}

<script type="text/javascript">
  
    {% if template contains 'cart' %}
	var google_tag_params = {
  		ecomm_prodid: [{% for item in cart.items %}'shopify_{{ shopify_store_country  }}_{{ item.product.id }}_{{ item.variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
  		ecomm_pagetype: 'cart',
  		ecomm_totalvalue: {{ cart.total_price | money_without_currency  | remove: ','  }}
	};
  
  {% elsif template contains 'collection' %}
	var google_tag_params = {
  		ecomm_prodid: [{% for item in collection.products limit:5 %}'shopify_{{ shopify_store_country  }}_{{ item.id }}_{{ item.variants.first.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
  		ecomm_pagetype: 'category',
  		ecomm_category: '{{ collection.handle }}'
	};
  
  {% elsif template contains 'index' %}
	var google_tag_params = {
  		ecomm_pagetype: 'home'
	};
  
  {% elsif template contains 'product' %}
	var google_tag_params = {
      ecomm_prodid: 'shopify_{{ shopify_store_country  }}_{{ product.id }}_{{ product.selected_or_first_available_variant.id }}',
  		ecomm_pagetype: 'product',
  		ecomm_totalvalue: {{ product.price | money_without_currency  | remove: ','  }}
	};
  
  {% elsif template contains 'search' %}
	var google_tag_params = {
  		ecomm_prodid: [{% for item in search.results limit:5 %}'shopify_{{ shopify_store_country  }}_{{ item.id }}_{{ item.variants.first.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
  		ecomm_pagetype: 'searchresults'
	};
  {% else %}
	var google_tag_params = {
  		ecomm_pagetype: 'other'
	};
  
  {% endif %}

	/* <![CDATA[ */
	var google_conversion_id = {{ google_conversion_id }};
	var google_custom_params = window.google_tag_params;
	var google_remarketing_only = true;
	/* ]]> */
</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="//googleads.g.doubleclick.net/pagead/viewthroughconversion/{{ google_conversion_id }}/?value=0&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

 

IMPORTANT: Update your google_conversion_id and with the value specific to your adwords account.

Hope this helps.

Alex

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
4
Last edited 7 months ago

Alex,

Thanks for the detailed write-up.  I noticed that the instructions you posted here are slightly different than the ones posted on your Website that you linked to.  The good news is I followed the instructions on your Website, and the tag assistant is finally coming back clean!  I did have two questions about the script for the "settings > checkout > additional scripts" section though:

1) You have: 

{% assign shopify_store_country = "CA" %}

Should the "CA" be "US" for US stores?  You built in an "if" statement for the theme file/snippet, but it's not included here.  I manually changed it to "US" instead of "CA" anyway, and it seems to be working...

2) You mention (on the Website) to make sure and change the "google_conversion_label".  You don't mention this on your post here.  I couldn't find anything about "google_conversion_label" in the script, so I was wondering if that was correct.

Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
Last edited 7 months ago

Hi Zoo,

Good catches. Thanks.

1) Yes, CA is for Canadian stores, and US for US stores. I've updated the code on github, on my blog, and on here. I've replaced it with an if statement that changes the country value based on shop currency. (But also fine to just hardcode it like you did)

2) google_conversion_label is not needed. I initially had it included there because I posted a sample of how your Google AdWords conversion tracking script should look like (which uses the conversion label). If interested in the script, it's available here: https://github.com/Czarto/ShopifyScripts/blob/master/settings/checkout/adwords-conversion.liquid (It includes total checkout price, as well as order number that Google uses to deduplicate conversions)

Thanks for catching the errors!

 

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
5
6 months ago

Hi Alex,

I get and error "No HTTP response detected" when using your code in the Google Tag Assistant.

Posts:
28
Last edited 5 months ago

This worked First time - thank you so much! 

(UPDATE) For some reason code from the tag is now diplayed below my footer - wierdly its just a little bit of the tag - Here.

Anyone else had this problem / Know how to fix this?

Thanks!  

 

Posts:
4
Last edited 5 months ago

In the example above, if your product variants have different prices, you will need to use this code:

product.selected_or_first_available_variant.price

... instead of this code:

product.price

Thrivous is a human enhancement company. Its mission is to help people access technology with the greatest potential to improve their brains and bodies. In pursuit of that mission, it develops and distributes evidence-based nootropics for cognitive enhancement, including Clarity, the daily nootropic to improve focus, memory, and mood, and to support brain function.
Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
5 months ago

Thanks Thrivous. I've updated my code (on github) to reflect this change. Good catch!

https://github.com/Czarto/ShopifyScripts/blob/master/snippets/adwords-remarketing.liquid

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
5 months ago

Hi Daniel,

It looks like you are missing an opening <SCRIPT> tag. If you do a viewsource on your homepage, you'll see at about line 1515 that there is no opening SCRIPT tag right before

<!-- Google Code for Remarketing Tag -->

Check your code to make sure that you didn't miss a line when copy/pasting, or that you didn't forget to close any liquid tags that might be causing the script tag to go missing...

Hope this helps!

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
28
Last edited 5 months ago

Thanks Alex,

I think I have implimented what you and Thrivous suggested (assuming Thrivous's post was directed at me). Using tag assistant on hrome I'm now getting an error for the home page only that says "Some products could not be validated" this is super wierd as the tags are all ok (Green) on the "Products" page from my nav bar - its just the home/landing page where it isnt happy.

I may have done somthing wrong as I'm pretty new to this! Do you have any thoughts?

Cheers,
Dan  

Posts:
56
Last edited 5 months ago

Hi Alex

Wow this was tricky!

I hope I have set it correctly up for my shop now because AdWords reports errors - can you verify on e.g. this product with Google Tag Assistant?

https://www.authentic.dk/collections/nexo-danmark/products/charles-brown

I think the price is wrong?

In DKK it is 695 - but the value is set to 69500 as I see it?

ecomm_totalvalue: 69500

Another product - this one:

https://www.authentic.dk/collections/vejrhoj/products/nautic-58-north-ebony

Here the value should be DKK 2795 but it is also wrong

ecomm_totalvalue: 2.79500

On the shop I use . as thousands delimiter and , as the decimal delimeter as this is Danish standard.

Google Adwords finds a bunch of errors which the Tag Assistant doesn't find:

We found the custom parameter "ecomm-prodid" in very few pages.

Top 500 pages with missing prodID includes some products where I cannot see the prodID is missing - e.g. this one:
https://www.authentic.dk/collections/dameure/products/nautic-62-north-zebrawood

(total of 47 pages withoiut prodID it reports)

This is also reported an error by Adwords:

Some values for the custom parameter "ecomm_pagetype" are missing
The tag is not passing all required values for "ecomm_pagetype".

Top 10 values for "ecomm_pagetype"
product
category
collection

 

I hope you can help sort it out so I can get my dynamic remarketing working :)

Regards,

Kenneth

tmpulido Shopify Merchant www.colorcrazy.com
Posts:
18
Last edited 5 months ago

Alex,

Maybe a stupid question, but do you need to have products loaded into Google Merchant Center to make Dynamic Remarketing work? Your blog post states one issue as Products not properly uploaded to Google Merchant Center.  

Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
Last edited 5 months ago

Hi Kenneth,

Sorry for the late reply.

Appologies -- it seems my code is very North American centric.

Google is expecting a "javascript number" as the value for ecomm_totalvalue, To fix the pricing issue, you would need to replace any line that looks like this:

ecomm_totalvalue: {{ total_price | money_without_currency | remove: ',' }}

With 

ecomm_totalvalue: {{ total_price | money_without_currency | remove: '.' | replace: ',' , '.' }}

(This removes all period separators, and then replaces the remaining comma as the cents separator with a period). Remember to fix this on the checkout page too.

For the issue with prodID not showing, this is probably related to the above issue (products with strange currency values are probably being rejected). So try it with the code above and give google a few days to update and see if things get better?

For the page type, I think you just need to wait a while longer? Are you still seeing this error?

Hope this helps.

Best,

Alex

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
5 months ago

Hi Tmpulido,

Yes, you need to have products properly uploaded to Google Merchant center for this to work. You can either get this setup using Shopify's Google Shopping app or by following this writeup: Shopify DIY Google Shopping Feed

Best,

Alex

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
4
5 months ago

Hi I am using the Google Shopping app to sync the product feed to Google merchant center. 

Do I need to add the feed before I can use the Google dynamic remarketing? And does anyone have a 

setup guide on hand?

Thanks!

 

Proson

 

Posts:
1
4 months ago

Hi Daniel,

I am having similar error to yours on the homepage of my store . "Some products could not be validated" in the tag assistant. 

Were you able to fix the issue?. If yes then, It will be great if you can share it. 

Thanks

Jess Member
Posts:
3
about 1 month ago

After hours trying to solve this issue by myself, I found out about this app which seems to do the trick + plus it also creates your remarketing campaings - category viewers, product viewers and cart abandoners. I had a little problem signing up with my Google account by the support was super helpful. Yeah and I almost forgot the app's free :)

Posts:
3
9 days ago

Hi Alex. This script almost works for me. But I cant figure out how to get the ecomm_totalvalue: to work.

The format is: "120,00" (https://superhund.no/collections/nyttig/products/millers-klosaks)

Any tips how to tweak the code to work with this format?

Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
8 days ago

Hi Geir,

I believe google is expecting a decimal as the decimal separator.

Try this:

ecomm_totalvalue: {{ total_price | money_without_currency | replace: ',', '.' }}

(I'm replacing the comma with a decimal... Make sure to also test this with 4 digit values in case there are any thousand's separators in your currency)

Good luck!

Alex

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
3
8 days ago

Alex: Thanks for your fast reply. I tried it, but it still doesnt work.

Alex Czarto Shopify Merchant business.czarto.com
Posts:
42
8 days ago

Hi Geir,

How about this:

ecomm_totalvalue: {{ product.price | money_without_currency | replace: ',', '.' }} };

 

http://www.manitobah.ca/ - http://www.canadianicons.ca/ - http://www.pendleton.ca
Posts:
3
7 days ago

Alex: Thanks, that did work:) very nice.