Connecting BlueConic to Google Analytics through Google Tag Manager

What: When using Google Analytics (GA) in tandem with Google Tag Manager (GTM), events have to be communicated through GTM. To do this, you will first need to set up a BlueConic Google Tag Manager connection. Next, you will also need to configure GTM and GA. We will walk you through the steps of getting user BlueConic segments into GA.

Why: You want to send BlueConic profile properties or segments to Google Analytics and the GA 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 GA has to go through GTM.

This document only covers the combination of Google Tag Manager and Google Analytics. If you are not using GTM to serve the GA tag, this document is not for you. Set up a Universal Analytics connection instead.

Summary

In this document, we will setting up BlueConic so communication the segments a profile is part of, through GTM to GA. You will need a BlueConic account authorised to set up a connection, a GTM account and a GA account.

For each page view, BlueConic will send a BlueConic specific event using the GTM data layer.

When GTM 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 GTM. 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 GTM to GA. You can then tune the setup to match your own requirements.

To recap: BlueConic will trigger a GTM tag that sends data to GA. This setup is glued together by a number of variables.

BlueConic Settings

  1. 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.
  2. 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:
     
  3. Activate and select the export goal: "Export data into Google Tag Manager".
  4. Map BlueConic data to Google Tag Manager variables, e.g.:
    properties.png
  5. Choose "Associated Segment(s)" as value type and optionally click "All associated segments" to use the segment selection popup to narrow down which segments you want to send. You can also have the BlueConic segment name replaced by a value used in GTM/GA.setting.png
  6. Enter the corresponding GTM variable, e.g. BcSegments. This tells BlueConic to add segments that the visitor is part of to the specified variable. We will use this GTM 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.

  1. Under "When to push data to Google Tag Manager" set "Push Frequency" to "Each Page View":
  2. For "Event name", enter "BlueConic".
  3. Enable the connection and save

Google Analytics Settings

  1. Open your Google Analytics account with the relevant account, and go to the Admin" tab. Select "Custom Definitions"GA1.pngAdd a new "Custom Dimension" called "BcSegments". Set "Scope" to "User" and check the "Active" checkbox.
  2. Save the dimension and note the "Index" of your dimension
  3. Also note your Google Analytics or Universal Analytics 'Tracking Id'. How to find it

GA2.png

Google Tag Manager Settings

  1. Open your GTM account and the relevant container. Within the workspace, go to "Variables"
  2. 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 2GTMVariable.png
  3. 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: 

  1. 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}}
  2. 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}}

  1. The above tag is then linked to the different variables you entered in steps 2 and 3.
  2. Click the "Triggering" block and click "+" in the top right to create a new trigger called "Datalayer".
    • Triggertype: "Custom Event"
    • Event Name: BlueConic

  1. Click "Save" to link the tag to the trigger and click "Save" to save everything.

Testing Tag Manager

  1. Click "Preview"
  2. 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.
  3. Select "BlueConic" in the left panel in the console and then select "Data Layer from the top menu.
  4. You should be able to trace what is being written to "GTM Data Layer". This should at the very least be "BcSegments: All Visitors"

Analytics Review

  1. Return to Google Analytics
  2. Select "Customization - Custom Reports"
  3. Create a new modified report: "BC Segments"
    • Select a relevant statistics group, e.g. "Users"
    • Dimension details: "BcSegments"
  4. Open the report. You will see the segment values appear, e.g. "All Visitors". Be sure to select the right time frame in Google Analytics