Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client ID converter #10

Open
zwetan opened this issue Oct 9, 2015 · 1 comment
Open

Client ID converter #10

zwetan opened this issue Oct 9, 2015 · 1 comment
Milestone

Comments

@zwetan
Copy link
Owner

zwetan commented Oct 9, 2015

we need a little utility function to convert from/to Client ID coming from analytics.js

see Client ID

The Client ID should be a random 64 bit integer. Historically, Google Analytics has separated its clientID into two 32-bit, unsigned, base-10 parts: 123456789.123456789. The measurement protocol supports larger UUIDs including alpha numeric characters.

@zwetan
Copy link
Owner Author

zwetan commented Oct 9, 2015

cookie to hex

123456789.123456789

split on the dot
var a:uint = 123456789;
var b:uint = 123456789;

convert to hex
ahex = "75BCD15"
bhex = "75BCD15"

final result should be
ClientId = "75BCD15-75BCD15"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant