Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If your object looks like: variable example = {'userGroup': 'admin'}, then you can use example.userGroup matches admin to make the form appear:

...

Trigger on data layer content

It is also possible to trigger based on values within the dataLayer. You can type dataLayer in your browser console to find out what is available.

...

To trigger a Within the dataLayer, the syntax can vary. One way to get the correct syntax, is to copy the property path.

...

In the following image there are two different examples of how to reference values in the dataLayer.

...

To trigger based on the data layer, a wildcard [*] can be used. This wildcard will iterate over items in an array until it finds the key. This is especially useful when the item is not in a static position in the array.

In this the example below, the form appears will trigger if in the data layer a key is ‘products’ and this ‘products’ key exists and contains the value ‘shoes’.

...

The values you set in the conditions are stored as a String. This has some implications if you want to check for a Boolean value in the variable on your page.

Info

To iterate with a wildcard through the items in the array from the last item, the wildcard [*LAST] can be used. This can be useful for

...

a dataLayer with events in SPA’s.

Note

The * wildcard can only be used once in a query. E.g. dataLayer[*].basket[*].prices won’t work.

...