简体   繁体   中英

UserId Not Tracking Using Google Tag Manager & Angulartics

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM