The dataLayer filter allows you to target campaigns based on information that your website sends to analytics or marketing tools (such as page type, product ID, price, category, or shopping cart status). This allows you to display campaigns only in situations where the data from the dataLayer meets the specified conditions—for example, only on product pages, for more expensive products, or when the shopping cart value reaches a certain amount.
As a result, the campaign is not launched "blindly," but responds to the specific context that you are already measuring on your website.
Where is it most commonly used?
Page type (pageType)
E.g. page_type = „product“, „category“, „cart“, „checkout“.
Allows you to display different campaigns on the product page, different ones in the shopping cart, and different ones at checkout.
Product price or margin
E.g. product.price or product.margin.
For more expensive or high-margin products, you can offer a special benefit, free shipping, or a bonus to encourage completion of the purchase.
Shopping cart and order status
E.g. cart.value, cart.items_count.
For larger cart values, display incentives to complete the purchase (shipping discounts, etc.), and for empty carts, display product recommendations.
How to enter the name of an object in dataLayer
Mailocator can work with both individual objects and their nested properties.
The name is always entered in the form of a path within the object, not as a complete entry with dataLayer.[...].
Correct (example):
- page_type
- page_type.product
- ecommerce.detail.products[0].id (if your dataLayer uses arrays)
Incorrect:
- dataLayer[0].page_type.product
- window.dataLayer[0].page_type.product
All you need to do is enter the part of the name that corresponds to the structure of the object in the dataLayer, without the dataLayer prefix[...].
Note: If the same value appears multiple times in the dataLayer (e.g., sequentially during different interactions), Mailocator always works with the latest (current) value in the history of this object.