The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.
Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Integrate Google Analytics 4 audiences

How to import your Google Analytics 4 (GA4) audiences to Optimizely Web Experimentation.

📘

Note

This is a third-party integration and is not an Optimizely subprocessor. See Optimizely's Third-Party Add-Ons & Platform Integration Terms.

Watch the video or use the interactive demo to learn about this feature.

Prerequisites

  • An Optimizely Web Experimentation account.
  • An existing Google Analytics 4 property.

Connect GA4 with Optimizely Web Experimentation

  1. Go to Settings > Integrations > Google Analytics 4 Audience Targeting.

  2. Toggle the integration status to On and click Accept on the Add-On Platform Terms of Service page.

  3. Click Sign in with Google and enter the required information to connect Optimizely Web Experimentation with your Google account.

  4. If prompted, select all options to grant Optimizely access your Google Account. Click Allow.

  5. Click Edit next to Settings. Enter your 9-digit Google Analytics Property ID. See Google's documentation for help locating your property ID.

  1. Select your Google Analytics ID Type, which retrieves the User ID or Device ID stored in GA4. This is dependent on your GA4 configuration:

    • If you do not bring your own identifiers to GA4, choose Device ID, the default option. The integration automatically retrieves the _ga cookie ID. You do not need to add any custom code for this ID type.
    • If you bring your own identifiers to GA4, choose User ID and input your Google Analytics User ID in the field. The Google Analytics User ID is a function name, such as user_id, that retrieves your GA User ID. You must add custom code directly on your page or in Project JS.

  2. Click Save.

Target experiments using GA4 audiences

After connecting GA4 to Optimizely you can target experiments using GA4 audiences:

  1. Go to Audiences > Create New Audience.

  2. Enter the audience Name.

  3. Expand Google Analytics 4.

  4. Drag and drop your GA4 audience to the Audience Conditions section.

  5. Configure the audience as desired using the drop-down list.

  6. Click Save Audience.

See Target audiences using the Audience Builder for information on configuring audiences.

GA4 audience limitations

The Google Analytics 4 (GA4) Audience Export API enforces privacy thresholds that restrict certain audience exports. Audiences using Age, Gender, or Interests dimensions are ineligible for export. This is a GA4 limitation, not an Optimizely issue.

If your GA4 audience uses any restricted dimensions, Optimizely cannot sync that audience, and No visitors are bucketed into experiments targeting that audience.

Restricted and supported dimensions

The following table shows which dimension types GA4 supports for audience export:

Dimension typeEligible for audience exportNotes
Events (for example, purchase)YesBehavioral data is supported.
Page viewsYesContent-based dimensions are supported.
User IDYesSupported when not combined with restricted demographics.
AgeNoClassified as potentially thresholded by Google.
GenderNoClassified as potentially thresholded by Google.
InterestsNoClassified as potentially thresholded by Google.

To resolve restricted audience dimensions, remove any Age, Gender, or Interests filters from your audience definition in GA4. Use behavioral or event-based dimensions instead.

For information, see Google's Data API limits and quotas.

Timing Considerations

Consider the following with this integration:

  • GA4 has a data processing delay of up to 48 hours from the time the data was collected. It can take up to two days for a new user to be registered as part of an audience in GA4.
  • The list of active users in a GA4 audience is updated by Optimizely daily. It can take up to one day for new users to be qualified in an experiment when targeting a GA4 audience.