Note:This article uses collection of User ID to the user.Id
field as an example of how all three — user.Id
, userEmail
, and userPhone
— fields are being collected and updated by OWOX BI.
What is User ID and why you need it
User ID is a unique user identifier that lets you associate hit data from different sessions and devices with this one unique user. This data helps you better understand each user’s interaction with your website.
Collecting User ID data into hit data tables
In hit data tables, user identifiers are stored in the userId
field. The field contains the &uid
parameter values from the requests that send Google Analytics data from your website.
Collecting User ID data into session data tables
In session data tables, user identifiers are stored in the user.Id
field. OWOX BI sends this data to BigQuery in a &uid
parameter in the tracking code.
Please note:If your Google Analytics → Google BigQuery pipeline is still using the deprecated session data collection method based on Google Analytics Core API, then the User ID data is being sent in a &cd
parameter, a custom dimension of a User-level scope.
Additionally, if the user.Id
field values are sent in both the &uid
(User ID) and the &cd
(custom dimension) parameters, only the value of the &cd
parameter will get to the user.Id
field.
Updating historical data
OWOX BI can retroactively identify unique users who visited your site without a User ID within last 30 days and update their info in session data tables for this period. The update happens only if an unidentified user with the same Client ID logs in and gets a User ID during their next site visit.
Here’s how it works:
- You have a Client ID associated with the "null"
user.Id
value in session data tables. - During the next site visit, the user with this Client ID logs in and gets associated with a User ID.
- All the “null"
user.Id
values associated with this Client ID in sessions will be rewritten getting the value from the new User ID. - These updates happen daily and affect the data in session data tables for last 30 days.
- The updates don’t affect non-”null”
user.Id
values.
Example:
- Session 1 —
clientId
: 35009a79 —user.Id
: NULL - Session 2 —
clientId
: 35009a79 —user.Id
: as8knl
Here, in the first session, the user wasn’t logged in. For the second session, the same user (identified by Client ID) logged in and become associated with a unique User ID "as8knl".
With the next data update, the "NULL" user.Id
value from the previous session will be retroactively replaced with the “as8eknlll” value from the second session associated with this Client ID.
However, this will happen only if the previous session happened within 30 days before the second one.
Another example:
- Session 1 —
clientId
: 35009a79 —user.Id
: as8knl - Session 2 —
clientId
: 35009a79 —user.Id
: rb451f
Here, in the first session, the user with a Client ID “35009a79” was associated with the User ID “as8knl”. For the second session, the same Client ID was logged in with another User ID — “rb451f”. In this case, UID1 in previous sessions will not be replaced with “rb451f”.
Basically, this one Client ID will be treated as two different users, one for each session.
Please note:If your pipeline uses the deprecated session data collection method based on Google Analytics Core API, the user.Id
field is being updated only when you use a custom dimension (&cd
) to collect User ID values. Due to GA Core API limitations, the User ID values sent in the &uid
parameter can’t be updated retroactively.
Recommendations for setting up passing the User ID parameter to the 'owoxbi_sessions_' tables
To upload the user.Id
parameter data via Google Tag Manager, you need to create a user-defined variable that will generate the user.Id
parameter value. After that, go to your tag settings and in Fields to Set select user.Id
as Field name:
In the Value field, set the variable that generates the user.Id
value.
How to setup sending User ID values in a custom dimension
Note: This guide is relevant only to the deprecated session data collection method based on Google Analytics Core API.
We recommend you using the OWOX BI algorithm. With it, the User ID data is being sent directly from the BigQuery hit data tables, so you won't need any custom dimensions as workarounds — you get all User ID values in the &uid
parameter. Read more about the benefits of the new algorithm in this article or write to us at bi@owox.com and we'll connect the new algorithm to your pipeline.
The standard Google Analytics algorithm doesn’t reveal user identifiers at the session level, but it does reveal custom dimensions and metrics. This makes sending User ID parameters in a custom dimension the only way to collect User ID data at the session-level.
Step 1. Create a custom dimension in Google Analytics
1. On the Admin page, find the Custom definitions block and click Custom dimensions:
2. Click New custom dimension:
3. Add the dimension name, set the Scope to User, and click Create:
Step 2. Add the custom dimension in OWOX BI
1. In OWOX BI, go to the Settings tab in your Google Analytics → Google BigQuery pipeline.
2. In the Session data collection block, make sure you have the Based on Google Analytics option selected, and click Edit settings:
3. In the Select User ID drop-down list, select the custom dimension you have created:
That’s it. Now you get User ID values in the created custom dimension.
0 Comments