Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceRecipesChangelogUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Create segments for Google Analytics 4 (GA4)

Use Google Analytics 4 (GA4) to capture and analyze traffic data across your websites and applications.

📘

Note

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

Prerequisites

Before creating segments within GA4, you must configure an integration between Optimizely Feature Experimentation and Google Analytics 4 (GA4). For information on configuring this integration, see Configure Google Analytics 4.

📘

Note

It can take up to 48 hours before values become available in Google Analytics 4 (GA4) so that you can create dimensions and segments with them.

Create segments in GA4

Complete the following steps to create segments for Optimizely Feature Experimentation in GA4:

Create custom dimensions

  1. Go to Configure > Custom definitions > Create custom dimensions.

    create custom dimensions
  2. Complete the following fields on the New custom dimension page:
    a) Dimension name – Enter your desired name (such as Optimizely FS Flag).
    b) Scope – Ensure this is set to Event.
    c) Description – Enter an optional description.
    d) Event parameter – Select Flag.

    configure custom dimension
  3. Repeat steps one and two for Rule.

    configured rule dimension
  4. Repeat steps one and two again for Variation.

    configure variation dimension

Create an exploration and add segments

  1. Go to Explore and select an exploration type (for example, Free form).

    select exploration type
  2. In the Variables panel, click + for SEGMENTS.

  3. On the Build new segment page, in the Create a custom segment section, click User segment.

    create user segment
  4. Enter the name of the segment (specifying the specific flag, rule, or variation for which you are creating this segment).

  5. Expand the Add new condition drop-down list and click Custom > Optimizely FS Flag.

    add new condition
  6. Click ADD FILTER.

  7. Ensure the Condition is set to contains and then select the flag, rule, or variation for which you want to create the segment. The following image shows an example for Optimizely FS Flag:

    set contains condition
  8. Click SAVE AND APPLY.

  9. Repeat steps two through eight for Rule.

    set contains condition for rule set contains condition for rule
  10. Repeat steps two through eight for Variation.

    set contains condition for variation set contains condition set variation condition