{"id":2559,"date":"2018-03-22T12:33:36","date_gmt":"2018-03-22T12:33:36","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=2559"},"modified":"2018-04-14T12:39:23","modified_gmt":"2018-04-14T12:39:23","slug":"shopify-google-dynamic-remarketing-tag-custom-parameters","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/shopify-google-dynamic-remarketing-tag-custom-parameters\/","title":{"rendered":"Shopify Google Dynamic Remarketing Tag with Custom Parameters"},"content":{"rendered":"<p>The quick and easy approach to setting up custom Google Remarketing parameters in Shopify is to use the following tags (typically in your theme.liquid).<\/p>\n<p>{{ product.id }}<br \/>\n{{ template }}<br \/>\n{{ product.price_min | money_without_currency }}<\/p>\n<p>The issue that you&#8217;ll run into though, is that Google complains when the ecomm_totalvalue is wrapped in quotes.<\/p>\n<p>So, we just remove the quotes, right?<\/p>\n<p>Not exactly.\u00a0 Not every page on your site will be a product page, and hence will not have a price.<\/p>\n<p>On the home page, for example, that would leave us with an invalid object:<\/p>\n<p>ecomm_prodid: &#8216; &#8216;,<br \/>\necomm_pagetype: &#8221;,<br \/>\necomm_totalvalue: ,<\/p>\n<p>One pretty quick trick that I use is to simply add a zero (0) before the value, as shown below.<\/p>\n<pre><code>&lt;script type=\"text\/javascript\"&gt;\r\n var google_tag_params = {\r\n ecomm_prodid: '{{ product.id }}',\r\n ecomm_pagetype: '{{ template }}',\r\n ecomm_totalvalue: 0{{ product.price_min | money_without_currency }},\r\n };\r\n &lt;\/script&gt;<\/code><\/pre>\n<p>Using this method, the worst that happens is you might get a price that looks like this:<\/p>\n<p>021.99<\/p>\n<p>Which is still a valid numeric value.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A quick and easy tip to get your Google remarketing tag setup on every page of your Shopify site with custom parameters.<\/p>\n","protected":false},"author":1,"featured_media":2563,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[302],"tags":[303,304],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2559"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=2559"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2559\/revisions"}],"predecessor-version":[{"id":2561,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/2559\/revisions\/2561"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media\/2563"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=2559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=2559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=2559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}