Setting User ID to a custom value in GUA

Bronze Contributor
Bronze Contributor

Hi,

 

I'm currently using Google Universal Analytics tag to implement GA on my website. I'd like to update/modify the client ID that GA captures to a value that I retrieve from an alternate source.

 

It's a functionality available on GA, see below, I'd like to implement the same functionality using Tealium's GUA tag. Is it possible? If yes, how do I implement it? 

 

Thanks in advance,

Manish

 

// At a later time, once the `userId` value is known,
// sets the value on the tracker.
ga
('set', 'userId', USER_ID);

 

1 REPLY 1

Setting User ID to a custom value in GUA

Moderator
Moderator
Hi @Manish,

You reference Client ID, but the code snippet shows User ID. Both are supported by the Tealium GUA template via the mapping toolbox. User ID is used for Google's version of cross-device identification for users (so you would pass, for example, email address to this mapping), whereas "clientId" is the randomly-generated ID generated by GA and stored in the _ga cookie. The main use case for forcibly setting this value would be for tracking a single session across multiple domains, using the same GUA property ID.

In the mapping toolbox, the value called "UID" represents the User ID, and the value called Client ID (clientId) represents the Client ID.

Best regards,

Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Public