how to create cid (unique client)

816 views
Skip to first unread message

Aman Kumar

unread,
Dec 30, 2014, 8:28:55 AM12/30/14
to google-analytics-m...@googlegroups.com
Hi All,

How to create unique  cid (unique client only first time) .

Math.round(2147483647 * Math.random()) generating unique id every time please give me any other solution.

http://www.google-analytics.com/collect?v=1&tid=UA-123458-2&cid=124545457486352&t=pageview&dl=/gatest.jsp 

reply asp.

thanks Regards
Aman

Philip Walton

unread,
Dec 30, 2014, 1:52:02 PM12/30/14
to Aman Kumar, google-analytics-m...@googlegroups.com
analytics.js does something like this following to create it's client ID:

var cid = Math.floor(Math.random() * 0x7FFFFFFF) + "." + Math.floor(Date.now() / 1000);

--
You received this message because you are subscribed to the Google Groups "google-analytics-measurement-protocol" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-measure...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages