GTM User ID Tracking w/ Shopify Plus

Highlighted
New Member
8 0 0

I followed the Google documentation around User ID set up for GTM here using 1st party cookies: https://support.google.com/tagmanager/answer/4565987?hl=en

And then I added:

ga('set', 'userId', "cid");

To the "addiitonal google analytics javascript" section under online store.

The full code (with the GTM container code) looks like:

(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');

ga('set', 'userId', "cid");

Is this set up correct?

Like is this 'cid' value (which I'm assuming is the customer_id?) a function of cookies?

In other words, if userId on my site is a persistent cookie value, will the userId in checkout also be the same?

Thanks,

R

 

 

 

0 Likes