In this article, you’ll learn: |
About This Integration
Google Analytics 4 (GA4) is the next generation of Google Analytics that enables you to collect visitor data on your websites and apps for analytical purposes. By integrating your VWO account with GA4, you will be able to push your VWO campaign data to GA4 for further analysis.
ATTENTION: Before proceeding, you must first check the installation of the Google Analytics 4 code present on your website. If it's installed via Google Tag Manager(GTM), please follow Integrating VWO with GA4 via Google Tag Manager to set up your VWO-GA4 integration.
Enabling GA4 Integration in VWO
In order to enable GA4 integration for your VWO account and apply the integration to your campaigns, perform the following steps:
- Log in to your VWO account.
- From the left panel of your VWO dashboard, go to the Integrations page, which provides integrations that can be enabled at the workspace level. By doing so, the integrations are applied to all test campaigns in the future by default.
- Click on the Google Analytics 4 integration tile and click Enable Now.
- Once done, the Google Analytics 4 screen within the Integrations page looks like this:
If you wish to enable the Google Analytics 4 integration for your existing campaigns, select the campaign, go to Configuration > Integrations, and select Google Analytics 4.
Creating Custom Dimensions for Your Campaign Variables in GA4
Post enabling the GA4 integration in your VWO account, you need to map your VWO campaign variables (vwo_campaign_name and vwo_variation_name) in GA4 to be able to send your VWO experiment data to GA4 at the campaign level. To do so, you need to create custom dimensions in GA4 through the following steps:
- Log in to your GA4 account.
- From the main menu panel on the left, navigate to Configure > Custom definitions > Create custom dimensions.
- In the New custom dimension popup, enter the details in the following fields and click Save to create a custom dimension for mapping your VWO campaign:
Dimension name Enter the name of the custom dimension as Campaign Name Scope Select the scope as Event Description Enter a description for the custom dimension Event parameter Select the event parameter as vwo_campaign_name - Repeat the previous step with the Dimension name as Variation Name and the Event parameter as vwo_variation_name to create a custom dimension to map your VWO campaign variations.
Verifying the Integration Setup
Post mapping your VWO campaign variables in GA4, you can check if the integration setup is complete by verifying the network calls to identify the data pushed from VWO to GA4. To do so, perform the following steps:
- Right-click on the page where your test campaign is running and select Inspect Element.
- Before checking the network calls for GA4, the respective visitor must be part of the campaign. To verify it, navigate to the Application tab, where you can find the _vis_opt_exp_{CAMPAIGNID}_combi cookie that appears when the visitor has become part of the campaign.
- Under the Network tab, search for “collect” to filter the network calls for GA4.
- The network calls get populated as the page loads. You may reload the page to view the network calls.
- Select a network call to view further details.
- Under the Payload tab, scroll down to see “en: VWO”, “ep.vwo_campaign_name: <your campaign name>:<your campaign id>”, and “ep.vwo_variation_name: <your variation name>:<your variation id>”, indicating the events pushed by VWO.
Setting up GA4 Audiences for Your VWO Campaign
After mapping your VWO campaign variables, you can create your audience in GA4 based on these variables to create comparisons.
To do that, perform the following steps:
- From the main menu panel on the left, click Admin > Audiences > New audience.
- In the Build new audience popup that appears, click Create a custom audience.
- Enter a name for the audience and click Add new … > Events.
- On the search bar, enter "VWO". This populates the Create event: "VWO" option. Click on it.
- Then, add your VWO campaign name as a parameter by clicking on Add parameter. On the search bar, enter "Campaign Name". This populates the Register new definition: "Campaign Name" option. Click on it.
- In the New custom definition popup that appears, configure the definition and click Save.
- In the Campaign Name popup, select a matching condition from the Condition* dropdown, enter a value correspondingly to fetch the corresponding campaign, and click Apply.
- In the same way, add your VWO campaign variation name as another parameter (naming it as Variation Name) by referring to steps 6 and 7.
- Once done, click Save.
- The newly created Audience gets populated in the Audience dashboard. It takes between 24 to 48 hours, in general, to populate the data in the Audience. Post that, you can view your audience reports by double-clicking on them.