Upate GA Code to include Remarketing DoubleClick Cookie

Highlighted
Shopify Partner
7 0 0

Good opportunity for someone to write an app and make some $$$

0 Likes
Highlighted
Trailblazer
216 1 108

PS. Looks like Shopify slipped in the double click tracking in enhanced ecommerce Google Analytics tracking. 
 

Additionally I believe (cannot confirm) that Google can use the Enhanced ECommerce tracking the same way as these adwords/google tag snippets to track when your products are viewed and such. 

So this may no longer be an issue....but requires more investigating.

0 Likes
Highlighted
New Member
2 0 1

Thanks for the code, I'm just having a small issue.  It does not create the ecomm_prodid properly:

a) on product pages (example)

ecomm_prodid: 'shopify_DE_391703451_917737319,shopify_DE_391703451_948668791'.split(",").shift(),

b) in cart (example)

ecomm_prodid: ['shopify_DE_391703451_917737319,shopify_DE_391703451_948668791,'.split(",").shift()],

 

Any suggestion how to solve?

1 Like
Highlighted
Tourist
5 0 2

The problem I'm running into is that if you're using Google Shopping app and Enhanced Ecommerce from Shopify, the Google Shopping id is never properly sent to Google.

Here is my example:

Custom Code:

<script>
var google_tag_params = {
  ecomm_prodid:'shopify_US_373098837_968528461,shopify_US_373098837_968528465,shopify_US_373098837_968528469'.split(",").last(),
  ecomm_pagetype:"product",
  ecomm_totalvalue:"36.00"
};

var google_conversion_id = 968589656;
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;
</script>
<script type="text/javascript" src="//;
However, I believe Shopify's own code (seen below) is preempting this:
<script type="text/javascript">
...

window.ShopifyAnalytics.lib.track(
          "Viewed Product Details",
          {"id":968528461,"name":"Mint and Pink / Small","price":"36.00","currency":"USD","nonInteraction":true}
        );

...
</script>
This causes "968528461" to be sent instead of "shopify_US_373098837_968528469" which results in an "error product id not found" Anyone have similar experiences or a solution?
0 Likes
Highlighted
New Member
1 0 0

As a marketer with limited dev skills, I appreciate the detail you've provided.  I'm giving it a try (fingers crossed) that it will allow for the retargeting to work. If I enter the code you supplied do I need to somehow turn off the Google Analytics code under Settings > General?

Thanks,

 

0 Likes