Note:This article uses colleceting 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.

There are 2 ways to collect User ID data into the user.Id field in session tables:

1) sending User ID data in a &uid parameter in the tracking code, which is a standard way

2) sending User ID data in a custom dimension at the User scope

Please note: The user.Id field gets values sent from both the &uid (User ID) and the &cd (custom dimension) parameters. If both these parameters contain a value, the priority will be given the &cd parameter value.

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:

  1. You have a Client ID associated with the "null" user.Id value in session data tables.
  2. During the next site visit, the user with this Client ID logs in and gets associated with a User ID.
  3. All the “null" user.Id values associated with this Client ID in sessions will be rewritten getting the value from the new User ID.
  4. These updates happen daily and affect the data in session data tables for last 30 days.
  5. 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: The user.Id field is being updated only when you use a custom dimension (&cd) to collect User ID values. Due to Google Analytics Core API limitations, the User ID values sent in the &cd parameter can’t be updated retroactively.

Why you need a custom dimension to update historical User ID data

OWOX BI lets you collect session data using one of these two ways:

(More about the differences between the two sessionization algorithms — in this article.)

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.

However, if you collect session data using the OWOX BI algorithm, the User ID data is being sent directly from BigQuery tables, so you don’t need to create custom dimensions as workarounds — you get all User ID values in the &uid parameter.

Summing up, to update historical data you need whether

  • use the OWOX BI algorithm to collect session data

or

  • setup a custom dimension for sending User ID values.

How to setup sending User ID values in a custom dimension

Step 1. Create a custom dimension in Google Analytics

1. On the Admin page, find the Custom definitions block and click Custom dimensions:

Admin - custom definitions

2. Click New custom dimension:

New custom dimension

3. Add the dimension name, set the Scope to User, and click Create:

custom dimension settings

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:

Google analytics settings data collection

3. In the Select User ID drop-down list, select the custom dimension you have created:

GA custom dimension user id session data

That’s it. Now you get User ID values in the created custom dimension.

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.