cdp menu

Customerlabs CDP Documentation

CustomerLabs + Google Analytics (GA4) Integration

You are here:

CustomerLabs + Google Analytics (GA4) Integration

Google Analytics helps you to identify patterns and trends in how visitors engage with your website. With CustomerLabs integration, you can use the details to understand goal conversions, funnel, attribution and to build your audience and plan your campaigns.

Browser Side

1. Log in to your Google Analytics Account

2. Select the account to be integrated

3. Under Admin in the account, Create new Property

Create New property in GA4

4. After creating new Property, click “Data Stream” under that

5. Click “Add stream” -> Select “Web”

Add new data stream

6. Open the recently added Data stream & Copy the “Measurement ID”

Copy Measurement ID

7. Log in to your CustomerLabs Account

8. Navigate to the “Destinations” page from the Menu

9. Search and select Google Analytics gtag

Select Google Analytics gtag

10. Click on “Subscribe” and then on “Configuration Settings”

11. Paste the “Measurement ID” copied in the “Website Tracking ID” box

Paste the Tracking ID

Server Side

1. In your Google Analytics account, Click the new Data stream and then Go to “Measurement Protocol API Secrets” screen

2. Create a secret by clicking on the “Create” button and give a nickname to it

3. Copy the “Secret value” generated

Copy the secret value API

4. Go to your CustomerLabs Account

5. Turn on the toggle for “Enable GA4 Measurement Protocol” under Advanced Settings in the GA4 configuration settings

6. Paste the secret value copied in the “API Secret” box below

Enable Measurement Protocol

Consent Mode V2

Google has updated the consent mode (V2) settings to help advertisers adhere to EU consent policy for use in ad personalization. 

You can view the consent mode status in your Google Analytics (GA4) account → Data Streams → Click on the data stream → Consent settings

Google Analytics GA4 settings in data streams showing consent settings of ad measurement consent signals, ads personalization consent signals and verify data consent settings

If you’re receiving the consent details, this will be displayed as shown below

Ads Measurement consent signals active in GA4 after integration with CustomerLabs CDP

Ads personalization consent signals active after customerlabs cdp integration with GA4

If your users are from the European Economic Area, you have to pass the end-user consent choices to Google. 

Based on the consent choices provided by the users, Google dynamically adjusts the storage and usage of the user’s data for ads, analytics or modeling. 

We have given an update to our Google Analytics integration where you can easily set up this Advanced consent mode within a few simple steps.

Here are the steps to set up consent mode for Google Analytics:

1. Navigate to Destinations → Google Analytics gtag → Configuration Settings → Consent mode Configuration

2. Turn on the toggle below that.

Consent mode configuration toggle on in customerlabs cdp app

3. For Google Analytics, you have to pass the consent received from the user through three parameters based on the purpose of usage. They are

  • Analytics storage
  • Ad user data
  • Ad personalization

Learn more about consent mode parameters and their definitions

4. If the user has not initially chosen their consent preferences through the banner displayed, Google recommends setting default values for each of the consent parameters. 

For this, you have to set the default values to be stored and/or sent using the drop-down as shown.

CustomerLabs CDP app showing consent signals ad user data, ad personalization and analytics storage granted

5. a. If you’re using a Google-certified Consent Management Platform (CMP), the default values initialization for the consent parameters are taken care of by the CMP.

5. b. If you’re not using a CMP, you should turn on the toggle for “Client Side Consent Initialization” for CustomerLabs to initialize default values for the consent parameters as described in step 4.

Note: If you’re using a CMP and still want to initialize default values from the CustomerLabs side, you can still turn on the toggle

Client side consent initialization toggle on for implementing consent mode v2 through Customerlabs CDP

6. After setting all this up, click “Save Changes”

For collecting the consent preferences from your user, you might use a cookie banner supported by a Consent Management Platform (CMP) or a banner that was built by you.

When a user updates the consent preferences through your banner, the information is stored and this information should be passed onto CustomerLabs to update the consent preferences in our system.

If you’re using Google Certified CMP and the CMP pushes the details to dataLayer, you can pass on these parameters through GTM (Google Tag Manager). Refer to the documentation here.

This updation is important to store and transfer the consent preferences of your users (first-party data) while sending the data on the server-side (Google Measurement Protocol).

To update the consent preferences, you have to call the function _cl.trackConsent () 

Function Params

     * This function is available for end users to send consent params to update the consent
     * @function trackConsent
     * @param {object} params consent params

    "ad_user_data": "granted/denied" //granted or denied consent based on specific needs

Function example

    "ad_user_data": "granted",
    "ad_personalization": "granted",
    "analytics_storage": "denied"

list //Other params that can be added for consent 

    "ad_user_data": "granted",
    "analytics_storage": "granted",
    "ad_personalization": "granted",
    "ad_storage": "granted",
    "functionality_storage": "granted",
    "personalization_storage": "granted",
    "security_storage": "granted"

If you have difficulty setting this up using your CMP or on your self-developed banner, you can contact our support team for help.

User ID Tracking

1. To enable CustomerLabs to assign User ID for all the users which helps to unify the details of the user, Turn on the toggle for “Enable User-ID Tracking for anonymous users” in the Advanced Settings for GA4 Configuration

2. Set “Default” under “User Identify ID”

Enable user ID tracking

3. Click on “Save Changes” and then return back to Google Analytics gtag Customization screen

Enhanced Ecommerce

Enabling Enhanced Ecommerce lets you sync additional information for default e-commerce events on GA4 to generate detailed reports and gain valuable insights.

Note: You have to enable this initially while authenticating your GA4 account. If you want to enable this at a later stage, you need to re-authenticate your GA4 account and then turn this toggle on.

Event Workflow Setup

1. Click “Setup Event Workflow” from the Google Analytics gtag Customization screen

Setup event workflow

2. Turn on the toggle for all the “added_to_segment” events in the server-side callbacks.

Note: Make sure you don’t turn on the toggle for any event on both Server-side and Client-side callbacks since Google does not de-duplicate the data.

Event tracking

3. Once “added_to_segment” is switched on, this event is refreshed in Google Analytics every time the audience created in CustomerLabs refreshes.

4. Click on “Save Changes” once you are done.

5. You have now integrated Google Analytics with your CustomerLabs account. 

If you’re still facing issues, get in touch with our team by clicking on the chat icon in the lower right corner. We will set up all your events for free

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
How Can We Improve This Article?
Table of Contents
CustomerLabs gives freedom, flexibility and wings to digital marketers.
Sign Up

Schedule a 1-1 Demo


Unified data to boost ecommerce growth


Engage your customers across the funnel with a unified martech stack


Increase product metrics with a unified martech stack


Scale your customers quickly with the right data