Using DataLayer variables - Net Affinity Booking Engine

The booking engine contains a JS dataLayer on the Booking Confirmation and Voucher Confirmation pages. These dataLayers can be used when using third party tracking scripts directly or via Google Tag Manager.

Example dataLayer:

dataLayer = [{

"conversionDate":"2017-05-11",

"conversionValue":75,

"conversionType":"Booking",

"conversionId":"DH13170",

"conversionAttributes":[],

"transactionId":"DH13170",

"transactionDate":"2017-05-11",

"transactionType":"Booking",

"transactionAffiliation":"",

"transactionTotal":75,

"transactionShipping":0,

"transactionTax":0,

"transactionPaymentType":"",

"transactionCurrency":"GBP",

"transactionShippingMethod":"",

"transactionPromoCode":null,

"transactionProducts":[{

"id":"3729",

"sku":"ROOM3729",

"name":"RoomType - Executive Single",

"category":"RatePlan - Fully Flexible Rate",

"price":75,

"currency":"GBP",

"quantity":1

}],

"transactionArrivalDate":"2017-05-11",

"transactionDepartureDate":"2017-05-12",

"transactionBkeId":"1444",

"transactionFirstName":"David",

"transactionSurname":"Edwards",

"transactionEmail":"david.e@netaffinity.com",

"transactionLanguage":"en"

}];

Example use of dataLayer variables:

dataLayer[0]['transactionTotal']

will use "75" as it's value.