Skip to main content
All CollectionsEngage
How to set up custom filters in Poool Engage?
How to set up custom filters in Poool Engage?

Discover how to use multiple custom filters when creating your Engage elements

Flore Bayle avatar
Written by Flore Bayle
Updated over a month ago

With Poool Engage's custom filters, you can quickly refine the targeting of your elements.
This feature allows you to apply multiple display/hide rules based on your unique characteristics in addition to all the native conditions available in your Dashboard.

The custom filter lets you use any data that is available on your side (e.g., data layer, database).

How does it work on the technical side?

From a coding perspective, this requires sending an array of variables/values (in "string" format) from the Engage script configuration using the autoCreate() method.

Example:

engage.autoCreate({filters:['valeur1', 'valeur2','valeur3']}):

There is no limit to the number of values you can include in this array.

How to Configure It in the Dashboard?

You can apply conditions in the Dashboard based on the filters passed during the integration. To do this, select the following condition:

👉 Display/Hide

👉 Enter in the filters the slug that exactly matches what is passed in the configuration.

Make sure the slug you enter in the Dashboard match exactly to what is passed in the configuration of the autoCreate() method.

Simple Integration Example

Let’s look at a small example 🔎

Here, I choose to create an Engage element that will be displayed for users who are football fans, follow Ligue 1 news, and support Paris Saint-Germain.

In the Dashboard, I apply three filters: "football," "ligue-1," and "Paris Saint Germain":

On the integration side, the logic is as follows:

const user = { favoris: 'football', // Extrait de l'utilisateur }; 
const article = { rubrique: 'ligue-1', // Extrait de l'article };
const sport = { equipe: 'paris-saint-germain', // Extrait du sport };

// Engage configuration with dynamic values

engage.autoCreate({filters:[user.favoris, article.rubrique, sport.equipe]);

Example of Integration Using dataLayer Variables


To take it a step further, here’s an example of leveraging variables from the dataLayer:

// Datalayer examples with dynamic values
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
user: {
favoris: 'football' // Sports favoris de l'utilisateur
},
article: {
rubrique: 'ligue-1' // Rubrique de l'article
},
sport: {
equipe: 'paris-saint-germain' // Équipe concernée
}
});

// Function to extract the values
function getDataLayerValue(path) {
return path.split('.').reduce((prev, curr) => (prev ? prev[curr] : undefined), window.dataLayer[0]);
}

// Filters configuration with dynamic values
autoCreate({filters:[
getDataLayerValue('user.favoris'),
getDataLayerValue('article.rubrique'),
getDataLayerValue('sport.equipe')
]});

You’ve got it—the key to success lies in defining the custom values you want to activate.

🌟 We recommend predefining all the custom values you’ll need so they can be properly included during the integration phase in the Poool Engage configuration. Once this technical setup is complete, there’s no need to modify it further—you’ll have full autonomy to create your custom filters!

If you have any questions, don’t hesitate to contact our team!

Did this answer your question?