Data Layer Picker – Custom Variable Template – News Couple
ANALYTICS

Data Layer Picker – Custom Variable Template


The Data Layer Picker The custom variant form is a variant form of the Google Tag Manager community form gallery.

Describe

The data layer variable allows you to Access keys and values In the dataLayer.push() that caused the activation of the tag for which the variable was evaluated.

This is different from how the data layer variable works, as the DLV doesn’t care (or remember) what push() The key has been added to the GTM. Instead, it consolidates everything together into its data model.

However, with the Data Layer Picker, you can access the exact contents of the object that has been pushed into dataLayer.

There are many use cases for this, such as needing to access a file condition subordinate dataLayer before it is combined with other keys in the GTM data model.

To use the variable, you have two options. Either you recover a file whole being who was paid to dataLayer, or you can fetch the value of a file specific key. you can use point notation when specifying a property name.

The template will first try to get the nested structure at the end of the point notation path (eg gtm.elementId It will look for the value at the end gtm: elementId: 'somevalue'). If it doesn’t match anything, it will then try to get the value as if the dot notation path was a full key name by itself (eg gtm.elementId Will look for the value at the end 'gtm.elementId': 'somevalue'). If no match is made, then undefined is returned.

The template also works for items that have been pushed into it dataLayer By other custom molds.

Release Notes

date set of changes
May 26, 2021 Fixed the issue of breaking undefined objects of a variable.
February 26, 2021 The initial release.



Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button