How airlines can leverage the airTRFX dataLayer to set custom tracking via GTM

Ruben Alanis
|
September 13, 2023
|
2 min read

The EM dataLayer is a data structure that has all the relevant data from the page that can be processed and passed from airTRFX to other applications such as Google Analytics, Google Ads, Adobe Analytics, etc.

The EM dataLayer can be used to leverage some analytics and marketing efforts such as:

  • Custom Dimension in GA
  • Event tracking
  • Trigger rules in GTM
  • Dynamic Remarketing

The efforts mentioned above need dynamic variables that can be extracted from the EM.dataLayer.

All the available parameters of the EM dataLayer can be found in the following documentation:

How to find the EM.dataLayer in airTRFX

The EM.dataLayer can be found on any airTRFX page by simply typing ‘EM.dataLayer’ on the page:

EM-dataLayer.jpg

The values of the variables in the EM.dataLayer will be different depending on the airTRFX page.

The variables are populated dynamically so the data is relevant to the current page.

Calling the EM.dataLayer from GTM

To collect the variables form the EM dataLayer in GTM there are some steps that need to be followed:

1. Create a ‘Custom JavaScript’ Variable

The naming convention of the variables in GTM can be defined by the Analytics Manager but we recommend the following naming convention:

EM dataLayer – {{section}} – {{variable}}

E.g. EM dataLayer – page – typeName

The intention of this naming convention is to have order in GTM and avoid confusion when using the variables across tags.

  • Select ‘Custom JavaScript’ as variable type

dataLayer scale 1.jpeg

 

The variable will look like this:

EM-dataLayer2-scaled.jpg

The empty space will be used to insert a JavaScript function that will call the variable from the EM.dataLayer.

2. Insert JavaScript Function

Insert the following function (in this example we will target the pageType variable):

1function(){return EM.dataLayer[0].page.typeName;}

The CJS variable should look like this:

EM-dataLayer3-scaled.jpg

3. Preview / Debug

Use GTM’s Preview mode to debug the variable data collection.

EM-dataLayer-4-scaled.jpg
  • This example provides the value for the airTRFX’s homepage

EM-dataLayer-5-scaled.jpg

4. Use the same method to target other variables

In conclusion, the EM dataLayer is your key to enhanced analytics and marketing efforts. It bridges your airTRFX pages with applications like Google Analytics and Google Ads, offering dynamic variables for precise targeting. Utilize it for custom dimensions, event tracking, GTM trigger rules, and dynamic remarketing. With readily available documentation, accessing and using the EM dataLayer is straightforward, ensuring your data stays relevant to each page. Embrace this integration for smarter decision-making in the digital landscape.

Related Products
Stay connected with our newsletter
Be the first to receive exciting news and updates delivered right to your inbox