1.7.0 β€’ Published 9 days ago

@everymundo/airmodules-event-datalayer v1.7.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 days ago

πŸ“ Table of Contents

🧐 Overview

The Tracking Package enables you to measure views and engagement across your applications. This documentation provides implementation instructions and reference materials geared towards a developer audience.

To track a new application, developers construct an event object for each event they wish to track and utilize this npm package to send the event. Once sent, the tracking package formats each event object according to the specifications outlined in the emDataStandards and pushes it to a dataLayer object. Subsequently, both customers and EveryMundo have the ability to leverage a tag manager to access the data layer values and transmit events to an Analytics account.

🏁 Getting started with the Tracking Package

Follow these simple steps to quickly integrate the Tracking Package into your project for seamless event tracking.

Step 1: Download the npm Package

Install @everymundo/airmodules-event-datalayer by using npm. Open your terminal and run:

npm install @everymundo/airmodules-event-datalayer

Step 2: Import the Formatter Function into the Project

In your project file where you plan to implement event tracking, import the formatter function. Add the following line at the top of your file:

import { formatter } from "@everymundo/airmodules-event-datalayer"

Step 3: Construct the Event Object Based on Vertical

Create an event object that captures the relevant information for the specific event you want to track. Ensure that the object follows the required structure and contains essential details related to the event. Refer to the details below for more information.

const eventObject = {
  event: 'viewable_impression',
  module: 'em-booking-popup',
  eventAction: 'viewable_impression',
  actionLabel: '',
  airlineIataCode: 'UL',
  journeyType: 'ONE_WAY',
  originAirportIataCode: 'CMB',
  destinationAirportIataCode: 'SIN',
  route: 'CMB>SIN',
  currencyCode: 'LKR',
  totalPrice: 5.21,
  totalPriceUSD: '',
  fareClass: 'ECONOMY',
  departureDate: '2021-03-13',
  returnDate: '2021-06-14',
  daysUntilFlight: 25,
  tripLength: 93,
  isFlexibleDates: '',
  discountCode: '',
  deeplinkSiteEdition: '',
  miles: '',
  timestamp: '2021-02-16T00:00:00.000Z',
  url: 'https: //www.srilankan.com/en-lk/',
  passenger: [
    {
      count: 1,
      adultCount: 1,
      youngAdultCount: '',
      childCount: '',
      infantInLapCount: '',
      infantInSeatCount: ''
    }
  ],
  page: [
    {
      siteEdition: 'en-LK',
      countryIsoCode: 'LK',
      languageIsoCode: 'en',
      pageTypeName: 'CUSTOM_PAGE'
    }
  ],
  lodging: [
    {
      cityCode: 'SIN',
      name: 'Intercontinental',
      startDate: '2021-03-13',
      endDate: '2021-03-20',
      roomCount: 2,
      tripLength: 7,
      starRating: 5
    }
  ],
  moduleId: '',
  tagName: ''
}

Step 4: Call the Function Based on Vertical

After constructing the event tracking object, use the appropriate function based on the tenant type (vertical) to format and process the event. Pass the event object as the parameter to ensure accurate tracking.

// For Vertical Airlines
formatter.formatAirlines(eventObject);

// For Vertical Hospitality
formatter.formatHotels(eventObject);

// For Vertical Events
formatter.formatEvents(eventObject);

These functions are designed to handle specific verticals and ensure proper formatting of the event object. Here's a brief explanation of the process:

  • Handling Missing Fields: If the event object is missing values for certain keys, the respective keys will be assigned empty values during the formatting process.

  • Handling Null Values: Null values in the event object will be converted to an empty string during the formatting process.

  • Handling Multiple Values: If 'eventExperience' contains multiple values (e.g., "The Lounge," "Player Pod"), the function will format them to "MULTIPLE."

  • Pushing to the dataLayer: After formatting, the resulting data will be pushed to the dataLayer, making it ready for further processing and analysis by analytics tools.

Ensure you choose the correct function based on your application's vertical to maintain consistency in data formatting and tracking. Customize the event object and parameters as needed for your specific tracking requirements.

πŸ““ Constructing the Event Object

Events let you measure user interactions on your app; for example, you can measure when someone, clicks on a button or interacts with a filter. The data from events is used to create reports.

Step 1: Select the Empty Event Object by Vertical

Identify the appropriate empty event object template based on the vertical or category of the event you intend to track. Different verticals may require specific information to be captured.

const eventObject = {
  event: '',
  module: '',
  eventAction: '',
  actionLabel: '',
  airlineIataCode: '',
  journeyType: '',
  originAirportIataCode: '',
  destinationAirportIataCode: '',
  route: '',
  currencyCode: '',
  totalPrice: 0,
  totalPriceUSD: '',
  fareClass: '',
  departureDate: '',
  returnDate: '',
  daysUntilFlight: 0,
  tripLength: 0,
  isFlexibleDates: '',
  discountCode: '',
  deeplinkSiteEdition: '',
  miles: '',
  timestamp: '',
  url: '',
  passenger: [
    {
      count: 1,
      adultCount: 1,
      youngAdultCount: '',
      childCount: '',
      infantInLapCount: '',
      infantInSeatCount: ''
    }
  ],
  page: [
    {
      siteEdition: '',
      countryIsoCode: '',
      languageIsoCode: '',
      pageTypeName: ''
    }
  ],
  lodging: [
    {
      cityCode: '',
      name: '',
      startDate: '',
      endDate: '',
      roomCount: 0,
      tripLength: 0,
      starRating: 0 
    }
  ],
  carRentals: [
    {
      provider: '',
      brand: '',
      model: ''
  }
 ],
  moduleId: '',
  tagName: ''
}
const eventObject = {
  event: '',
  module: '',
  eventAction: '',
  actionLabel: '',
  tenantCode: '',
  tenantType: '',
  regionName: '',
  countryCode: '',
  cityName: '',
  propertyCode: 0,
  propertyName: '',
  currencyCode: '',
  totalPrice: 0,
  totalPriceUSD: 0,
  startDate: '',
  endDate: '',
  daysUntilBooking: 0,
  tripLength: 0,
  roomAccesibility: true,
  timestamp: '',
  url: '',
  guest: [
    {
      count: 0,
      adult: 0
    }
  ],
  room: [ 
    { 
      count: 0, 
      type: '' 
    } 
  ],
  page: [
    {
      siteEdition: '',
      countryIsoCode: '',
      languageIsoCode: '',
      pageTypeName: ''
    }
  ],
}
const eventObject = {
  event: '',
  module: '',
  eventAction: '',
  actionLabel: '',
  tenantCode: '',
  tenantType: '',
  regionName: '',
  countryCode: '',
  cityName: '',
  propertyCode: 0,
  propertyName: '',
  currencyCode: '',
  totalPrice: 0,
  totalPriceUSD: 0,
  startDate: '',
  endDate: '',
  daysUntilBooking: 0,
  tripLength: 0,
  roomAccesibility: true,
  timestamp: '',
  url: '',
  guest: [
    {
      count: 0,
      adult: 0
    }
  ],
  room: [ 
    { 
      count: 0, 
      type: '' 
    } 
  ],
  page: [
    {
      siteEdition: '',
      countryIsoCode: '',
      languageIsoCode: '',
      pageTypeName: ''
    }
  ],
}

Step 2: Decide Which Events to Track in the 'event' and 'eventAction' Fields

Determine the key events you want to track and assign them to the 'event' and 'eventAction' fields. These fields define the type of user interaction and the specific action taken and take identical values. For example:

const eventObject = {
  event: 'viewable_impression',
  module: 'em-booking-popup',
  eventAction: 'viewable_impression',
  ...
};

Adjust the values of 'event' and 'eventAction' to accurately reflect the nature of your tracked events. Refer to Types of Events below for more information.

Step 3: Set Up Event Parameters

The event object includes several parameters to provide detailed context to a specific event for better analysis. For instance:

const eventObject = {
  event: 'viewable_impression',
  module: 'em-booking-popup',
  eventAction: 'viewable_impression',
  actionLabel: '',
  airlineIataCode: 'UL',
  journeyType: 'ONE_WAY',
  originAirportIataCode: 'CMB',
  destinationAirportIataCode: 'SIN',
  route: 'CMB>SIN',
  currencyCode: 'LKR',
  totalPrice: 5.21,
  ...
};

Refer to Event Object Parameters below for a detailed explanation of each parameter, and which ones are required.

Types of events

!NOTE Automatically collected events are events that are collected by default. These events include:

  • Pageviews: A pageview is recorded when a user loads a new page
  • Viewable impressions: A viewable impression is recorded when a module is displayed on the user's screen.

Recommended events are events that you implement, but that have predefined names and parameters. These events unlock existing and future reporting possibilities. The following is a list of recommended events that you can track using the tracking package:

EventDescription
viewable_impressionAn element is seen on the user's browser
fsiFlight search initiation
open_booking_popupPopup clicked
select_originOrigin (From) field updated
select_destinationDestination (To) field updated
select_departure_dateDeparture date field updated
select_return_dateReturn date field updated
select_journey_typeJourney type field updated
select_milesUser changes the miles limit
expand_formUser expands the form in the booking popup
collapse_formUser collapses form in the booking popup
sortThe sort toggle is used on the FC
more_dealsThe user clicks to see more deals than the ones displayed in the FC
select_tabUser selects tab in pricing modules
filter_airlinesUser filter for selected airlines (STAR)
select_budgetA budget was selected
select_fare_classUser changes fare class in the module. This includes branded classes such as "Basic Economy", "Main Cabin", "Economy Light", etc.
collapse_histogramUser collapses the histogram
select_monthUser selects the month in the histogram or calendar
expand_flightUser expands flight information in the flight schedule module
reset_filterClear button clicked
toggle_farelistUser interacts with the toggle of the farelist modules
select_map_destinationMap destination clicked
selected_travel_interestA travel interest was selected
select_interestUser selects travel interest (Tracking Package)
click_outUser clicks on one link of the content module
read_articleUser clicks on an article of the content module
select_locationUser performs a search in the bus directory module
searchA search was initiated
select_statusStatus is updated in the route status tracker module
select_stopsUser filters for the number of stops in the map module
select_articleAn article was selected
select_resident_statusResident status was selected
no_fares_availableThe FC does not have fares to display
insert_first_nameFirst name field updated
insert_last_nameLast name field updated
insert_emailEmail field updated
insert_phone_numberPhone number field updated
subscribeSubscription option selected
enter_promo_codePromo code field updated
EventDescription
viewable_impressionAn element is seen on the user's browser
search_initiationSearch initiation
open_booking_popupPopup clicked
more_dealsThe user clicks to see more deals than the ones displayed in the FC
select_originOrigin (From) field updated
select_trip_lengthUser selects stay length of the trip
sortThe sort toggle is used on the FC
select_ratingHotel rating filter is used
select_destinationDestination (To) field updated
select_budgetA budget was selected
reset_filterClear button clicked
select_nightNumber of nights filter is updated
select_propertyHotel property updated
select_start_dateHotel check-in date updated
select_end_dateHotel check-out date updated
select_room_guestHotel guests field updated
select_accessibilityUser marks the accessibility check box in the module
select_redemptionUser selects redemption as payment method
select_stay_lengthUser selects stay length of the trip
select_offerSpecial offer is selected in the low fares calendar
no_fares_availableThe FC does not have fares to display
insert_first_nameFirst name field updated
insert_last_nameLast name field updated
insert_emailEmail field updated
insert_phone_numberPhone number field updated
subscribeSubscription option selected
enter_promo_codePromo code field updated
EventDescription
viewable_impressionAn element is seen on the user's browser
search_initiationSearch initiation
open_booking_popupPopup clicked
select_dateEvent date updated
select_sessionEvent sessions field updated
select_categoryEvent category selected
select_experienceEvent experience field updated
select_locationEvent location field updated
select_budgetA budget was selected
sortSorting option selected
reset_filterClear button clicked
no_fares_availableThe FC does not have fares to display
insert_first_nameFirst name field updated
insert_last_nameLast name field updated
select_originOrigin (From) field updated
insert_emailEmail field updated
insert_phone_numberPhone number field updated
subscribeSubscription option selected
enter_promo_codePromo code field updated

Custom events are events that you define. Make sure to only create custom events when no other events work for your use case. Custom events do not show up in most standard reports and require a custom request for meaningful analysis. (we give guidelines in case nothing on our list is appropriate)

To track a custom event, simply add in the event object an event action name and/or module name that is not on the recommended list.

The event object must contain the following properties:

  • event and eventName: The name of the event. Both fields have the same value.
  • module: The name of the module.

For example, the following event object would track a custom event called "product_detail_clicked" for a new module ':

const eventObject = {
  event: 'product_detail_clicked',
  module: '',
  eventAction: 'product_detail_clicked',
  ...
  }

!NOTE Guidelines for tracking custom events

When tracking custom events, it is important to follow the following guidelines:

  • Use descriptive event names. This will help you to easily identify and analyze your event data.
  • Avoid tracking too many custom events. This can make your event data difficult to analyze.
  • Only track custom events that are important to your business. This will help you to focus on the most important events and to get the most out of your tracking data.

Event Object Parameters

This section provides a detailed explanation of the parameters used in the event object, along with their examples, definitions, and whether they are required.

  • The parameters marked as required need to be inluded in all events.

  • The viewable-impression events will only collect the required parameters.

  • The interaction events, such as select-departure-date, will only populate the relevant parameters to the event itself and what has already been filtered in the module.

ParameterExampleDefinitionRequired
eventT_123456Name of the event performedYes
moduleem-booking-popupName of the moduleYes
eventActionviewable_impressionName of the event action used in GA ReportsYes
actionLabel...Populated based on what was selected in the user interaction. See details below.Optional
tenantCodeHDITenant CodeYes
tenantTypehotelTenant Type (Hotel, Airline, Event)Yes
currencyCodeUSDThe currency (in 3-letter ISO 4217 format) of the priceYes
totalPrice399.37The total price for the reservation or ticket, including applicable taxes, shipping, etcYes
totalPriceUsd530.62The total price for the reservation or ticket in USD, including applicable taxes, shipping, etc.Yes
startDate2022-04-01Date of check-inYes
endDate2022-04-07Date of check-outYes
timestamp2021-02-16T17:41:43.200ZTimestamp of the event sentYes
urlhttps://www.example.comFull URL in lowercase (without query parameters to avoid collecting personal data by mistake)Yes
adultCount, youngAdultCount, childCount1Amount of adult/young adult/child passengersYes
count3Amount of guests for a specific categoryYes
siteEditionen-HKSite edition combination of ISO codes for language and country. The country reflects the marketYes
countryIsoCodeHKCountry code (in 2 letter codes from ISO 3166-1)Yes
languageIsoCodeenLanguage ISO 629-1 codeYes
tagName*Name given by Standard Fare Modules or Front Components. *Required if there is a name or tag associated with the module other than the module name. E.g. A module that only displays miles and has been named "Miles"No
discountCodeAFFBFANDiscount promotion codeOptional
pageTypeNameCUSTOM_PAGEName of the type of page templateNo
ParameterExampleDefinitionRequired
airlineIataCodeAAIATA identifier for the airlineYes
journeyTypeONE_WAYTrip type (ROUND_TRIP, ONE_WAY, MULTI_CITY)Yes
originAirportIataCodeSFOIATA identifier for the departure/origin airportYes
destinationAirportIataCodeJFKIATA identifier for the arrival/destination airportYes
routeSFO>JFKRoute of the trip from origin to destinationYes
currencyCodeUSDThe currency (in 3-letter ISO 4217 format) of the priceYes
totalPrice399.37The total price for the flight ticket, including applicable taxes, shipping, etcYes
totalPriceUsd530.62The total price for the flight ticket in USD, including applicable taxes, shipping, etc.Yes
fareClassECONOMYFare class type (ECONOMY, BUSINESS, PREMIUM_ECONOMY, FIRST)Yes
departureDate2022-04-01Date of departureYes
returnDate2022-04-07Date of returnYes
daysUntilFlight25Amount of days from the current date to the departure dateYes
tripLength5Length of stay / tripYes
isFlexibleDatestrueTrue/false value if flexible dates are selected for flightsYes
discountCode*AFFBFANDiscount promotion codeOptional
deeplinkSiteEditionen-HKSite edition combination of ISO codes for language and country provided in the URLYes
miles25790Flight distance in milesYes
timestamp2021-02-16T17:41:43.200ZTimestamp of the event sentYes
urlFull URL in lowercase (without query parameters to avoid collecting personal data by mistake)Yes
adultCount, youngAdultCount, childCount1Amount of adult/young adult/child passengersYes
infantInLapCount1Amount of infant passengers in lapYes
infantInSeatCount1Amount of infant passengers in seatYes
count3Amount of passengers for a specific categoryYes
siteEditionen-HKSite edition combination of ISO codes for language and country. The country reflects the marketYes
countryIsoCodeHKThe country code (in 2-letter codes from ISO 3166-1)Yes
languageIsoCodeenThe language ISO 629-1 codeYes
cityCodeSINThe city code for the selected property (in 2-letter codes from ISO 3166-1)Yes
nameIntercontinentalName of the selected property.Yes
startDate2021-03-13Date of check-inYes
endDate2021-03-20Date of check-outYes
roomCount2Amount of rooms selectedYes
tripLength7Length of stay/tripYes
starRating5An official rating for the propertyYes
moduleIdXADPLIK7890Unique ID used for the module. Only required for DPAYes - for DPA modules only
tagNameName given to Standard Fare Modules (SFM) / Front Components (FC)Yes - if there is a name or tag associated with the module other than the module name. E.g., A module that only displays miles and has been named "Miles".
providerHertzName of the car rental companyOptional - Required only if there is car rental information available
brandBMWMake of the rental carOptional - Required only if there is car rental information available
model530iModel of the rental carOptional - Required only if there is car rental information available
ParameterExampleDefinitionRequired
emcidT-123456Unique identifierYes
tenantCodeHDITenant CodeYes
tenantTypehotelTenant Type (Hotel, Airline, Event)Yes
moduleopen-booking-popup-abstractName of the eventYes
actionLabelopen-booking-popupName of the event actionYes
regionNameNorth AmericaName of the region for the selected property (North America, South America, East Asia...)Yes
countryCodeUSThe country code for the selected property (in 2 letter codes from ISO 3166-1)Yes
cityNameMiamiName of the city for the selected property (Miami, Orlando, Tampa...)Yes
propertyCodeHYATT9015479Code of the selected property (Hotel code, event code...)Yes
propertyNameHolidayInn-MiamiName of the selected property. e.g Name of the Hotel (Holiday Inn - Miami, Hyatt Regency Hong Kong...)Yes
currencyCodeUSDThe currency (in 3-letter ISO 4217 format) of the price.Yes
totalPrice399.37The total price for the reservation or ticket, including applicable taxes, shipping, etcYes
totalPriceUsd530.62The total price for the reservation or ticket in USD, including applicable taxes, shipping, etc.Yes
startDate2022-04-01Date of check inYes
endDate2022-04-07Date of check outYes
daysUntilBooking25Amount of days from the current date to the startDate (Check-in date)Yes
tripLength5Length of stay / tripYes
roomAccesibilityfalseRoom accessibility requirementYes
timestamp2021-02-16T17:41:43.200Ztimestamp of the event sentYes
urlhttps://www.holidayinn.com/miamiFull url in lowercase (without query parameters to avoid collecting personal data by mistake)Yes
adult1Amount of adult guestsYes
child1Amount of child guestsYes
count (in guest array)3Amount of guests for a specific categoryYes
count (in room array)Amount of rooms selectedYes
typeSuiteRoom typeYes
pageTypeCodeCIPage Type Code: HP, CICO, FCI, TCI, CICI, COCI, COCO, FCO, TCO, EXT, CP, 404, SM, BS, FS, FAYes
siteEditionen-HKSite edition combination of ISO codes for language and country. The country reflects the marketYes
countryIsoCodeHKThe country code (in 2 letter codes from ISO 3166-1)Yes
languageIsoCodeenThe language ISO 629-1 codeYes
tagNameName given to Standard Fare Modules (SFM) / Front Components (FC)Yes - if there is a name or tag associated with the module other than the module name. E.g., A module that only displays miles and has been named "Miles".
discountCodeAFFBFANDiscount promotion codeYes
pageTypeNameCUSTOM_PAGEName of the type of page templateYes
ParameterExampleDefinitionRequired
tenantCodeHDITenant CodeYes
tenantTypehotelTenant Type (Hotel, Airline, Event)Yes
eventsearch_initiationName of the eventYes
moduleopen-booking-popup-abstractName of the interacted moduleYes
eventActionsearch_initiationName of the event action used in Google Analytics Reports. It is the same value as the β€œevent” field.Yes
actionLabelBook NowName of the event actionYes
eventNameSemifinalName of the EventYes
eventLocationLaver ArenaLocation for the selected EventYes
eventSessionNightTime of the Event sessionYes
eventExperienceCategoryTicket OnlyName of the selected experience categoryYes
eventNameFilterSemifinalName of the filtered EventYes
eventLocationFilterLaver ArenaName of the filtered Event locationYes
eventSessionFilterNightName of the filtered sessionYes
eventExperienceCategoryFilterTicket OnlyName of the filtered experience categoryYes
eventExperienceFilterMULTIPLETypes of Event experiences selectedYes
currencyCodeUSDThe currency (in 3-letter ISO 4217 format) of the price.Yes
totalPrice399.37The total price for the reservation or ticket, including applicable taxes, shipping, etcYes
totalPriceUsd530.62The total price for the reservation or ticket in USD, including applicable taxes, shipping, etc.Yes
startDate2022-04-01Date of check inYes
endDate2022-04-07Date of check outYes
timestamp2021-02-16T17:41:43.200Ztimestamp of the event sentYes
urlhttps: //www.srilankan.com/en-lk/Full url in lowercase (without query parameters to avoid collecting personal data by mistake)Yes
adultCount, youngAdultCount, childCount1Amount of adult/young adult/child passengersYes
count3Amount of guests for a specific categoryYes
siteEditionen-HKSite edition combination of ISO codes for language and country. The country reflects the marketYes
countryIsoCodeHKThe country code (in 2 letter codes from ISO 3166-1)Yes
languageIsoCodeenThe language ISO 629-1 codeYes
tagName*Name given by Standard Fare Modules or Front Components.Yes - if there is a name or tag associated with the module other than the module name. E.g., A module that only displays miles and has been named "Miles".
discountCodeAFFBFANDiscount promotion codeYes
pageTypeNameCUSTOM_PAGEName of the type of page templateYes

How to populate the actionLabel parameter

The 'actionLabel' serves as a descriptive label, tracking what was specifically selected based on the event. For instance, when the event is 'select-interest,' the 'actionLabel' might capture values like 'snorkeling.'

EventAction Label
select-budget1000
select-interestsnorkeling
select-destinationMIA
select-departure-date2023-04-01
  • Note that for select-destination and select-departure-date the values will also have to be included in the relevant event object parameters.

Examples

const eventObject = {
  event: 'viewable_impression',
  module: 'em-booking-popup',
  eventAction: 'viewable_impression',
  actionLabel: '',
  airlineIataCode: 'UL',
  journeyType: 'ONE_WAY',
  originAirportIataCode: 'CMB',
  destinationAirportIataCode: 'SIN',
  route: 'CMB>SIN',
  currencyCode: 'LKR',
  totalPrice: 5.21,
  totalPriceUSD: '',
  fareClass: 'ECONOMY',
  departureDate: '2021-03-13',
  returnDate: '2021-06-14',
  daysUntilFlight: 25,
  tripLength: 93,
  isFlexibleDates: '',
  discountCode: '',
  deeplinkSiteEdition: '',
  miles: '',
  timestamp: '2021-02-16T00:00:00.000Z',
  url: 'https: //www.srilankan.com/en-lk/',
  passenger: [
    {
      count: 1,
      adultCount: 1,
      youngAdultCount: '',
      childCount: '',
      infantInLapCount: '',
      infantInSeatCount: ''
    }
  ],
  page: [
    {
      siteEdition: 'en-LK',
      countryIsoCode: 'LK',
      languageIsoCode: 'en',
      pageTypeName: 'CUSTOM_PAGE'
    }
  ],
  lodging: [
    {
      cityCode: 'SIN',
      name: 'Intercontinental',
      startDate: '2021-03-13',
      endDate: '2021-03-20',
      roomCount: 2,
      tripLength: 7,
      starRating: 5
    }
  ],
  carRentals: [
    {
        provider: Hertz,
        brand: BMW,
    model: 530i
    }
  ],
  moduleId: '',
  tagName: '',
}
const eventObject = {
  event: 'viewable_impression',
  module: 'em-booking-popup-abstract',
  eventAction: 'viewable_impression',
  actionLabel: '',
  tenantCode: 'UL',
  tenantType: '',
  regionName: 'North America',
  countryCode: 'US',
  cityName: 'Miami',
  propertyCode: 105565,
  propertyName: 'N/a',
  currencyCode: 'USD',
  totalPrice: 900.55,
  totalPriceUSD: 900.55,
  startDate: '2022-04-01',
  endDate: '2022-04-07',
  daysUntilBooking: 25,
  tripLength: 4,
  roomAccesibility: true,
  timestamp: '2021-02-16T17:41:43.200Z',
  url: 'https:  //www.hyatt.com/en/miami',
  guest: [
    {
      count: 1,
      adult: 1
    }
  ],
  room: [ 
    { 
      count: 1, 
      type: '' 
    } 
  ],
  page: [
    {
      siteEdition: 'en-LK',
      countryIsoCode: 'LK',
      languageIsoCode: 'en',
      pageTypeName: 'CUSTOM_PAGE'
    }
  ]
}
  const eventObject = {
    'event': 'search_initiation',
    'module': 'em-booking-popup-abstract',
    'eventAction': 'search_initiation',
    'actionLabel': null,
    'tenantCode': 'ETA',
    'eventName': 'Semifinal',
    'eventLocation': 'Laver Arena',
    'eventSession': 'Night',
    'eventExperienceCategory': 'Ticket Only',
    'eventExperience': 'The Lounge',
    'eventNameFilter': 'Semifinal',
    'eventLocationFilter': 'Laver Arena',
    'eventSessionFilter': 'Night',
    'eventExperienceCategoryFilter': 'Ticket Only',
    'eventExperienceFilter': 'MULTIPLE',
    'currencyCode': 'LKR',
    'totalPrice': null,
    'totalPriceUSD': null,
    'startDate': '2021-03-13',
    'endDate': '2021-03-14',
    'timestamp': '2021-02-16T17:41:43.200Z',
    'url': 'https: //www.srilankan.com/en-lk/',
    'passenger': [{
        'count': 1,
        'adultCount': 1,
        'youngAdultCount': null,
        'childCount': null
    }],
    'page': [{
        'siteEdition': 'en-LK',
        'countryIsoCode': 'LK',
        'languageIsoCode': 'en',
        'pageTypeName': 'CUSTOM_PAGE'
    }],
}

πŸ”¨ Testing the Tracking Implementation

!NOTE Tracking Implementation Options:

Understand that legacy modules may employ the Tracking Library (TL), Tracking Package (TP), or both in their implementation. The focus should be on having an "airmodule" data layer for each user interaction, ensuring events are collected in Google Analytics 4 (GA4).

To ensure the proper integration with the Tracking Package, follow these steps to effectively test the event object:

  1. Check the Event Object

Inspect the event object by typing tp_debug=true in the browser console. This will allow you to view the event object and identify any issues. This feature is available for implementations of the tracking package version 1.4.3 and above. You can check the Tracking Package version by typing tp_v in the console.

Additional note on verifying search_initiation events:

In addition to the steps above, before performing the search, run this in the console to avoid redirection to the search results page:

window.onbeforeunload = function (e) { e = e || window.event; return ''; }

That will prompt a popup to appear asking if you want to change pages. Just click "Cancel" and you should be able to see the details.

  1. Inspect the Data Layer

Interact with the modules as users would and observe the corresponding data layer events in the console. To inspect the formatted result, open your browser's console and type "dataLayer." This action will reveal the structured data layer, allow

1.7.0

9 days ago

1.6.9

15 days ago

1.6.4

18 days ago

1.6.8

18 days ago

1.6.7

18 days ago

1.6.6

18 days ago

1.6.5

18 days ago

1.6.3

21 days ago

1.6.2

1 month ago

1.6.1

2 months ago

1.6.0

2 months ago

1.5.1

2 months ago

1.5.0

3 months ago

1.4.11

3 months ago

1.4.10

3 months ago

1.4.9

3 months ago

1.4.8

4 months ago

1.4.7

4 months ago

1.4.6

5 months ago

1.4.5

6 months ago

1.4.4

7 months ago

1.4.3

8 months ago

1.4.2

8 months ago

1.3.10

8 months ago

1.3.11

8 months ago

1.3.9

8 months ago

1.3.8

8 months ago

1.3.7

8 months ago

1.3.6

8 months ago

1.3.5

9 months ago

1.3.4

9 months ago

1.3.3

9 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

11 months ago

1.2.19

11 months ago

1.2.20

11 months ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.11

1 year ago

1.2.16

11 months ago

1.2.17

11 months ago

1.2.14

1 year ago

1.2.15

1 year ago

1.2.18

11 months ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.0

2 years ago

1.2.1

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.9-vg-test

2 years ago

1.1.9

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.11-vg-test

2 years ago

1.1.10-vg-test

2 years ago

1.1.12-vg-test

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago