Setting up Google Analytics with Google Tag Manager
This guide shows you how to track advisor interactions in both Google Analytics 4 and your bluebarry dashboard using Google Tag Manager (GTM).
💡 Important: While we’ll use GTM for tracking interactions, we recommend adding the main bluebarry script directly to your website, not through GTM.
Jump to a topic 👇🏻
Step 1: Create GTM Variables
First, create data layer variables in GTM.
Here’s how to create each variable:
- Go to “Variables” in your GTM dashboard
- Click “New” under “User-Defined Variables”
- Choose “Data Layer Variable” as the type
Enter the variable name (e.g., “bluebarry_advisor_id”)
Use the same name for “Data Layer Variable Name”

Repeat the steps for all the 9 variables below:
- bluebarry_advisor_id
- bluebarry_session_id
- bluebarry_question_id
- bluebarry_question_name
- bluebarry_answer_id
- bluebarry_answer_name
- bluebarry_product_id
- bluebarry_product_name
- bluebarry_product_url
Your completed setup should look like this:

Step 2: Set Up GTM Triggers
Create triggers for each bluebarry event:
- bluebarry_start_advisor
- bluebarry_answer_submitted
- bluebarry_question_viewed
- bluebarry_result_viewed
- bluebarry_result_opened
For each trigger:
- Click “Triggers” → “New”
- Name it “Event | [event_name]”
- Choose “Custom Event” as trigger type
- Enter the exact event name (e.g., “bluebarry_start_advisor”)
Below, you can find a screenshot of what your trigger setup should look like:

Step 3: Create GA4 Event Tags
Let’s create the GA4 event tags, starting with an example of how to set up bluebarry_answer_submitted:
- Go to “Tags” and click “New”. Name your tag “Event | bluebarry_start_advisor”
- For “Tag Configuration”: Choose “Google Analytics: GA4 Event”
- Enter your GA4 Measurement ID
- Set Event Name to “bluebarry_start_advisor”
- Click “Add Parameter”. Set the parameter name: “bluebarry_advisor_id”. For value: Choose the corresponding data variable. Repeat for “bluebarry_session_id”
- Under “Triggering”, select the matching trigger we created earlier
- Save your tag

💡 For each event’s parameters, use the matching variables we created in Step 1. The variable names and parameter names should be identical.
All GA4 events and corresponding event parameters:
bluebarry_start_advisor
- bluebarry_advisor_id
- bluebarry_session_id
bluebarry_answer_submitted
- bluebarry_advisor_id
- bluebarry_session_id
- bluebarry_question_id
- bluebarry_question_name
- bluebarry_answer_id
- bluebarry_answer_name
bluebarry_question_viewed
- bluebarry_advisor_id
- bluebarry_session_id
- bluebarry_question_id
- bluebarry_question_name
bluebarry_result_viewed
- bluebarry_advisor_id
- bluebarry_session_id
bluebarry_result_opened
- bluebarry_advisor_id
- bluebarry_session_id
- bluebarry_product_id
- bluebarry_product_name
- bluebarry_product_url
Step 4: Create Custom Definitions in GA4
Every parameter that we’ve created in GTM, has to be added to GA4 as a custom definition as well.
- Navigate to Admin > Property settings > Data display > Custom definitions
- Click on “Create custom dimension”
- For every parameter the “Event parameter” has to have the exact same value the bluebarry parameter.

Step 5: Test Your Setup
To test your setup:
- Click “Preview” in GTM:
- Open your website
- Use your advisor from start to finish
- Also open the product results
- Check GTM’s preview mode to verify each event fires