Set Client ID to Custom Dimensions in GA4(2025) | BCS Set Client ID to Custom Dimensions in GA4(2025) | BCSBCS

Set Client ID to Custom Dimensions in GA4(2025)

Google Analytics BCS 2 years ago (2023-01-16) 2551 Views 0 Comments

Update time: January 17, 2025

This section introduces how to Set Client ID to Custom Dimensions(aka:User Properties, User Scope Custom Dimension) in GA4.

Step 1 : Get Client ID

GA4 will store the Client ID in the first-party Cookie _ga, as follows:Set Client ID to Custom Dimensions in GA4(2025)

In GTM, click「Variables」——「New」——「Choose a variables type to begin setup…」——「1st Party Cookie」,Name it “cookie_ga”, and make the following settings:Set Client ID to Custom Dimensions in GA4(2025)

Then create another variable, click「Variables」——「New」——「Choose a variables type to begin setup…」——「1st Party Cookie」,Name it “Client ID-cookie”, and make the following settings:

Set Client ID to Custom Dimensions in GA4(2025)

For more ways to get Client ID, further reading: How to Get Client ID to Variable in GTM?

 

Step 2 : Set up Custom Dimensions

Secondly, create a Google Tag: Event Settings variable in GTM and set it in “Google Analytics User Properties” as follows (If you have already created Google Tag: Event Settings, add client_id settings in Property Name):Set Client ID to Custom Dimensions in GA4(2025)

Name it “Common Event Parameter”.

Next, set the variable Common Event Parameter to the Event Settings Variable in the GA4 basic page tracking code(Note that this setting is in the GA4 base page tracking code.), such as:

Set Client ID to Custom Dimensions in GA4(2025)

 

Step 3 : Preview and Release

Finally, preview testing and release:Set Client ID to Custom Dimensions in GA4(2025)

The test is as expected and can be released and data collected.

Read  More:

 

Step 4 : Custom Definitions

This custom dimension also needs to be registered in Custom definitions before it can be used. Create a custom dimension as follows in Custom definitions:

Set Client ID to Custom Dimensions in GA4(2025)

Step 5 : Verify data in Real-time Report

Generally, after 24 hours, we can see the data in GA4, such as:

Set Client ID to Custom Dimensions in GA4(2025)


If you don't understand, You can leave a comment below.
Like (1)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website