The Google Analytics (GA) integration enables you to drill through your Google Analytics data to see your users' actual experience. In this article, you'll find a guide on setting up the two features available with this Google Analytics integration.
Note: This integration does not support implementations of Google Analytics through Google Tag Manager (GTM) and other tag managers. If GA is being added through GTM, the integration will not work. Google Analytics must be added to your website code directly, not through a tag manager, in order to benefit from this integration.
Requirements before you start using the integration
Before getting started, be aware of the following:
- An existing Google Analytics setup is required. See Google's Get started with Analytics article for help with this.
- If GA is being added through Google Tag Manager, the integration will not work. Google Analytics must be added to your website code directly, not through a tag manager, in order to benefit from this integration.
- Google Analytics Goals are not supported - they featured in Universal Analytics, which was retired on July 1st, 2023.
- This integration only works when events are created in GA. If events are created in GTM or elsewhere and passed to GA, these events will not be detected.
Creating Events from Google Analytics Events
1. Click 'Connect for Google Analytics' in the Integrations page.
2. Turn on 'Automatically create events'.
Google Analytics Events will start to be captured and attached to session data used in replays and Heatmaps. You may need to allow some time to pass before captured Google Analytics Events appear in the Events filter.
3. Use GA events to filter session data and target Surveys.
How to use Google Analytics events in segmentation
You can use the 'Add filter' option in your platform capabilities to apply Google Analytics events, for example Session Replay.
Follow these steps to use Google Analytics events in Session Replay:
1. Click on 'Add filter'
2. Select 'Google Analytics'.
A window will appear, allowing you to select your Google Analytics events.
Targeting Surveys using Google Analytics Events
1. From the Targeting Settings of your Survey setup, select ‘Specific Pages’.
2. Choose Event from the dropdown menu.
3. Enter GA_ followed by the Google Analytics Event name as the value for the Event targeting field.
4. Click 'Done' and Activate the Survey.
Find replays of users identified in Google Analytics
This section covers the initial setup of this feature, which requires some configuration inside Google Analytics. For details on using this feature, see the using this feature section below.
1. Visit the Google Analytics Admin page, click 'Data display' in the sidebar, then click 'Custom definitions.'
2. Click 'Create custom dimensions' and define its properties.
To define the custom dimension properties, enter the following in the New custom dimension overlay:
- Dimension name: hjuid
- Scope: User
- Description: Contentsquare User ID
- User property: hjuid
Select hjuid if it exists. Otherwise, manually type it in.
3. After entering the custom dimension properties, click ‘Save’.
4. Create a ‘User explorer’ visualization.
If you don't have a User explorer visualization, you can create one by visiting your Explore page in Google Analytics and clicking on Template gallery. In the Template gallery, select the User explorer template. For further help with creating a User explorer visualization, see the Google Analytics guide on how to create a user explorer page.
5. Visit your Integrations page and enable the Google Analytics integration.
If the Google Analytics integration is not already enabled, visit your Integrations page, select your Site from the dropdown menu, then click 'Connect for Google Analytics'.
6. Enable Automatically share user IDs, and click 'Save'.
Using this feature
Note: After enabling the Google Analytics integration, you may need to wait for Google Analytics to receive user IDs. If you try to follow the Using this feature section below, before the user IDs have been updated in GA, you may not find the detect_user property in the User explorer.
1. Visit your Google Analytics Explore page, then open the User explorer visualization created earlier.
2. Open the User activity tab by clicking on one of the GA User Ids in the User explorer 1 tab.
If no results are appearing in the User explorer 1 tab, similar to what is shown below, then you might need to adjust your date range filter.
3. In the User activity tab, click the detect_user event, then copy the hjuid.
4. Go to Session Replay and click 'Add filter'.
5. Select the user ID filter, then paste the hjuid copied from Google Analytics and click 'Apply'.
6. This will filter your replays list by sessions that were captured for the user you've identified from Google Analytics.