Connecting Poool data with Google Analytics will allow you to obtain precise results and align your strategy with your general KPIs.
If you are using GTM to send data to GA4, we provide a code to implement to make the connection work.
This involves three main steps for you:
Integrate the connection in the Poool configuration
Configure GTM and GA4 to correctly send your data
Validate in GA4 that the Poool event is present
We explain everything in this article! 🙂
Make the connection between Poool Engage and GTM
Start by updating the Poool configuration with the code that enables the connection.
<script id="poool-engage" src="https://assets.poool.fr/engage.min.js" async></script>
<script>
function pushEvent(eventType, evt) {
if (!evt || !evt.element || !evt.element.slug) return;
const eventData = {
event: 'poool_engage',
engageAction: eventType,
eventCategory: 'engage',
engageLabel: evt.element.slug,
nonInteraction: eventType === 'seen'
};
window.dataLayer.push(eventData);
}
const script = document.getElementById('poool-engage');
script.addEventListener('load', function () {
// Ensure dataLayer is initialized
window.dataLayer = window.dataLayer || [];
Engage.init('<your-app-id>')
.on('click', (evt) => pushEvent('click', evt))
.on('seen', (evt) => pushEvent('seen', evt))
.on('destroy', (evt) => pushEvent('destroy', evt))
.on('formSubmit', (evt) => pushEvent('formSubmit', evt))
.autoCreate()
});
</script>
Each piece of information related to an event will be pushed into the DataLayer, following the same structure as a Google Analytics event.
Configure the GTM workplace
Once you have added the correct lines to your code, you need to define a custom trigger in GTM associated with Poool. There are three essential steps to follow.
Step 1: Create your data layer variables
Click on "Variables" > "New"
In "Variable Configuration", select "Data Layer Variable"
Create the three variables below:
eventCategory
eventAction
eventLabel
Step 2: Define a new tag
Click on "Tags" > "New" > "Tag Configuration"
Choose the tag type "Google Analytics" > "Google Analytics: GA4 Event"
In the "Tag Configuration" section, enter:
Your GA4 Measurement ID (if needed, find more information on this in 👉 this doc)
Event Name: poool_engage
In the "Event Parameters" section, you need to define the 3 event parameters and assign them the values of the variables we defined in Step 1.
event_category => {{eventCategory}}
event_action => {{eventAction}}
event_label => {{eventLabel}}
Here's what it looks like in our example:
Step 3: create a custom trigger
Go to the "Triggering" section
Choose your trigger type as "Custom Event" and name it "poool_engage"
This trigger should now be associated with your Google Analytics tag.
Now, let's head to GA4! 🙂
Retrieve data in GA4
To find the data in GA4, you need to declare custom definitions corresponding to the information sent in the data layer.
In your GA4 dashboard, go to the "Admin" section and select "Custom Definitions."
Name your three dimensions: event_category, event_action, and event_label, and declare these same values in the "Event parameter" section under "Custom Definitions." Choose the scope as "Event."
Which data can I find in GA4?
seen => the element has been seen by the user (when it has entered the browser's viewport)
click => the user has clicked a button/link inside the element
formSubmit => the user submits a form inside an element
destroy => the user has clicked a button/image configured to destroy element.
Do you have any more questions? Feel free to contact us via chat or at support@poool.fr 🙂