AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.9K members online now
1.9K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Want Source code to implement user id or client id.

Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Hi All I have problem of using user id code for cross device implementation.

I have used this code for to enable user id

  ga(set, userId, 1234);

do let me this code is right or wrong.

in case my code is wrong then please give me other example for the same.

Want Source code to implement user id or client id.

Participant ✭ ☆ ☆
# 2
Participant ✭ ☆ ☆

Hi Riyaj

in your case 

ga('set', 'userId', '1234') 

should work.

Note that you have to create tracker first with ga('create', 'UA-XXXX-Y') function