UserId Not Tracking Using Google Tag Manager & Angulartics

998 views Asked by At

I'm trying to implement GA tracking via Google Tag Manager for a site using Angular 1.5 through Angulartics.

I'm on the analytics side and working with our developers on this has been a struggle, since they don't know anything about the tracking and I am a doofus re Angular requirements.

I've set up to track userid using the github instructions, and in GTM the way i've done so for other (non Angular) sites, but my userid as a custom dimension isn't passing through to GA. ANY help would be appreciated to get this figured out - I know I'm missing something!

GTM userid set up

1

There are 1 answers

0
snowykz On BEST ANSWER

With angulartics and angulartics-gtm, you can use the dataLayer directly by

window.dataLayer.

So instead of using the setUserProperty for angulartics. You can just use the dataLayer to populate a userId.

window.dataLayer.push({'userId':'123abc'});

And in GTM just read that dataLayer into a variable and use it.