We'll walk you through the steps you need to take to get Coveo Qubit set up on your site for Experimentation Hub clients working in the travel vertical.
This guide is recommended for Experimentation Hub clients looking to implement our Smartserve script (required to drive basic data collection) and those essential QProtocol events required to drive experiences, segmentation, and analytics.
Don't forget to checkout our Events page for the full QP event specification.
Perform these tasks in the following order:
Add on every page:
<script>
!function(){function n(){function n(n){p.level=n}function e(n,e){p.info(n,"event emitted"),e=c(e||{}),e.meta=e.meta||{},e.meta.type=n,u.push(e),r(),v.listeners=f(v.listeners,function(n){return!n.disposed})}function o(n,e,o){function r(){return p.info("Replaying events"),t(function(){s(v.events,function(t){c.disposed||l(n,t.meta.type)&&e.call(o,t)})}),f}function i(){return p.info("Disposing event handler"),c.disposed=!0,f}p.info("Attaching event handler for",n);var c={type:n,callback:e,disposed:!1,context:o||window};v.listeners.push(c);var f={replay:r,dispose:i};return f}function t(n){p.info("Calling event handlers"),a++;try{n()}catch(n){p.error("UV API Error",n.stack)}a--,r()}function r(){if(0===u.length&&p.info("No more events to process"),u.length>0&&a>0&&p.info("Event will be processed later"),u.length>0&&0===a){p.info("Processing event");var n=u.shift();v.events.push(n),t(function(){s(v.listeners,function(e){if(!e.disposed&&l(e.type,n.meta.type))try{e.callback.call(e.context,n)}catch(n){p.error("Error emitting UV event",n.stack)}})})}}function i(n,e,o){var t=v.on(n,function(){e.apply(o||window,arguments),t.dispose()});return t}function s(n,e){for(var o=n.length,t=0;t<o;t++)e(n[t],t)}function c(n){var e={};for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o]);return e}function l(n,e){return"string"==typeof n?n===e:n.test(e)}function f(n,e){for(var o=n.length,t=[],r=0;r<o;r++)e(n[r])&&t.push(n[r]);return t}var u=[],a=0,p={info:function(){p.level>n.INFO||console&&console.info&&console.info.apply(console,arguments)},error:function(){p.level>n.ERROR||console&&console.error&&console.error.apply(console,arguments)}};n.ALL=0,n.INFO=1,n.ERROR=2,n.OFF=3,n(n.ERROR);var v={on:o,emit:e,once:i,events:[],listeners:[],logLevel:n};return v}"object"==typeof module&&module.exports?module.exports=n:window&&void 0===window.uv&&(window.uv=n())}();
</script>
Add on every page:
<script src='https://static.goqubit.com/smartserve-{your-property-id}.js' ></script>
Events are emitted using the UV API and must conform to a certain schema. Events are emitted using JavaScript, usually on page load or when a new view is rendered on a single page app. An example is shown below:
uv.emit('theEventType', {
aStringField: 'theValueWhichMustBeTheCorrectType',
aNumberField: 3,
aBooleanField: false
})
In the following table, we show an indicative breakdown of a website by page type, alongside the events that could be emitted on each page. This represents a typical set up and there may be exceptions:
Page | Events |
---|---|
All | trView, trUser |
Home | trView, trUser |
Product | trView, trUser, trPackageItem, trPackageSummary |
Search results page | trView, trUser, trSearch |
Checkout | trView, trUser, trPackageItemCheckout, trPackageCheckoutSummary |
Confirmation | trView, trUser, trPackageItemTransaction, trPackageTransactionSummary |
In addition to the above events, in the following table we show the events that correspond to common visitor activities, such as registration, login, and search:
Activity | Events |
---|---|
Registration | trUserSignup |
Login | trView,trUserLogin |
Enquiry | trFormSubmission |
Get quote | trFormSubmission |
Newsletter signup | trFormSubmission |
Search | trSearch |
Qubit recommends the following events should be emitted:
These events represent the starting point for setting up Qubit on your site. Additional events are required to drive Qubit's programmatic experiences.
For each of the above events, we identify those fields that are required to integrate with Qubit technology. We also detail other fields that we recommend are emitted for data completeness. For both required and recommended fields, we identify those that apply to all sites and those that only apply to journey, accommodation, ancillary, and experience.
Other Qubit products have different event field requirements, which will be discussed during onboarding.
The trView
event reports a page view and is a special event because it is required by smartserve.js for data collection and processing. It is therefore essential that every page emits an trView
event and that it is emitted before any other event.
DANGER: Any events emitted before the first trView
event are considered invalid. Web and mobile applications emit view events whenever a view is rendered.
Emit trView
on every page.
Field (JS Data Type) | Description |
---|---|
type (String) | The type of view. Can be one of |
subtypes (Array of Strings) | An unordered list of subtypes to describe the view |
language (String) | The language used in this view. Must be an IETF language tag, e.g. |
country (String) | The selected country for the view. Must be an ISO 3166-1 alpha-2 code, e.g. |
currency (String) | The ISO 4217 currency code for the user, e.g. |
uv.emit('trView', {
type: 'home',
subtypes: ['Holidays', 'All Inclusive', 'Luxury'],
language: 'en-us',
country: 'US',
currency: 'USD'
})
null
in the absence of a page typeThe trUser
event is emitted once per view and reports visitor metadata. The event should be emitted on every page as long as there is data available for the user.
For many websites, the event will be present and well populated when the visitor logs on. Websites with a newsletter subscription form that the visitor has previously submitted, might be able to populate the name and email address for the visitor using the data collected on form submission.
user.email
to comply with our internal data privacy policies?In short, yes. Both user Id and email can be hashed. However, please be aware that to ingest data for use in the Qubit platform, the user Id and email in the provided dataset must be hashed in the same way.
Alternatively, you may choose to omit user.email
. The omission of a required field does not prevent the event itself from being sent to Qubit and being processed by our data pipeline-you will see a validation error in the Validation Dashboard for the event though.
For further information about our role as a data processor and our obligations and commitments under GDPR, please refer to Personal Data and in particular How is customer data treated? For legal clarifications, please contact legal@qubit.com.
Emit trUser
events on every page with details of the visitor.
All sites
All sites
Field (JS Data Type) | Description |
---|---|
user.id (String) | A unique user Id. Can be a hash of the username and/or email address |
user.email (String) | The visitor’s primary email address |
user.isGuest (Boolean) | True if the visitor is a guest without a registered account |
user.loyalty.tier (String) | The loyalty program tier that the visitor belongs to |
user.loyalty.tierPoints (Number) | The number of tier points |
user.loyalty.membershipType (String) | The type of loyalty membership |
user.loyalty.membershipPoints (Number) | The number of points for the membership |
uv.emit('trUser', {
user: {
id: 'js123xyz',
email: 'John.Smith@gmail.com',
isGuest: true,
loyalty: {
tier: 'silver',
tierPoints: 10,
membershipType: 'Clearsky Rewards',
membershipPoints: 56
}
}
})
Emitted when a visitor logs in.
INFO: Emit trUserLogin
on successful login with details of the logged in user.
All sites
Field (JS Data Type) | Description |
---|---|
user.id (String) | A unique user Id. Can be a hash of the username and/or email address |
uv.emit('trUserLogin',{
user: {
id: 'joeBloggs',
}
})
Emitted when a visitor signs up for a newsletter or event.
INFO: Emit trUserSignup
on signup with details of the visitor submitting the signup request.
All sites
All sites
Field (JS Data Type) | Description |
---|---|
user.id (String) | A unique user Id. Can be a hash of the username and/or email address |
type (String) | The item that the visitor has signed up for, e.g. |
name (String) | A meaningful name unique to the sign up, e.g. |
uv.emit('trUserSignup',{
user: {
id: "2861102bace6e6620948564f0ce0a7cd",
},
type: 'newsletter',
name: 'weekly signup'
})
Examples of a form submission include getting a quote, subscribing to a newsletter, or contacting customer support.
For travel sites that are non-transactional, for example, those sites that provide quotations, this event is very important as it is used to count conversions.
INFO: Emit trFormSubmission
on form submission with a unique Id to identity the form submission and an accompanying form name.
All sites
Field (JS Data Type) | Description |
---|---|
submissionId (String) | A unique Id to identify the form submission |
name (String) | The name of the submitted form |
uv.emit('trFormSubmission',{
submissionId: 'ContactUs-856',
name: 'ContactUsEnquiry'
})
Emitted when a visitor performs a search on a site. This is a key event because it is usually the first step taken by a visitor when booking a trip and allows you to gather rich information early in the visitor journey, which is very valuable for segmentation.
INFO: Emit trSearch
when a visitor performs a search to identify the search parameters.
All sites
Field (JS Data Type) | Description |
---|---|
searchType (String) | The search type |
numberOfAdults (Number) | The number of adults in the search |
numberOfChildren (Number) | The number of children in the search |
numberOfInfants (Number) | The number of infants in the search |
numberOfStudents (Number) | The number of students in the search |
numberOfTeenagers (Number) | The number of teenagers in the search |
totalNumber (Number) | The total number of travelers in the search |
startTs (Number) | The epoch time in milliseconds for the departure date |
endTs (Number) | The epoch time in milliseconds for the return date |
exactDuration (Number) | The exact number of nights searched for |
minDuration (Number) | The minimum number of nights searched for |
maxDuration (Number) | The maximum number of nights searched for |
exactPrice.value (Number) | The exact price searched for, rounded to 2 decimal places |
exactPrice.currency (String) | The ISO 4217 currency code e.g. |
minPrice.value (Number) | The minimum price searched for, rounded to 2 decimal places |
minPrice.currency (String) | The ISO 4217 currency code e.g. |
maxPrice.value (Number) | The maximum price searched for, rounded to 2 decimal places |
maxPrice.currency (String) | The ISO 4217 currency code e.g. |
origin.country (String) | The country searched for. For a flight, this would be the departure airport or city |
origin.countryCode (String) | The ISO 3166-1 alpha-2 country code that corresponds to the country searched for, e.g. |
origin.region (String) | The region searched for, i.e. state in the USA or county in the UK |
origin.locality (String) | The town or city searched for |
origin.name (String) | A name specific to this location, e.g. |
origin.code (String) | A code specific to this location, e.g. |
destination.country (String) | The country searched for. For a flight, this would be the arrival airport or city |
destination.countryCode (String) | The ISO 3166-1 alpha-2 country code that corresponds to the country searched for, e.g. |
destination.region (String) | The region searched for, i.e. state in the USA or county in the UK |
destination.locality (String) | The town or city searched for |
destination.name (String) | A name specific to this location, e.g. |
destination.code (String) | A code specific to this location, e.g. |
leadTime (Number) | The number of days between the day of the search and the startTs |
boardBasis (Array of Strings) | The type of accommodation board searched for |
roomFacilities (Array of Strings) | The room facilities searched for |
roomTypes (Array of Strings) | The types of rooms searched for |
numberOfRooms (Number) | The number of rooms searched for |
exactRating (Number) | The exact rating of the room searched for |
minRating (Number) | The minimum rating of the room searched for |
maxRating (Number) | The maximum rating of the room searched for |
outboundFares (Array of Strings) | The outbound journey fares searched for |
inboundFares (Array of Strings) | The inbound journey fares searched for |
flexibleDates (Boolean) | Whether the start and end dates are flexible |
results.pagination (Number) | The number of search result items shown per page |
results.resultCount (Number) | The number of returned search items matching the query and/or filters |
results.layout (String) | The user's chosen visual layout for search results, e.g. list, grid, or map |
results.sortBy (String) | The column selected by the visitor to sort columns by |
results.sortDirection (String) | The sort direction for the column selected to sort results by, e.g. ascending,descending |
uv.emit('trSearch',{
searchType: 'One-way Flight',
numberOfAdults: 2,
numberOfChildren: 5,
numberOfInfants: 2,
numberOfStudents: 2,
numberOfTeenagers: 2,
totalNumber: 9,
startTs: 1454585576191,
endTs: 1455926400000,
exactDuration: 16,
minDuration: 1,
maxDuration: 6,
exactPrice: {
value: 9.99,
currency: 'USD'
},
minPrice: {
value: 9.99,
currency: 'USD'
},
maxPrice: {
value: 9.99,
currency: 'USD'
},
origin: {
country: 'Austria',
countryCode: 'AT',
region: 'Carinthia',
locality: 'Villefranche sur saone',
name: 'Ouagadougou Airport',
code: 'LYS'
},
destination: {
country: 'Austria',
countryCode: 'AT',
region: 'Carinthia',
locality: 'Villefranche sur saone',
name: 'Ouagadougou Airport',
code: 'LYS'
},
leadTime: 42,
boardBasis: [
'All Inclusive',
'Room Only'
],
roomFacilities: [
'A/C',
'Wifi',
'Jacuzzi'
],
roomTypes: [
'Royal Suite',
'Single Room'
],
numberOfRooms: 3,
exactRating: 3.5,
minRating: 3,
maxRating: 4.5,
outboundFares: [
'Flexible First Class'
],
inboundFares: [
'Cheap Cheap Economy'
],
flexibleDates: true,
results: {
pagination: 10,
resultCount: 15,
layout: 'grid',
sortBy: 'price',
sortDirection: 'ascending'
}
})
This event is emitted on products pages, which are considered to be outside of the booking/checkout funnel.
Each trPackageItem
event will contain a packageItemType
, which describes either a journey, accommodation, ancillary, or experience.
For packaged holidays, the event will contain a packageItemType
for each part of the package: flight, accommodation, ancillary(ies), experience.
A booking that only includes flights, would typically contain 1 packageItemType
, with the value journey
for the outbound flight and another packageItemType
for the inbound flight, as shown in the following example:
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'journey',
journey: {
journeyType: 'outbound'
}
}
})
Refer to the following table for a few example scenarios showing how to emit this event:
Vertical | Package | Package item type |
---|---|---|
Transportation | One-way flight | 1 journey package item |
Transportation | Return flight | 2 journey package items |
Transportation | Multi-city flight | 1 journey package item for each leg |
Transportation | One-way flight London to Sydney, stopover in Dubai | 1 journey package item |
Hospitality | Hotel stay | 1 accommodation package item |
Packaged Holiday | Package | 2 journey package items |
See Explanation of Package Types for more information.
Emit trPackageItem
events on product detail pages for each package item shown.
All sites
Ancillary
All sites
Journey
Accommodation
Ancillary
Experience
In the following example, we detail the schema structure of the trPackageItem
event. This schema will be extended with the fields that correspond to the packageItemType
implemented:
Field (JS Data Type) | Description |
---|---|
package.id (String) | An Id unique to the trip/package |
eventType (String) | The type of package item event, e.g. |
packageItem.id (String) | An Id unique to the package item |
packageItem.packageItemType (String) | Describes the type of package item, e.g. |
In the following example, we show an example of the trPackageItem
event:
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201218',
packageItemType: 'journey'/'accommodation'/'ancillary'/'experience' // each packageType will have a set of fields for that specific type
}
})
journey
Field (JS Data Type) | Description |
---|---|
journey.id (String) | An Id unique to the journey |
journey.journeyType (String) | The type of journey, whether it’s inbound or outbound |
journey.originName (String) | The name that corresponds to the departure point, e.g. Heathrow |
journey.originCode (String) | The origin code, IATA for airports |
journey.destinationName (String) | The name that corresponds to the arrival point, e.g. |
journey.destinationCode (String) | The destination code, IATA for airports |
journey.departureTs (Number) | The departure epoch time in milliseconds |
journey.arrivalTs (Number) | The arrival epoch time in milliseconds |
journey.price.value (Number) | The price of the journey, rounded to 2 decimal places |
journey.price.currency (String) | The ISO 4217 currency code e.g. |
journey.fare (String) | The fare class chosen for this journey |
journey.originCountry (String) | The origin country |
journey.destinationCountry (String) | The destination country |
journey
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'journey',
journey: {
id: 'FL0989',
journeyType: 'outbound',
originName: 'John F Kennedy International',
originCode: 'JFK',
destinationName: 'Los Angeles International',
destinationCode: 'LAX',
departureTs: 1454585859331,
arrivalTs: 1454595869331,
price: {
value: 299.99,
currency: 'USD'
},
fare: 'Premium Cabin',
originCountry: 'United States of America',
destinationCountry: 'United States of America'
}
}
})
accommodation
Field (JS Data Type) | Description |
---|---|
accommodation.id (String) | An Id unique to the journey |
accommodation.rating (Number) | The average rating of the accommodation, between 0 and 10 |
accommodation.normalizedRating (Number) | A normalized rating between 0 and 1, e.g. 6/10 is normalized to 0.6 |
accommodation.stars (Number) | The number of stars awarded to the accommodation |
accommodation.boardBasis (String) | The board basis for the accommodation, e.g. |
accommodation.travelLocation.country (String) | The country of the accommodation |
accommodation.travelLocation.locality (String) | The town or city of the accommodation |
accommodation.travelLocation.name (String) | A name specific to this location |
accommodation.travelLocation.code (String) | A code specific to this location |
accommodation
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'accommodation',
accommodation: {
id: 'AC221144',
rating:6,
normalizedRating: 0.4,
stars: 4,
boardBasis: 'All inclusive',
travelLocation: {
country: 'United States',
region: 'New York',
locality: 'Manhatten',
code: 'NYCMAN'
}
}
}
})
ancillary
In the following example schema, we present details of a few of the possible types of ancillaries.
Typically, for all ancillary types, you would emit an id
and type
.
Field (JS Data Type) | Description |
---|---|
ancillary.ancillaryType (String) | The type of ancillary, e.g. |
ancillary.insurance.id (String) | An Id unique to the insurance ancillary |
ancillary.insurance.type (String) | The type of insurance, e.g. |
ancillary.insurance.coverage (Number) | The number of insurance policies booked e.g. if travel insurance policies were selected for 2 people, this would be |
ancillary.luggage.id (String) | An Id unique to the luggage ancillary |
ancillary.luggage.type (String) | The type of luggage in the ancillary, e.g. |
ancillary.luggage.weight (Number) | The max weight of the luggage ancillary, in kilograms |
ancillary.seats.id (String) | An Id unique to the seats ancillary |
ancillary.seats.type (String) | The type of seat booking, e.g. |
ancillary.seats.tier (String) | The seating class |
ancillary.seats.seatNumber (Array of Strings) | The seat numbers booked |
ancillary.priority.id (String) | An Id unique to the priority ancillary |
ancillary.type (String) | The type of priority this ancillary provides |
ancillary
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'ancillary',
ancillary: {
ancillaryType: 'insurance',
insurance: {
id: 'INS1234',
type: 'Travel Insurance',
coverage: 2
}
}
}
})
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'ancillary',
ancillary: {
ancillaryType: 'luggage',
luggage: {
id: 'LUG123',
type: 'Carry on',
weight: 32
}
}
}
})
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'ancillary',
ancillary: {
ancillaryType: 'seats',
seats: {
id: 'SEAT123',
type: 'Free upgrade',
tier: 'Economy Plus',
seatNumber: [
'1A',
'35D',
'35E'
]
}
}
}
})
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'ancillary',
ancillary: {
ancillaryType: 'priority',
priority: {
id: 'PRIO123',
type: 'Priority Boarding'
}
}
}
})
uv.emit('trPackageItem',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201215',
packageItemType: 'ancillary',
ancillary: {
ancillaryType: 'vehicleRental',
vehicleRental: {
id: 'VEHIO123',
type: 'Standard Vehicle Rental',
vendor: 'Excellent Rental Company'
}
}
}
})
experience
Field (JS Data Type) | Description |
---|---|
experience.id (String) | An Id unique to the experience |
experience.name (String) | The name of the experience |
experience.location.country (String) | The country where the experience takes place |
experience.location.locality (String) | The town or city where the experience takes place |
experience.location.name (String) | A name specific to the location of the experience |
experience.location.code (String) | A code specific to the location of the experience |
experience.startTs(Number) | The start epoch time in milliseconds |
experience.endTs (Number) | The finish epoch time in milliseconds |
experience
uv.emit('trPackageItem',{
package: {
id: 'TRP201220'
},
eventType: 'detail',
packageItem: {
id: 'TRP201221',
packageItemType: 'experience',
experience: {
id: 'TRP201228',
name: 'An amazing winter experience',
location:{
country: 'Finland',
locality: 'Helsinki',
name: 'Helsinki City',
code: 'HelCC',
},
startTs: 1454585859331,
endTs: 1454595869331
}
}
})
This event is similar to trPackageItem but is emitted on the checkout page and therefore inside the booking/checkout funnel.
Emit trPackageItemCheckout
events on checkout pages for each package item the visitor has in their package.
All sites
Ancillary
All sites
Journey
Accommodation
Experience
Field (JS Data Type) | Description |
---|---|
package.id (String) | An Id unique to the trip/package |
eventType (String) | The type of package item event, e.g. |
packageItem.id (String) | An Id unique to the package item |
packageItem.packageItemType (String) | Describes the type of package item, e.g. |
uv.emit('trPackageItemCheckout',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201216',
packageItemType: 'journey'/'accommodation'/'ancillary' // each packageItemType will have a set of fields for that specific type
}
})
This event is similar to trPackageItem but is emitted on the confirmation page and contains additional fields for transaction data.
Transaction events are very important because they report revenue for your website.
This event collects granular information about individual items contained within a transaction. It enables segmentation based on preferences, including destinations, journey type, etc.
Emit trPackageItemCheckout
events for each package item the visitor has purchased.
All sites
Ancillary
Journey
Accommodation
Experience
Field (JS Data Type) | Description |
---|---|
package.id (String) | An Id unique to the trip/package |
eventType (String) | The type of package item event, e.g. |
packageItem.id (String) | An Id unique to the package item |
packageItem.packageItemType (String) | Describes the type of package item, e.g. |
transaction.id (String) | A unique transaction Id |
uv.emit('trPackageItemTransaction',{
package: {
id: 'TRP201214'
},
eventType: 'detail',
packageItem: {
id: 'TRP201216',
packageItemType: 'journey'/'accommodation'/'ancillary' // each packageItemType will have a set of fields for that specific type
},
transaction: {
id: '83748372'
}
})
This event contains all of the high-level information about the viewed/selected/purchased package and is the equivalent of a shopping basket summary.
The package Id should capture information for the whole package and not just the package items. Where there is a single package item, the information for the package and package item might be the same.
Emit trPackageSummary
events for each package shown on a product detail page and once per pageview/context.
All sites
Field (JS Data Type) | Description |
---|---|
package.id (String) | An Id unique to the trip/package |
package.numberOfAdults (Number) | The number of adults in the package |
package.numberOfChildren (Number) | The number of children in the package |
package.numberOfInfants (Number) | The number of infants in the package |
package.totalNumber (Number) | The total number of people in the package |
package.startTs (Number) | The epoch time in milliseconds for the package start |
package.endTs (Number) | The epoch time in milliseconds for the package en |
package.duration (Number) | The duration of the package in nights |
package.name (String) | The name of the package |
package.type (String) | The type of package, e.g. |
package.total.value (Number) | The total cost of the package, including tax and discounts, rounded to 2 decimal places |
package.total.currency (String) | The ISO 4217 currency code e.g. |
uv.emit('trPackageSummary',{
package: {
id: 'TRP201214',
numberOfAdults: 2,
numberOfChildren: 2,
numberOfInfants: 1,
totalNumber: 5,
startTs: 1454585576191,
endTs: 1455926400000,
duration: 16,
name: 'Winter wonderland',
type: 'packaged holiday',
total: {
value: 2199.99,
currency: 'USD'
}
}
})
This event is similar to trPackageSummary but is emitted on the checkout page and therefore inside the booking/checkout funnel.
Emit trPackageCheckoutSummary
events on checkout pages for the package the visitor has in their basket.
All sites
Field (JS Data Type) | Description |
---|---|
package.id (String) | An Id unique to the trip/package |
package.numberOfAdults (Number) | The number of adults in the package |
package.numberOfChildren (Number) | The number of children in the package |
package.numberOfInfants (Number) | The number of infants in the package |
package.totalNumber (Number) | The total number of people in the package |
package.startTs (Number) | The epoch time in milliseconds for the package start |
package.endTs (Number) | The epoch time in milliseconds for the package en |
package.duration (Number) | The duration of the package in nights |
package.name (String) | The name of the package |
package.type (String) | The type of package, e.g. |
package.total.value (Number) | The total cost of the package, rounded to 2 decimal places |
package.total.currency (String) | The ISO 4217 currency code e.g. |
step (String) | The current step of the checkout process, e.g. |
uv.emit('trPackageCheckoutSummary',{
package: {
id: 'TRP201214',
numberOfAdults: 2,
numberOfChildren: 2,
numberOfInfants: 1,
totalNumber: 5,
startTs: 1454585576191,
endTs: 1455926400000,
duration: 16,
name: 'Winter wonderland',
type: 'Packaged holiday',
total: {
value: 2199.99,
currency: 'USD'
}
},
step: 'Confirmation'
})
This event is similar to trPackageSummary but is emitted on the confirmation page and includes additional fields for transaction data.
Most importantly, this event is used to count conversions and the associated revenue.
Emit trPackageTransactionSummary
events on confirmation pages for the purchased package.
All sites
All sites
Field (JS Data Type) | Description |
---|---|
package.id (String) | An Id unique to the trip/package |
package.numberOfAdults (Number) | The number of adults in the package |
package.numberOfChildren (Number) | The number of children in the package |
package.numberOfInfants (Number) | The number of infants in the package |
package.totalNumber (Number) | The total number of people in the package |
package.startTs (Number) | The epoch time in milliseconds for the package start |
package.endTs (Number) | The epoch time in milliseconds for the package en |
package.duration (Number) | The duration of the package in nights |
package.name (String) | The name of the package |
package.type (String) | The type of package, e.g. |
package.total.value (Number) | The total cost of the package, including tax and discounts, rounded to 2 decimal places |
package.total.currency (String) | The ISO 4217 currency code e.g. |
transaction.id (String) | A unique transaction Id |
uv.emit('trPackageTransactionSummary',{
package: {
id: 'TRP201214',
numberOfAdults: 2,
numberOfChildren: 2,
numberOfInfants: 1,
totalNumber: 5,
startTs: 1454585576191,
endTs: 1455926400000,
duration: 16,
name: 'Winter wonderland',
type: 'packaged holiday',
total: {
value: 2199.99,
currency: 'USD'
}
},
transaction: {
id: '83748372'
}
})