What: When using Google Analytics (GA) in tandem with Google Tag Manager (GTM), events have to be communicated through Tag Manager. To do this, you will first need to set up a BlueConic Google Tag Manager connection. Next, you will also need to configure Tag Manager and Google Analytics. This article walks you through the steps of getting user BlueConic segments into Google Analytics.
Why: You want to send BlueConic profile properties or segments to Google Analytics, and the Google Analytics tags on your website are served by Google Tag Manager. As a result of this combination of platforms, BlueConic cannot communicate directly with GA the way it normally would. Instead, communication with Google Analytics has to go through Google Tag Manager.
Note: You can use the Google Tag Manager connection with both Google Analytics 3 and Google Analytics 4 (GA4). Note that there are differences on the Google Analytics side for how GA4 tags are set up in Google Tag Manager and in how you set up GA4 to receive the data from Google Tag Manager. To learn more about how to set up tags in Google Tag Manager for GA4, visit the Google Tag Manager documentation.
This document only covers the combination of Google Tag Manager and Google Analytics. If you are not using Tag Manager to serve the Google Analytics tag, this document is not for you. Set up a Universal Analytics connection instead.
Summary
In this document, we be will setting up BlueConic to send information about the segments a profile is part of through Tag Manager to Google Analytics. You will need a BlueConic account authorized to set up a connection, a Tag Manager account, and a Google Analytics account.
For each page view, BlueConic will send a BlueConic specific event using the Google Tag Manager data layer.
When Tag Manager receives the BlueConic event, this will trigger a tag. We will show you how to set up the trigger and tag. The tag and trigger require a number of variables that we will also help you to set up in Tag Manager. Once these things have been configured, the tag will then pass on the data to GA automatically.
After completing this walkthrough and testing the connection, you will have a feel for how data flows from BlueConic via Tag Manager to Google Analytics. You can then tune the setup to match your own requirements.
To recap: BlueConic will trigger a Tag Manager tag that sends data to Google Analytics. This setup is glued together by a number of variables.
BlueConic Settings
- If you don't already have a Google Tag Manager connection in BlueConic, go to the "Connections" tab, click "Add connection" and add a Google Tag Manager connection.
- On the "Setup" tab, verify the name of the data layer. This should be dataLayer (case sensitive), unless you use a custom data layer name on your website:
- Activate and select the export goal: "Export data into Google Tag Manager".
- Map BlueConic data to Google Tag Manager variables, for example:
- Choose "Associated Segment(s)" as value type and optionally click "All associated segments" to use the segment selection pop-up to narrow down which segments you want to send. You can also have the BlueConic segment name replaced by a value used in Google Tag Manager and Google Analytics.
- Enter the corresponding Tag Manager variable, for example, BcSegments. This tells BlueConic to add segments that the visitor is part of to the specified variable. We will use this Tag Manager variable to send the data to a Google Analytics dimension later.
You can send any BlueConic profile data along with this event, but refrain from sending personally identifiable information (PII), as this is not allowed per Google's terms of service.
- Under "When to push data to Google Tag Manager," set "Push Frequency" to "Each Page View":
- For "Event name", enter "BlueConic".
- Enable the connection and save
Google Analytics Settings
- Open your Google Analytics account with the relevant account, and go to the Admin" tab. Select "Custom Definitions"
Add a new "Custom Dimension" called "BcSegments". Set "Scope" to "User" and select the "Active" checkbox.
- Save the dimension and note the "Index" of your dimension
- Also note your Google Analytics or Universal Analytics 'Tracking Id'. How to find it
Google Tag Manager Settings
- Open your Tag Manager account and the relevant container. Within the workspace, go to "Variables"
- Create a new "User-Defined Variable". Fill it with:
- Title: BcSegments
- Variable type: Data Layer Variable
- Data Layer Variable Name: BcSegments
- Data Layer Version: Version 2
- Also add the following six variables:
Title | Variable type | Data Layer Variable | Data Layer Version | Value | Tracking Id | Cookie Domain |
---|---|---|---|---|---|---|
eventCategory | Data Layer Variable | eventCategory | Version 2 | |||
eventAction | Data Layer Variable | eventAction | Version 2 | |||
eventLabel | Data Layer Variable | eventLabel | Version 2 | |||
eventValue | Data Layer Variable | eventValue | Version 2 | |||
Google Analytics ID | Constant | <Tracking Id> | ||||
Google Analytics Settings | Google Analytics Settings | Google Analytics Settings | <Tracking ID> | auto |
Substitute <Tracking ID> with the analytics tracking id you noted earlier (Google Analytics setting step 4), this should look like UA-12345-6.
The variables "eventCategory", "eventAction", "eventLabel" and "eventValue" add meta information about the event that can be used for reporting. Adding these variables is recommended, but optional.
When you are done, it should look like this:
- Go to "Tags" and click "New" to add a tag with following configuration:
- Title: BlueConic Connection
- Type: Universal Analytics
- Tracking Type: Event
- Category: {{eventCategory}}
- Action: {{eventAction}}
- Label: {{eventLabel}}
- Value: {{eventValue}}
- Non-Interaction Hit: true
- Google Analytics Settings: {{Google Analytics Settings}}
- Activate "Enable overriding settings in this tag"
- Tracking ID: {{Google Analytics ID}}
- Open "More Settings" and navigate to "Custom Dimensions". Configure this as follows:
- Index: Put the dimension index from the Google Analytics settings here
- Dimension Value: {{BcSegments}}
- The above tag is then linked to the different variables you entered in steps 2 and 3.
- Click the "Triggering" block and click "+" in the top right to create a new trigger called "Datalayer".
- Triggertype: "Custom Event"
- Event Name: BlueConic
- Click "Save" to link the tag to the trigger and click "Save" to save everything.
Testing Tag Manager
- Click "Preview"
- In a new window, open the domain on which you wish to test. In the Google Tag Manager panel you should see a BlueConic Connection tag being fired.
- Select "BlueConic" in the left panel in the console and then select "Data Layer from the top menu.
- You should be able to trace what is being written to "Google Tag Manager Data Layer". This should at the very least be "BcSegments: All Visitors"
Analytics Review
- Return to Google Analytics
- Select "Customization - Custom Reports"
- Create a new modified report: "BC Segments"
- Select a relevant statistics group, for example, "Users"
- Dimension details: "BcSegments"
- Open the report. You will see the segment values appear, for example, "All Visitors". Be sure to select the right time frame in Google Analytics
Learn about synchronizing BlueConic data with Google Analytics
See our blog post about important things to consider when synchronizing your BlueConic profile data with Google Tag Manager and Google Analytics: Enrich Google Analytics Data with a Customer Data Platform like BlueConic.