Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In

Integrate Google Analytics 4 (GA4)

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

🚧

Important

Starting July 1, 2023, GA4 will replace standard Google Universal Analytics (UA), which will no longer process data. For more information, see Introducing Google Analytics 4 (GA4).

📘

Note

This articles describes our built-in GA4 integration option. You cannot use Google Tag Manager (GTM) with this integration. If you prefer to integrate with GA4 using GTM, use our custom integration option.

Use this integration to track your Optimizely Web Experimentation experiments in Google Analytics 4 (GA4).

Prerequisites

  • An existing account with Google Analytics 4.
  • Create a new GA4 property, add a data stream, and set up data collection. See Google's documentation.

Enable the integration

To enable the built-in GA4 integration in Optimizely Web Experimentation:

  1. Go to Settings > Integrations.
  2. Click Google Analytics 4.
  3. Toggle the integration On and click Accept.
  4. If you want to enable the built-in GA4 integration for all new experiments by default, select that checkbox.
  5. Click Save.

Add the GA4 integration to an experiment

Once you enable the built-in GA4 integration in your account, it will display as an option on the Integrations page of your experiments.

If you selected the Enable the Google Analytics 4 integration by default for all new experiments checkbox (see step 4 above), the Tracked checkbox will be selected by default for all experiments you create going forward. It will not be selected for existing experiments.

📘

Note

If you did not select to enable the built-in GA4 integration by default for new experiments, you must select the Tracked checkbox on each experiment for which you want to send data to GA4.

Once you enable the integration within your experiments, your data begins sending to GA4. For information on creating segments with your Optimizely Web Experimentation data in GA4, see this article.