What is the Filter Variable with Products?
With all ecommerce and list-related tags in JENTIS you probably have noticed a special functionality in tags. Which is the “Filter Variable”, which you will find in the configuration of a tag like this:
This gives you the option on tag level to only include certain elements (products, in most instances).
Background - Data Layer
Before we delve deeper into the options and settings of the filter, we must cover some basics of the JENTIS Data Layer first.
The filter is an option when it comes to elements that come as many per event, such as multiple products per cart. So if multiple products are available within the same context but have a slightly different context you can narrow down your configuration to only submit the ones relevant to your tag.
Let’s use the following example where we have two products, one in the context of a shopping cart and one product mentioned in a list (“products other customers purchased with your product”).
_jts.push({
"track" : "product",
"type" : "cartview",
"id" : "123",
"name" : "Baby Oil"
});
_jts.push({
"track" : "cartview"
});
_jts.push({
"track" : "product",
"type" : "productlist",
"id" : "456",
"name" : "Baby Shampoo"
});
_jts.push({
"track" : "productlist",
"listname" : "related_products"
});
_jts.push({
"track" : "submit"
});
With this example we have two products on the same page but with different context, “cartview” and “productlist”. Let’s see how filters help to clean up the data.
Filtering Products
In our code example we have two products of different context but our tag is a very specific context: it’s a “view_cart” event with GA4 (which we will use for an example).
You can select a Filter Variable (by default it will be the type
property of the pushed element). So the product type “cartview” is filtered in the example (screenshot).
The product “Baby Shampoo” of the type “productlist” will not be considered with this tag. And the tag stays clean about only the relevant tags to it’s context.