Conversion Tracking
There are three options by which partners can provide conversion data to Wego:
Conversion tracking pixel
An alternative to the conversion report is a conversion tracking pixel. The Wego conversion pixel is a small piece of code that is embedded on your site which is called whenever a user converts or makes a purchase on your site. This allows us greater visibility on conversions.
Process flow steps
- User Redirects from Wego to a Partner's website.
- Partner site stores the
wego_click_idfrom the deeplink URL. If you can't findwego_click_id, please contact your account manager. - User Purchases a ticket from the partner.
- User is then redirected to Thank you/Confirmation page.
- Partner's 'Thank you' page calls the Wego pixel code.
- This pixel calls Wego's system and conversion information is recorded in the Wego system.
Pixel implementation
The Conversion Pixel is served from Wego's secure server (zen.wego.com, srv.wego.com). So it should not produce any security warnings or errors within users' browsers. Implementation process should take no more than 15-20 minutes.
Implementation Options
You can implement the Pixel in 3 different ways:
- JavaScript Pixel Library - Full-featured implementation with automatic data collection for both Pre-Conversion and Conversion tracking
- Image Pixel - Lightweight implementation using HTML
<img>tags - Server to Server (Recommended) - Backend integration where events are sent directly from your server to ensure reliable delivery
1. JavaScript Pixel Library
Add this code snippet to the <head> section of every page where you want to track events:
<!-- Wego Events Pixel -->
<script>
!function(w,e,g,o,n,a,m){
w['WegoEventsObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments)},w[n].l=1*new Date();
a=e.createElement(g),m=e.getElementsByTagName(g)[0];
a.async=1;a.src=o;m.parentNode.insertBefore(a,m)
}
(window,document,'script','https://zen.wego.com/partner/js/wegoevents.js','wego');
// Initialize the pixel with conversion_id (required, a unique Partner's identifier in the Wego system)
wego('init', {{CONVERSION_ID}});
</script>
Replace {{CONVERSION_ID}} with your partner's identifier. Please request this id from your Wego account manager if not provided.
When run, this code will download a library of functions which you can then use for pre-conversion tracking. We recommend that you leave this function call intact.
JS Pixel Example
The pixel can be triggered by calling the function in the sample below once the script is initialized.
Note: conversion_id auto-included from init, wego_click_id auto-fetched from URL query param wego_click_id
wego('track','conversion', {
transaction_id: {{TRANSACTION_ID}},
total_booking_value: {{TOTAL_BOOKING_VALUE}},
bv_currency_code: {{BOOKING_CURRENCY_CODE}},
commission: {{COMMISSION}},
comm_currency_code: {{COMM_CURRENCY_CODE}},
provider_conversion_source_type: 'JS_PIXEL'
});
In case your handoff links uses a different tracking parameter name for the wego_click_id, you can manually pass the click_id in the function as well:
wego('track', 'conversion', {
click_id: {{WEGO_CLICK_ID}},
transaction_id: {{TRANSACTION_ID}},
total_booking_value: {{TOTAL_BOOKING_VALUE}},
bv_currency_code: {{BOOKING_CURRENCY_CODE}},
commission: {{COMMISSION}},
comm_currency_code: {{COMM_CURRENCY_CODE}},
status: {{STATUS}},
provider_conversion_source_type: 'JS_PIXEL'
});
2. Image Pixel Implementation
If you need to install the Pixel using a lightweight implementation, you can install it with an <img> tag. This method is ideal for simple tracking scenarios where you don't need advanced features.
Image Pixel Example
<img src="https://srv.wego.com/genzo/v2/conversions?
conversion_id={{CONVERSION_ID}}
&click_id={{WEGO_CLICK_ID}}
&transaction_id={{TRANSACTION_ID}}
&total_booking_value={{TOTAL_BOOKING_VALUE}}
&bv_currency_code={{BOOKING_CURRENCY_CODE}}
&commission={{COMMISSION}}
&comm_currency_code={{COMM_CURRENCY_CODE}}
&status={{STATUS}}"
width="1" height="1" border="0" alt="">
Paste the code into the HTML source of the booking confirmation page. This should be the page that the customer sees after making a successful booking (the final booking confirmation page). Ensure that this code does not appear on other pages.
Here is an example of a partner deeplink URL from where you can obtain the click_id from wego_click_id param. In this case, the click_id is 554468965s2h73d5:providercode:00 and the transaction_id is MNHVRG. If you are unsure of obtaining the partner specific deeplink url, please check with your account manager.
Example:
https://partnersite.com/booking?origin=RUH&destination=JED¤cy=USD&departureDate=12062018&returnDate=12072018&adultCount=1&childCount=0&infantCount=0&wego_click_id=554468965s2h73d5:providercode:00
Please note that the combination of click_id and transaction_id must be unique and shouldn't change for the same booking.
Example:
<img
src="https://srv.wego.com/genzo/v2/conversions?
conversion_id=c-wego-partnerid
&click_id=554468965s2h73d5:providercode:00
&transaction_id=MNHVRG
&total_booking_value=1000
&bv_currency_code=SGD
&commission=30
&comm_currency_code=USD
&status=confirmed"
width="1"
height="1"
border="0"
/>
3. Server to Server Implementation (Recommended)
Send tracking events directly from your backend services. This approach mirrors the Image Pixel method, but the request is made from your server rather than the user's browser. It improves reliability and ensures events are captured even if client-side code fails or users block pixels.
Server to Server Example
https://srv.wego.com/genzo/v2/conversions?
conversion_id={{CONVERSION_ID}}
&click_id={{WEGO_CLICK_ID}}
&transaction_id={{TRANSACTION_ID}}
&total_booking_value={{TOTAL_BOOKING_VALUE}}
&bv_currency_code={{BOOKING_CURRENCY_CODE}}
&commission={{COMMISSION}}
&comm_currency_code={{COMM_CURRENCY_CODE}}
&status={{STATUS}}
How to test the Conversion Pixel code
- First, make a handoff from Wego to your site.
- Complete a booking successfully.
- Send a
transaction_idto your Wego account manager, so we can verify that conversion was successfully tracked.
Solutions for common implementation problems
- Check for spelling mistakes / typos / wrong encoding.
- If you are using server-side programming to fill in the required values, make sure you are passing correct values.
- If all else fails, please send over the pixel code you have implemented to your Wego Account Manager for troubleshooting.
Parameters
| Field | Value Type | Required | Parameter Description |
|---|---|---|---|
conversion_id | string | yes | a unique Partner's identifier in the Wego system (constant value). Please request this id from your wego account manager if not provided. |
click_id | string | yes | retrieve from deeplink URL. The parameter can be renamed based on Partner's requirement. |
transaction_id | string | yes | an identifier that the Partner can use to associate the conversion with its booking (for example, PNR). This ID has to be unique for each booking. i.e. when page refreshes and the pixel's code is being called again, the transaction_id should be the same. |
total_booking_value | string | yes | total value of the customer's booking. Use numbers 0-9 and period "." for decimal point. DO NOT use commas or any non-numeric characters. |
bv_currency_code | string | yes | the ISO 4217 3-letter currency code for the total_booking_value. |
commission | string | yes | Wego's commission for the booking. Use numbers 0-9 and period "." for decimal point. DO NOT use commas or any non-numeric characters. Do not add % sign to indicate percentage in the value. |
comm_currency_code | string | yes | the ISO 4217 3-letter currency code for the commission. |
status | string | yes | status of the booking (confirmed/cancelled/pending). |
Conversion report
The conversion report allows us (Wego) to see the list of conversions (bookings) made by our users on your website. Conversion report is provided by Partner to Wego on a near real-time basis (preferably, the information in your conversion report should appear in 15-30 minutes after a user has submitted a booking on your website).
We prefer conversion report to be accessed via a specific data source (such as a URL or a Web service) in XML/JSON format.
Required attributes
Conversion report should contain the following attributes:
conversion_date- conversion date/time.click_id- retrieve from deeplink URL. The parameter can be renamed based on Partner's requirement.transaction_id- an identifier that the Partner can use to associate the conversion with its booking (for example, PNR). This ID has to be unique for each booking.commission- Wego's commission for the booking. Use numbers 0-9 and period "." for decimal point. DO NOT use commas or any non-numeric characters. Do not add % sign to indicate percentage in the value.total_booking_value- total value of the customer's booking. Use numbers 0-9 and period "." for decimal point. DO NOT use commas or any non-numeric characters.comm_currency_code- the ISO 4217 3-letter currency code for the commission.bv_currency_code- the ISO 4217 3-letter currency code for the total_booking_value.status- status of the booking (confirmed/cancelled/pending).provider_code- the partner provider code.site_code- the site/POS code.
Here is an example of a partner deeplink URL from where you can obtain the click_id from wego_click_id param. In this case, the click_id is 554468965s2h73d5:providercode:00 and the transaction_id is MNHVRG. If you are unsure of obtaining the partner specific deeplink url, please check with your account manager.
Example:
https://partnersite.com/booking?origin=RUH&destination=JED¤cy=USD&departureDate=12062018&returnDate=12072018&adultCount=1&childCount=0&infantCount=0&wego_click_id=554468965s2h73d5:providercode:00
Conversion report request example
GET [your_domain]/conversion_report.xml?dateStart=2018-01-01&dateEnd=2018-02-31&partner=wego&password=password
Conversion report response example
<conversions>
<conversion>
<conversion_date>2017-01-31 19:28:19</conversion_date>
<click_id>47225944-38d6-4ffb-a7ba-a5a6aea982dd:22</click_id>
<transaction_id>3JU9W8</transaction_id>
<commission>478.4</commission>
<total_booking_value>9568.00</total_booking_value>
<comm_currency_code>THB</comm_currency_code>
<bv_currency_code>THB</bv_currency_code>
<status>confirmed</status>
<provider_code>booking.com</provider_code>
<site_code>SG</site_code>
</conversion>
<conversion>
<conversion_date>2017-01-31 20:38:42</conversion_date>
<click_id>89743987-38d6-4ffb-a7ba-a5a6aea982dd:17</click_id>
<transaction_id>3JRGJS</transaction_id>
<commission>542.85</commission>
<total_booking_value>10857.00</total_booking_value>
<comm_currency_code>THB</comm_currency_code>
<bv_currency_code>THB</bv_currency_code>
<status>confirmed</status>
<provider_code>booking.com</provider_code>
<site_code>SG</site_code>
</conversion>
<conversion>
<conversion_date>2017-01-31 21:14:30</conversion_date>
<click_id>6988793-38d6-4ffb-a7ba-a5a6aea982dd:147</click_id>
<transaction_id>ICOWRU</transaction_id>
<commission>1137.5</commission>
<total_booking_value>22750.00</total_booking_value>
<comm_currency_code>THB</comm_currency_code>
<bv_currency_code>THB</bv_currency_code>
<status>pending</status>
<provider_code>booking.com</provider_code>
<site_code>SG</site_code>
</conversion>
</conversions>
Google Tag Manager
Please find the instructions to implement the pixel conversion tag via GTM here