Google+ has very long User IDs
104560124403688998123
(21 characters), which is not possible to input into BIGINT field (not unsigned)
What column type would you use for such IDs ?
I do not think that varchar is good idea
What is User ID in Google Analytics? User ID is a unique set of alphanumeric characters (like 987eeetgd) assigned to a user so that he can be identified across devices/ browsers and over the course of multiple sessions.
user_id is a unique identifier that you internally associate with a certain customer. With this parameter, an advertiser can add a User ID Tag to collect User Lists that are matched to the Google cookie space without providing personally identifiable information (PII) to Google.
Click Variable Configuration > Data Layer Variable. Enter a name for the variable at the top. In the Data Layer Variable Name field, enter a name for your user ID variable (such as "user_id"). Click Save.
Start by going to the Admin view in your Google Analytics account. In the Property section, click on Tracking Info and then on User-ID.
if the length of the google id is predictable, use a static char(length)
, add an index on it and create an (internal) integer primary key. Inside of your application you map the data to the integer primary key. So if someone searches by google id, you lookup the integer primary key for this google id and do the rest of your queries with the integer primary key.
So the schema looks like:
Mapping Table:
id (integer) | google_id (char(length))
So if you create another table like comments etc, use the primary key id
, if you want to lookup all comments for a certain googleid, get the internal id first and then join the comments. This way you have only one query criteria on a static, indexed char field with a predictable length, all other joins and queries will use the integer key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With