This section refers to a deprecated version of the product. The new version is FE&R. To access FE&R, contact your CSM.
šŸ“˜ To learn more, read the FE&R documentation.
LogoLogo
PlatformsPricingRessources
  • User documentation
  • Onboarding
  • Help Center
  • Release Notes
  • Flagship - Deprecated
  • Feature Experimentation & Rollout (ex-Flagship) is evolving!
  • GETTING STARTED
    • šŸ‘‰Managing multiple environments
    • Using the trial version of Flagship
  • First steps with Flagship
    • Quick start guide
    • Glossary
  • Implementation
    • Sending transactions from the AB Tasty Shopify app directly to Feature Experimentation & Rollouts
  • Integrations
    • Heap Analytics integration (Push)
    • Tealium AudienceStream (receive audiences)
    • FullStory integration (segment exports)
    • Heap Analytics integration (Pull)
    • Google Analytics integration (pull audiences)
    • Segment Integration (receive traits)
    • Mixpanel integration (cohort exports)
    • šŸ‘‰Retrieving your third-party tools’ audiences in AB Tasty - Feature Experimentation & Rollouts
    • Zapier integration
    • Segment integration
  • Steps configuration
    • šŸ‘‰Configuring Sequential Testing Alerts
    • šŸ‘‰Configuring your Flags
    • šŸ‘‰Using the scheduler
    • šŸ› ļø[Troubleshooting] How to target a large number of users at the same time?
    • šŸ‘‰Configuring KPIs
    • šŸ‘‰Using the automatic rollback option
    • šŸ‘‰Targeting configuration
    • šŸ‘‰Dynamic allocation
    • šŸ‘‰Traffic allocation
  • Team
    • Access Rights, Teams & User Management
    • šŸ‘‰Defining rights per project
  • DEMO
    • AB Tasty - Feature Experimentation & Rollouts Demo - How to use it
  • Navigating the interface
    • šŸ‘‰Archiving use cases from the dashboard
    • šŸ‘‰Flags page
    • šŸ‘‰Running a search on the dashboard
    • Navigating the Flagship interface
  • REPORTING
    • šŸ‘‰Verifying your hit setup
    • šŸ‘‰Exporting reporting data
    • Understanding the "Chances to win" indicator
    • šŸ› ļø[Troubleshooting] How can I know my test is reliable and my data significant enough to be analyzed?
    • Reporting - A/B Test
    • šŸ‘‰Using the reporting filters
  • API keys & Settings
    • šŸ‘‰Acting on your account remotely
    • šŸ‘‰Using Experience Continuity
    • visitor experiment option
  • FEATURES SETUP
    • šŸ‘‰Bucket allocation
  • SDKs integration
    • šŸ‘‰Managing visitor consent
    • šŸ‘‰Understanding the use of SDKs
  • FAQ
    • Can I make a comparison for each reporting?
    • Can I use Flagship even if my SDK stack is not available?
  • Platform integration
    • šŸ‘‰Webhooks page
  • Decision API
    • Decision API for non-techie users
  • Account & Profile
    • šŸ‘‰Configuring account restrictions with MFA
    • šŸ‘‰Configuring a FA on your profile
  • RELEASE NOTES
    • October - Flagship becomes Feature Experimentation & Rollouts
    • February - Release Notes
    • šŸ“…January - Release Notes
    • šŸŽ‰December - Release Notes šŸŽ‰
    • 🦃November - Release Notes
    • September Release Notes šŸŽØ
    • June Release Notes šŸž
    • šŸøMay Release Notes ā˜€ļø
    • Flagship Release Notes April šŸ‡
    • Flagship February release notes šŸ‚
    • Flagship January release notes šŸŽ‰
    • Flagship November release notes 🦃
    • Flagship October Release Notes šŸŽƒ
    • Flagship September Release note šŸŽ’
    • Flagship August Release Notes 🐬
    • Flagship Release Notes July ā˜€ļø
    • Flagship Release notes June 🌻
    • Flagship Spring Release May 🌸
    • Flagship Release Notes: Fall
  • Use cases
    • šŸ‘‰Duplicating a winning variation
    • šŸ‘‰Configuring a Feature Toggle/Flag
    • šŸ‘‰Configuring an A/B Test
    • šŸ‘‰Configuring a Progressive rollout
    • šŸ‘‰Configuring a Personalization
  • VIDEO TUTORIALS
    • [Video Tutorial] AB Test
    • [Video Tutorial] Feature Flag
    • [Video Tutorial] Progressive Deployment
Powered by GitBook
LogoLogo

AB Tasty Website

  • Home page AB Tasty
  • Blog
  • Sample size calculator
  • Release note

AB Tasty Plateform

  • Login

Ā© Copyright 2025 AB Tasty, Inc, All rights reserved

On this page
  • Google Analytics integration (pull audiences)
  • Create the credentials on Google Cloud Platform
  • Access a GCP project
  • Activate the Google Analytics 4 API
  • OAuth credentials
  • Give Google Analytics access rights to your OAuth Credentials
  • Enable the integration on Flagship
  • Configure the custom definition on Google Analytics 4
  • Congratulations, integration is now setup and you can target your Google Analytics 4 Audiences with Flagship!

Was this helpful?

Edit on GitLab
Export as PDF
  1. Integrations

Google Analytics integration (pull audiences)

Google Analytics integration (pull audiences)

Google Analytics is an analytics service that enables you to measure traffic and engagement across your websites and apps. Google Analytics 4 is the latest version of Google Analytics.

The Google Analytics 4 integration allows you to receive the audience created in Google Analytics and to target them with AB Tasty.

⭐ Good to know: Google Analytics 4 Audiences

Audiences are groups of users defined by a chosen set of criteria. Dimensions, metrics, and events can be used to segment practically any subset of users.

To achieve Google Analytics 4 audiences targeting, you need to push the Flagship Visitor ID in a user property for every session.

Our integration will then list the value of this user property for the different existing audiences through Google Analytics’s API. Then audiences and their composition are pushed to Flagship at the beginning of the next day.

Thus, the Google Analytics 4 integration set up process is taking place on several platforms :

  • Google Cloud Platform: to create the credentials to access Google Analytics data.

  • Google Analytics 4: to set up the collection of the Flagship Visitor ID

  • Flagship: to effectively set up the integration

An email account with admin access to Google Analytics 4 account is required to complete the setup

Create the credentials on Google Cloud Platform

To access Google Analytics 4 API programmatically we need to have credentials with granted accesses. Those are OAuth type of credentials and are created within the Google Cloud Platform.

Access a GCP project

  • Go to the Google Cloud Platform console

  • Select an existing project or create a new one. (Documentation to create a new project)

Activate the Google Analytics 4 API

  • In the Google Cloud Platform interface, open the console left side menu and select APIs & services

  • On the left, click Library, search for the ā€œGoogle Analytics Data APIā€ and select it. Click ā€œEnableā€.

OAuth credentials

OAuth consent screen setup

Before creating the OAuth credentials you need to check that you have an OAuth consent screen setup. If you don’t, you need to set it up (if you just created the GCP project it will be the case). The OAuth consent screen is the screen that will appear when you will give access right to your credentials.

Check the OAuth consent screen: Open the console left side menu and select APIs & services : click Credentials>Create Credentials>OAuth consent screen. If you see an app already exists here, it means the consent screen is set up and you can proceed to the next step: Oauth Credentials creation.

If there is no existing app, you will see the first step of the creation process:

  • Choose the ā€œInternalā€ option if you are a Google Workspace user, otherwise choose ā€œExternalā€. Click the create button.

  • Under App information, enter an App name. It can be something similar to the project name.

  • User support email: enter your email address (the one used to connect to GCP)

  • Developer contact information, email address: enter your email address (the one used to connect to GCP)

  • Other fields are optional, click ā€œSave and continueā€.

  • Click ā€œAdd or remove scopesā€

  • Tick the ā€œ.../auth/userinfo.emailā€ scope. Validate by clicking the ā€œUpdateā€ button.

  • Click ā€œSave and continueā€.

  • Add your email address (the one used to connect to GCP) as a test user. Click ā€œSave and continueā€.

  • You are at the summary screen, the OAuth consent screen is now ready and you proceed to the OAuth Credentials creation step.

OAuth Credentials creation

  • Open the console left side menu and select APIs & services

  • On the left, click Credentials>Create Credentials>OAuth client ID

  • Select ā€œWeb Applicationā€ as the Application type. Enter a descriptive name of your choice e.g. ā€œGA4 to Flagship Audience bridgeā€.

  • Under ā€œAuthorised redirect URIsā€ add ā€œhttps://developers.google.com/oauthplaygroundā€

  • Other fields are optional, click ā€œCreateā€ to finalise the OAuth credentials creation.

  • A confirmation message appears, it also displays the Client ID and the Client Secret of your Oauth credentials. Copy-paste and save for later (you can also download them in a json format).

Give Google Analytics access rights to your OAuth Credentials

  • Go to the Google OAuth Playground

  • Open the configuration panel and tick the ā€œUse your own OAuth credentialsā€. The ā€œOAuth Client IDā€ and ā€œOAuth Client secretā€ fields appear.

  • Fill the ā€œOAuth Client IDā€ and ā€œOAuth Client secretā€ fields with your own (saved from the previous OAuth Credentials step)

  • In the left panel, Step 1 ā€œSelect and authorize APIsā€, search for ā€œAnalytics Reporting API v4ā€ and tick the 2 items underneath ("https://www.googleapis.com/auth/analytics" and "https://www.googleapis.com/auth/analytics.readonly")

  • Click ā€œAuthorize APIsā€

  • The Google Access Right interface appears : select the account with which you have access to the Google Analytics property and then click ā€œauthorizeā€ to grant access.

  • You are redirected to the Oauth Playground, Step 2. Click ā€œExchange authorization code for tokensā€

  • ā€œRefresh tokenā€ field is now populated, copy and save the content of the field.

Congratulations you now have all the required information to set up the integration on AB Tasty interface (see next step).

For more information on Oauth Playground please refer to this documentation.

For more information on Oauth 2.O please refer to this documentation or this documentation.

Enable the integration on Flagship

  • In the Flagship integrations settings you have different field to fill in to set up the integration :

    • Property ID : it is the unique ID of your GA4 property. To retrieve your Property ID go to the Google Analytics interface and click Admin>Property>Property Settings. Property ID appears at upper right. More information here.

    • GA Measurement ID : it is the unique ID of a data stream (i.e. one of the data sources that provides data to your property). To retrieve your GA Measurement ID go to the Google Analytics interface and click Admin>Property>Data Streams> Web and choose your data stream. GA Measurement ID appears at upper right. More information here.

    • Client ID: part of the credentials to be able to access Google Analytics Data (see previous steps)

    • Client secret: part of the credentials to be able to access Google Analytics Data. Copy paste the value saved from the previous steps

    • Refresh Token: part of the credentials to be able to access Google Analytics Data. Copy paste the value saved from the previous steps

Configure the custom definition on Google Analytics 4

You need to push the Flagship Visitor ID in a user property named ā€œflagship_visitor_idā€. Naming is very important because it is what will be pushed back to Flagship.

The user property ā€œflagship_visitor_idā€ needs to be pushed for every session. This can be achieved thanks to a dedicated event for exemple.

Set the user property:

  • In the Google Analytics 4, left panel, click ā€œConfigureā€ then ā€œCreate custom dimensionsā€

  • Enter the ā€œDimension nameā€ you want to display in Google Analytics 4 e.g. ā€œFlagship Visitor IDā€

  • Select ā€œUserā€ as the scope

  • Enter a description (optional)

  • Enter ā€œflagship_visitor_idā€ as the ā€œUser property

  • Click ā€œSave

Congratulations, integration is now setup and you can target your Google Analytics 4 Audiences with Flagship!

For information on how to use the audiences, please refer to this documentation.

⭐ Good to know: Technical specifications

  • Audiences will be refreshed daily

  • The flagship_visitor_id is used to achieve user matching. It needs to be collected for every session as a user property and the naming must be respected.

  • For the audiences to be used in Flagship (once exported from Google Analytics 4), we need to match at least one user i.e. empty audiences will not be displayed.

  • For the audiences to be visible in Flagship you need to wait 24 hours after the setup of the integration. This is due to the different synching mechanisms between the tools (data collection by Google Analytics 4 and then the data import from Google Analytics 4 to Flagship).

Need additional information?

Submit your request at product.feedback@abtasty.com

Always happy to help!

PreviousHeap Analytics integration (Pull)NextSegment Integration (receive traits)

Last updated 3 days ago

Was this helpful?

For more information on how to use audiences please refer to the .

Capture_d_e_cran_2022-04-20_a__17.47.03.png
Capture_d_e_cran_2022-04-20_a__17.51.15.png
Capture_d_e_cran_2022-04-20_a__17.57.45__1_.png
Capture_d_e_cran_2022-04-20_a__18.02.53.png
Capture_d_e_cran_2022-04-20_a__18.16.00.png
Capture_d_e_cran_2022-04-13_a__12.20.45.png
credentials_organizationId_0_project_innovation-183314_organizationId_0_project_innovation-183314__1_.png
Capture_d_e_cran_2022-04-13_a__13.28.58.png
Capture_d_e_cran_2022-04-13_a__13.38.28.png
Capture_d_e_cran_2022-04-13_a__13.45.51.png
Capture_d_e_cran_2022-04-13_a__13.49.09.png
Capture_d_e_cran_2022-04-13_a__13.51.39.png
Capture_d_e_cran_2022-04-13_a__13.52.31.png
Capture_d_e_cran_2022-06-30_a__15.25.50.png
Capture_d_e_cran_2022-04-13_a__13.59.35.png
oWi6IVELOCYZB580HP3TvA5AFaZ67E7Tt3UD.png
Google Analytics 4 documentation