cordova-plugin-tag-manager
cordova-plugin-tag-manager copied to clipboard
User ID
Hi Everyone,
Do you know how to configure the UserId using this plugin? I am new to GTM, and I don't know if I'll be able to achieve this using this plugin.
https://support.google.com/analytics/answer/3123666?hl=en
Best Regards, Emanuel
You can use userId with the pushEvent method. You can use pushEvent with all hits (sceen views, events, transactions...)
@jreidel cool, but, there is no documentation for this, do you have an example?
@raphagodoi In this pull you can find the doc for the pushEvent method: https://github.com/zwacky/cordova-plugin-tag-manager/blob/6d2bf4813077aa7288f606103c5c5f790e1912b4/README.md#tagmanagerpushevent
Anyone had has any success with this?
I have been able to emulate the other functions with pushEvent, but the userId doesn't work sadly. Also tried with a custom dimension1 but no success either way... This is how I have it just now.
Event Example

trackPage example

on GTM I have two new variables
and

On the GA tag Events I have:
and on Pageviews GA Tag:

Note: Just changed dimension1 from Fields to Set to Custom Dimensions and waiting for data to appear on GA to see if the custom dimension works.
Also on GA I do have User-ID feature enabled.

Thanks!.
Hello guys,
It worked sending &uid instead of userid. Keep in mind that changes to GTM containers take some time to reflect on the app(sometimes hours). Hope this helps.

Best Regards, Diego Michel.
Thanks, Diego! Excellent way of giving a solution, really appreciate you for this. You may be right, the data is not appearing immediately in User ID view of GA. It is taking lot of time to reflect.
I've a question - does this work well for both iOS and Android? The steps needed to set up GTM for Android are same as that of iOS? Can you please specify how to move ahead with Android?
Many thanks!