All Collections
Scenarios
Scenarios
How do I use the data available in my Data Layer using Google Tag Manager?
How do I use the data available in my Data Layer using Google Tag Manager?

Make the most of the data you already have when creating custom groupings

Madeleine White avatar
Written by Madeleine White
Updated over a week ago

Thanks to Poool Dashboard, you can create custom groups. And when you cross this feature with your own audience knowledge, it allows you to implement more specific paywall strategies.

💡 To know more about custom groups, have a look to our other articles:

This article will explain how you can integrate Poool with Google Tag Manager (GTM) and make use of it to link data that you can collect on-site to your audience.

The Data Layer

Using Google Tag manager will allow you to add a Javascript table to your site named 'Data Layer'. Here, you will be able to store any information that you will, from the type of page that will integrate Poool (free, premieum, subscription...) to the status of the user (subscribes, connected...) in a way that is not visible to the reader.

Specifying the transferable and global data is the most interesting way to use a Data Layer. This allows you to make the most out of the information that you collect on-site so that you can then use this data on various other services.

For more specific information on the Data Layer, here is the documentation provided by Google.

The variables according to the user

Even once the technical team has added a new variable in the Data Layer, it will not be automatically created in the user interface of GTM.

You will need to go into the 'Variables' section and click on 'News' in the area concerning the variables based on the user.

Now you will be able to choose a type of variable. For the Data Layer, it will be the button 'Data layer variables'.

Reminder:

A Data Layer variable will be presented in the coded form shown below:

dataLayer = [
{clé:valeur},
{...}
]

Once you have done this, repeat the same operation how ever many times necessary until you have all of the usable data for your Data Layer.

️Important

In order to integrate Poool into GTM using the Data Layer, you will need to add in at least the type of page (free, premium, subscription) and the status of the user (if they are subscribed etc or not).

Create tags in order to integrate Poool

Now that you have filled up your Data Layer and the data in the GTM, you will be able to run them in Poool.

In order to do this, you will need to integrate Poool through 3 steps:

Step 1

Create a 'personalized html' tag with only the script for Poool:

<script>
!function(w,d,s,u,p,t,o){
w[p]=w[p]||function(){(w[p]._q=w[p]._q||[]).push(arguments)},
t=d.createElement(s),o=d.getElementsByTagName(s)[0],
t.async=1,t.src=u,o.parentNode.insertBefore(t,o)
}(window, document, "script", "https://assets.poool.fr/poool.min.js", "poool");
poool("init", "XXXX-XXXX-XXXX-XXXX"); // Remplacez par votre identifiant d'application
</script>

Step 2

Next, create a second 'personalized html' tag with the Poool configuration:

poool("config", "user_is_premium", {{variable_datalayer_user}} // true ou false);
poool("config", "cookies_enabled", true);

3ème étape

To finish, a third tag is needed containing only the following line:

poool("send", "page-view",{{variable_datalayer_typedepage}});


This third and final tag must be dependant on the configuration tag (the second one) which is in itself dependant on the original script (the first one).

Why 3 tags?

The objective is to implement the integration in the most flexible way and to easily modify the configuration.

Effectively, if you wish to update your Data Layer with your behavioral data in order to use the custom groups, all that you'll need to it to add a condition in the tag containing that specific configuration.

Example

If you add a variable {fan_of_football:true} in the Data Layer, this could suggest that the person in question is interested in collective sport.

If you decide to create a custom group in order to directly entice this person towards Poool, all that is needed is to create a custom group (for example, with the tag 'fan_of_football') with a created journey.

Next, in the Poool configuration, found in GTM (in the second tag after having stated the variable) add:

if({{fan_of_football}}) == true) {
poool("config", "custom_segment", "fan_of_football");
}

  • {{fan_of_football}} = my variable GTM, corresponding to my datalayer data

  • {{fan_of_football}}) == true = based on the idea that this reader is included, the booleen 'true' is used in the datalayer. If they are not included, the booleen 'false' will be used.

  • poool("config", "custom_segment", "fan_of_football"); = This custom segment is named 'poool' and the name linked is "fan_of_football".

Now, any users who enter into this category will be placed into the custom segment created which will, in turn, lead them to a specific journey.

Let's look a bit further into this logic

Now that you have understood how to find a variable in the Data Layer directly from GTM and exploit a customised segment of Poool, you can now make this yet more dynamic!

Examples of article categories

If we turn back to the example above, there is a clear lack of dynamics. In effect, it is not practical to put two 'hard' data in correlation.

Here is an example that will allow you to exploit the Poool potential in a way that is a lot more meaningful.

Based on the idea that an article is always in a category, and that this category will not change, you will be able to put an article category currently being used in the Data Layer dynamically.

dataLayer.push({'category':my_variable_category});

All that is left is to decide the 'category' variable in the GTM so that, each time a user changes articles, the category of the article will be sent through the tag manager.

Now, you can use this in Poool!

This now just needs to be put into place. Let us assume that you know the names of the categories (e.g. politics, economy, sport) and that you have a defined strategy for users who read articles relating to 'economy' and to 'sport'.

Go ahead to the Poool Dashboard and create two new custom segments, giving them names for the category: 'economy' and 'sport'.

💡 Do not forget that you have to create at least one scenario for each group, otherwise your users will not be shown the required subscription!

In the Poool configuration (still in the second tag), add the following condition:

if({{category}}) {
poool("config", "custom_segment", {{category}});
}

Now, dynamically, the right custom group will be used depending on the category.

Order of calls

️Be careful - nowadays, the custom group applied is the one last written in the configuration code.

Example :

poool("config", "custom_segment", "x");  
poool("config", "custom_segment", "y");

The custom group applied to the user will be 'y'.

If you need any more help, feel free to contact us on the Intercom chat!

Did this answer your question?