Google Analytics Integration
Overview
Our widget integrates with Google Tag Manager container, enabling the widget event stream to be connected with Google Marketing Platform products. In this guide, we'll demonstrate this using Google Analytics 4.
To ensure ease of use with data transmitted by the widget, we have defined a series of dimensions and events. Their full manual configuration in Google Tag Manager is time-consuming. Therefore, we offer implementation using a JSON file that can be imported into the Google Tag Manager container in merge mode. Then, after setting up the target Google Tag identifier, data is forwarded to the specified Google Analytics 4 property. From this point forward, you have an environment integrated with the TrueEngage widget that can be further customized according to specific implementation needs.
Events emited by widget
Widget Event Tracking enables better understanding of visitor interactions and facilitates improvements to service performance. For example, it helps identify which subpages benefit from widget usage, or on which subpages engagement features are recommended.
To keep the number of event tags in GTM (Google Tag Manager) compact, dimensions have been defined. These dimensions, combined with events, allow efficient definition of events we want to track. For instance, we use a single event to signal a conversation. Thanks to the channel dimension, we can specify whether we're counting all communication types or only selected channels.
Below is a list of events emited to Google Tag Manager data layer:
| Tag name | Description | Data |
|---|---|---|
| te_widget_prepared | It tracks when the widget is loaded. | {event: ‘te_widget_prepared’ visitor_id: … widget_id: … widget_name: …} |
| te_button_shown | It tracks when the widget is shown on page and it is offering service to visitors. | {event: ‘te_button_shown’ visitor_id: … widget_id: … widget_name: …} |
| te_engagement_headsup_shown | It tracks when the text buble is shown. | {event: ‘te_engagement_headsup_shown’ visitor_id: … widget_id: … widget_name: …} |
| te_engagement_widget_opened | It tracks when widget is opened (widget popup) | {event: ‘te_engagement_widget_opened’ visitor_id: … widget_id: … widget_name: … channel: <channel>} |
| te_channel_opened | It tracks when visitor navigates between channels. | {event: ‘te_channel_opened’ visitor_id: … widget_id: … widget_name: … channel: <channel>} |
| te_channel_initiated | It tracks when visitor start using a given channel. Additional data legend: | {event: ‘te_channel_initiated’ visitor_id: … widget_id: … widget_name: … channel: <channel> confirmed: true | false} |
The following dimensions are defined in the system:
-
visitor_id - visitor identifier; if a visitor returns to the page multiple times, the identifier value remains unchanged
-
widget_id - numerical widget identifier
-
widget_name - widget friendly name
-
channel - communication channel type:
- 'channel_picker' - represents the widget tab where communication channels can be selected
- 'chat' - represents text chat communication
- 'facebookMessenger' - represents communication via Facebook Messenger
- 'whatsapp' - represents communication via WhatsApp
- 'audio' - represents audio communication
- 'video' - represents video communication
- 'callback' - represents the callback method selection tab
- 'schedule' - represents the tab for scheduling a conversation at a specific date
- 'scheduledVideo' - represents the tab for scheduling a video conversation at a specific date
- 'faq' - represents navigation to the knowledge base tab
- 'form' - represents navigation to the form tab
-
confirmed - this dimension has a value of
truewhen we're certain the visitor established communication through the selected channel. If the channel provider doesn't deliver information about message delivery or conversation initiation, the value remainsfalse.For example, when clicking on a communication channel opens a link to a form subpage, we don't track whether the visitor actually submits the form. We only signal that the visitor opened the communication channel with
confirmed = false
Installation
TrueEngage management panel
In order for TrueEngage to send events, you need to enable the appropriate flag in the settings. To do this in TE Panel go to Settings tab → Deploy and Integration. Enable the option to start collecting data.

Google Analytics 4 Event Tracking with Google Tag Manager
Here's a step-by-step guide on how to configure tracking in Google environement.
Requirements: If you have an existing container in Google Tag Manager use it, if not create a new one using this instruction: https://support.google.com/tagmanager/answer/12974036?hl=en&ref_topic=3441530&sjid=6989127869182817959-EU
1. Import Trueengage variables, tags, triggers to GTM container
We have prepared a JSON configuration containing only the elements necessary for implementing the integration.
Download the file:
Then import the above configuration into your GTM container, selecting the following options:
- Merge mode with option: Rename conflicting tags, triggers, and variables
If you encounter any difficulties, here is the detailed import instruction for GTM: https://support.google.com/tagmanager/answer/6106997?hl=en
2. Setup variable TagGoogleID
STEP 1. In Google Analytics 4, we go to Settings → Data Streams tab and select appropriate stream, there you find measurement id

STEP 2. In GTM go to Variables -> find the variable TagGoogleID and set its value to your Measurement ID.
Test and publish your tags
Once you've set up your tags, you'll need to test them to make sure they're working correctly. Here's how you can do it:
- Go to the Preview and Debug mode in Google Tag Manager.

- Navigate to your website and trigger the TrueEngage events you want to track. Enter your website URL and click Connect

- Make the actions that should fire the event to make sure they are handled correctly - for example, open the widget to check the event "te_widget_opened”
- Check the Google Tag Manager debugger to make sure the TrueEngage events are being sent to your Google Analytics 4 property correctly.

- Once you've verified that everything is working correctly, publish your Google Tag Manager container to start tracking TrueEngage events in Google Analytics 4.
Google Analytics
To use data integration through Google Tag Manager, you need to define custom dimensions and custom metrics. To do this, in Google Analytics go to Admin → Property settings → Custom definitions.

Add dimension definitions according to the table (into Custom dimensions tab).
| Dimension name | Scope | Event parameter | Description |
|---|---|---|---|
| Trueengage channel | Event | te_channel | It allows to categorize events by widget channel |
| Trueengage widget | Event | te_widget_name | It allows to categorize events by widget |
| Trueengage funnel | Event | te_widget_funnel | It allows to prepare funnel report for phases: 1 Engagement headsup shown 2 Engagement widget opened 3 Widget opened 4 Channel opened 5 Channel initiated |
Add metrics definitions according to the table (into Custom metrics tab).
| Metric name | Description | Scope | Parameter name | Unit of measurement |
|---|---|---|---|---|
| Trueengage widget prepared | Event | te_f_widget_prepared | Standard | |
| Trueengage button shown | Event | te_f_button_shown | Standard | |
| Trueengage engagement headsup shown | Event | te_f_engagement_headsup_shown | Standard | |
| Trueengage engagement widget opened | Event | te_f_engagement_widget_opened | Standard | |
| Trueengage widget opened | Event | te_f_widget_opened | Standard | |
| Trueengage channel opened | Event | te_f_channel_opened | Standard | |
| Trueengage channel initiated | Event | te_f_channel_initiated | Standard | |
| Trueengage channel initiated confirmed | Event | te_f_confirmed | Standard |
Based on the prepared metrics, we can create sample reports:
- Identification of which pages have high widget usage
- Identification of how frequently visitors use widgets
- Verification of communication channel popularity per widget
- Funnel report for the widget
- Verification of business results per communication channel
Example reports:
Below we present how using several GA4 report groups prepared for this integration help us understand the role of the widget. Starting with the widget user journey report group where we learn about widget usage. Then through channel preferences reports we observe visitors' preferences for selected channels. Finally, the widget funnel report presents widget usage from the customer's perspective.
- TE - widget user journey summary
This report allows you to understand the contribution of individual widgets in the system from a bird's-eye view, both in terms of widget-to-widget comparison and the proportion of events for the subsequent phases of an individual widget.
- TE - widget user journey per page
This report allows you to understand for which subpages visitors choose to use the widget. It is worth noting that GA4 allows for the interactive selection of the metric by which we sort the observations. Consequently, a single report enables the verification of popularity, usefulness, and anomalies for which individual pages see increased widget usage.
- TE - channel preferences summary
The preferences report group is a source of knowledge about visitor preferences regarding the use of communication channels. The summary report outlines which channels are popular for the selected widget and shows how popularity varies depending on the timeline.
- TE - channel preferences by widget
This report allows you to filter data for a selected widget and perform popularity analyses as described above.
- TE - widget funnel
This report is helpful when we want to understand the widget usage funnel from the visitor's perspective. The created summary presents how the selection of subsequent widget options progresses per customer.
- TE - path exploration
- To understand the choices of visitors, we can conduct path exploration.
- For a more comprehensive insight, we propose a breakdown per channel. Below is an example chart from which we can read how many visitor interactions with the widget were recorded, broken down by communication channel popularity.


- An alternative approach is to preview the total users metric using path exploration

- For a more comprehensive insight, we propose a breakdown per channel. Below is an example chart from which we can read how many visitor interactions with the widget were recorded, broken down by communication channel popularity.
Offline Genesys events
If you want to receive additional analytical data not available from the site - you can configure to receive offline events. To do this, go to TrueEngage panel Settings -> Deploy tab and configure the fields:
- Google analytics measurement id
- Google analytics secret

Offline events are available for the following channels:
- Web Chat
- Call
- Callback
- Scheduled Callback
- Video Call
- Scheduled Video
Once the offline events are configured, TrueEngage will send additional dataset:
| Property | Description |
|---|---|
| client_id | Google Analytics client identifier used to track user sessions |
| te_visitor_id | Unique identifier for the visitor in TrueEngage system |
| te_widget_name | Name of the widget that triggered the event |
| te_channel | Communication channel used (e.g., Web Chat, Call, Callback) |
| te_outcome | Wrap-up code set in Genesys Cloud by the Agent after the interaction |
| te_event_category | Event category classification (set to "offline" for offline events) |
| te_f_outcome |
Flag indicating outcome event occurred (set to 1) |
Appendix
- Get measurement id
In Google Analytics 4, we go to Settings → Data Streams tab and select appropriate stream, there you find measurement id
- Generate API Secret
- To generate API secret go in Web stream details to Measurement Protocol API secrets

- Click on Create button and name your secret for example api_secret

- Done! Your API secret has been created and you can enter it in the Trueengage panel


- To generate API secret go in Web stream details to Measurement Protocol API secrets