In this article, we will explain the optional variables for "Google Data Layers" that exist on some pages of the website for use by Google experts:
/* Search Result: */ dataLayer = [{ crtid: ' ', from: ' ', to: ' ', triptype: 'RT/OW', adults: ' ', kids: ' ', infants: ' ', result: true/false, // Arrays outbound: [ class: ' ', price: ' ', from: ' ', to: ' ' ], inbound: [ class: ' ', price: ' ', from: ' ', to: ' ' ] }]; /* Itinerary */ dataLayer = [{ crtid: ' ', from: ' ', to: ' ', totalprice: ' ', ancillaries: true/false, triptype: 'RT/OW', adults: ' ', kids: ' ', infants: ' ', // Array selected_flights: [ flight_num: ' ', from: ' '; to: ' ', price: ' ' ] }]; /* Confirmation */
The total price is always on the default currency of the company, and the currency is the name of the default currency of the company In the new IBE we have added an ecomm_event to the confirmation page data layer, now it would look like this:
dataLayer = [{ // Array selected_flights: [ flight_num: ' ', flight_date: ' ', from: ' '; to: ' ', price: ' ' ], crtid: ' ', pnrref: ' ', customer_email: ' ', totalprice: ' ',
currency: ' ',
event: confirmation },
/*Valid only for new IBE*/
{
"transactionId": "", /*PNR*/
"event": "ecomm_event",
"transactionAffiliation": "", /*Airline name / Agency name*/
"transactionTotal": , /*PNR Total in currency*/
"transactionProducts": [
//Flight
{
"sku": "", /*Flight number-uniqueid*/
"name": "Flight",
"category": "", /*Class name - I.E - Economy*/
"price": "", /*Price of service*/
"quantity": 1
},
//Ancillary
{
"sku": "", /*Extra Service - For instance - Baggage-uniqueid*/
"name": "", /*Ancillary name - For instance, Extra Baggage*/
"category": "", /*Extra Service - For instance - Baggage*/
"price": "", /*Price of service*/
"quantity": 1
},
//Seats
{
"sku": "", /*Seat number-uniqueid*/
"name": "Seat",
"category": "Extras",
"price": "", /*Price of seat*/
"quantity": 1
}
];
Addition - 23/05/19
To use the ecomm_event - follow this guide
Valid only for the new IBE.
Example of how to use GTM and Google Analytics:
Suppose we wish to track every purchase and the amount paid. As explained earlier, the total price will always be in the company's default currency.
- First, create variables in GTM for the data layer variables to extract them. let's say that we need the transaction id, and how much was paid: Then, set global settings for Google Analytics: Finally, make a tag for the confirmation event in the data layer.
- Create a trigger for this event.:
- Lastly, create a tag for Google Analytics that will be activated every time this event triggers.
That's it! Now, every time a customer reaches the Confirmation page, an event will be triggered and sent to your Google Analytics account. See the screenshots below for how it looks.
And in google analytics:
If you have other inquires please do not hesitate to open a support ticket.
Comments