Business Case - Creating GTM variables based on existing DataLayers (English) | Publications

The goal of this case will be to look at data from a business perspective. The goal of Business Intelligence (in a web context) is to gain insights on how to increase business by optimising the website and the way users are acquired.

In this article we’ll be focusing on how to leverage an existing technical implementation (that includes dataLayer variables) and sales data in order to create business specific dimensions (and audiences) that will allow you to optimise your actions in line with business objectives. Note that this exercise can be extended in order to map persona’s based on clear signals.

The idea is to showcase a particular solution. We’ll be looking at and applying the principles using a basic example. In this simplified example other solutions could work and could be more efficient. However, in order to make sure everything is clear the methodology prevails over the exact example so the reader understands the way of working and can use it whenever standard solutions won’t cut it.

Case example: hotel Manager

Imagine you’re a hotel owner and your business has the following characteristics:

  1. You have two types of rooms at you guest’s disposal: a ‘standard room’ and a ‘suite’
  2. Your website is equipped a technical implementation that allows you to track the relevant KPI’s (with a dataLayer)
  3. You have a very limited amount of marketing budget

Looking at the sales data of your company reveals the following information:

Contribution to total revenue split across the number of nights and room type*

 

Room type

Nights

Standard Room

Suite

1

Low

Medium

2

Low

Medium

3

Medium

High

4

Medium

High

5

High

High

Looking at this data it immediately becomes clear that the revenue per booking for the hotel is maximised in the following cases:

  • The standard room is booked for 5 days
  • The suite is booked for 3 or more days

Key Questions

The hotel would now like to know the answer to the following questions:

  1. Where do users making ‘low’,’medium’ and ‘high’ contributions to the revenue come from?
  2. What do they do on my website?
  3. Can I get them back once they don’t buy?

This question can be tackled using the existing dataLayer and new forged dimensions.

Imagine the dataLayer looks like this in the first phase of the funnel, when a user starts the selection for any of the following scenario’s:

Scenario 1 - suite, 5 nights

{

nights: '5',

room: 'suite'

}

The website user selected the suite and wishes to book it for 5 nights. This would land the user’s booking into slot that would result in a ‘High’ contribution to the hotel’s revenue.

Scenario 2 - suite, 2 nights

{

nights: '2',

room: 'suite'

}

The website user selected the suite and wishes to book it for 2 nights. This would land the user’s booking into slot that would result in a ‘Medium’ contribution to the hotel’s revenue.

Scenario 3 - standard room, 2 nights

{

nights: '2',

room: 'standard room'

}

The website user selected the standard room and wishes to book it for 2 nights. This would land the user’s booking into slot that would result in a ‘Low’ contribution to the hotel’s revenue.

Scenario 4 - standard room, 5 nights

{

nights: '5',

room: 'standard room'

}

The website user selected the standard room and wishes to book it for 5 nights. This would land the user’s booking into slot that would result in a ‘High’ contribution to the hotel’s revenue.

Methodology

In order to be able to answer the previously raised questions, we would need to go through three steps:

  • Step 1 - Ensure the existing dataLayer values are capture within GTM
  • Step 2 - Create a new GTM variable based on the existing dataLayer and the mapping used in the ‘revenue contribution table’. For the new variable creation we will use JavaScript. This step will ensure the new variable is generated so it can be used in step 3.
  • Step 3 - Send back this variable as a custom dimension to Google Analytics

Step 1 - Capture relevant dataLayer variables as variables in GTM

To do this the following procedure can be followed:

  1. Create a new DataLayer variable within GTM
  2. Fill in the exact name used in the dataLayer
  3. Repeat the process for all the required variables

gtmbizcase1

Step 2 - Create a new GTM variable using the existing GTM variables as input

  1. Within GTM we select to create a new Custom JavaScript variable.
  2. Give it a comprehensive name - e.g: “Script variable - revenue impact”
  3. Create a script using the initial table (based on sales data) as a guidance. In our case the following script could be deployed**.

gtmbizcase2

function()

{

var roomType = {{dataLayer - room}};

var nights = {{dataLayer - nights}};

switch(true) {

case roomType == 'standard room' && nights < 3:

return 'Low';

case roomType == 'standard room' && nights < 5:

return 'Medium';

case roomType == 'standard room':

return 'High';

case roomType == 'suite' && nights < 3:

return 'Medium';

case roomType == 'suite':

return 'High';

default:

return 'Other';

}

}

The section between double curly brackets allows the code to fetch already declared GTM variables. In order for the code to work the naming convention between double curly brackets should be exactly the same as the names used for the variables in GTM.

Note that the default value should not be required as all fields are mapped out. As a safety measurement however, this could prove useful in more complex cases in order to identify combinations that slipped through.

As soon as the user now enters the funnel, a custom variable will be created indicating ‘low’, ‘medium’ or ‘high’ in order to indicate the contribution that user could make to the revenue.

Step 3 - Insert the newly created GTM variable (created in the previous step) as a custom dimension

  1. Simply insert the variable created in step 2 as a custom dimension
  2. Add this custom dimension in the Google Analytics interface (admin section).

 

gtmbizcase3

Solving the key questions:

As all sessions by users entering the funnel now come with an additional dimension - the estimated impact on the revenue. As a result we can answer the following questions:

1. Where do users making ‘low’,’medium’ and ‘high’ contributions to the revenue come from?

Use the newly created custom dimension and cross it with source/medium to determine where medium and high revenue segments originate from. Once that questions is answered you can start acquiring more of these customers.

2. What do they do on my website?

Create a custom segment for each of the revenue segments and track them across your website. Do different segments visit different sections of your page? Do they land on different landing pages? If so, make sure that pages that are typically visited by ‘high’ contributing user profiles have easy access to the funnel. In short - make their life easier and remove hurdles!

3. Can I get them back once they don’t buy?

Link Google Analytics to AdWords and run remarketing campaigns specifically for users that are expected to have a high impact on revenue but didn’t convert. It’s the same money you would spent on a user with a low impact on the revenue but ROI will be much higher!

*We are using simple examples to bring the idea to life, hence going for the straightforward option of selecting only based on a single transaction and not combining revenue across multiple transactions.

**Note that this is merely one of the ways of how this could be implemented. Variations in codes and methodology are certainly possible.

Author: Glenn Vanderlinden

 

 

 

Tags:

Prenez Contact

Semetis | 44 Rue des Palais, 1030 Bruxelles - Belgique

+32 (0)2 211 34 50

welcome@semetis.com

Connectez-vous