Skip to main content

Datalayer

The Lyftio script automatically monitors the datalayer. This enables setting up targering for any event that is pushed by using a datalayer condition.

Example

Say you want to register conversions for visitors that add a product to cart. If you have a GTM event for that you can easily target that by setting a datalayer condition.

Example datalayer event

{
"event": "add_to_cart",
"ecommerce": {
"items": [
{
"item_id": "122-434",
"item_name": "Low Waist Jeans Black - EU 34",
"item_variant": "Black",
"item_brand": "Jeansy",
"item_category": "Jeans",
"price": 699,
"discount": 0,
"quantity": 1,
"size": "EU 34",
"item_variant_id": "2626-0014-1252"
}
],
"currency": "SEK",
"value": 699
},
"gtm.uniqueEventId": 228
}

Datalayer condition! In the example above we set the event to add_to_cart. This will target all events called add_to_cart but you can easily use the key/value input fields to narrow down the target on any key value pair inside the event. The datalayer listener will go through the hierarchy of the event and search for your set key/value.

tip

Always test your Goals in Preview before activating the experiment to make sure that your goals triggers as expected.