Pro Only: This feature is available on the Pro plan. You can find more information here: How to update and manage your WeTravel subscription?
WeTravel’s Advanced Conversion Tracking with Google Analytics Events allows you to seamlessly track and attribute bookings from "Book Now" buttons to their original traffic sources.
By integrating your GA4 event tracking with WeTravel's embedded checkout, you can capture key insights, measure the effectiveness of your marketing efforts, and gain a complete view of your customer's journey from the initial click to booking a trip.
Note: This is an advanced feature. We highly recommend hiring a professional to set up this feature on your website if you lack the experience to do it yourself.
Key Events Tracked
This integration allows you to measure customer engagement and conversion by tracking two key events:
1. Booking Confirmed (purchase) - This event is triggered when a customer successfully completes a booking. It captures key transaction details:
Transaction_id: A unique ID for tracking the transaction in Google Analytics.
Value: The total purchase amount.
Currency and Payment: The payment method, payment option, and currency used for the transaction.
Items: Includes trip details like trip ID, packages, discount codes, add-ons, and price.
Traffic Source: The original traffic source and the booking page URL.
✅ The Advantage: Tracking purchase events allows you to see exactly which marketing efforts lead to bookings, helping you optimize ad spend and focus on the highest-converting channels.
2. Book Now Click (Book Now Button Click) - This event fires when a visitor clicks the "Book Now" embedded checkout button on your website. It captures the following details:
event_category: buttonWidget
event_label: Trip title
Location: Website page where the button is located
Referrer: The traffic source that brought the visitor to the page
✅ The Advantage: Tracking "Book Now" clicks helps you measure customer interest and identify which marketing channels drive the most engagement. By comparing clicks to purchases, you can uncover drop-off points in the booking process and refine the visitor experience to increase conversions.
Before You Begin
This guide assumes you have:
A Google Analytics 4 (GA4) account and property already created.
A web data stream set up for your website. ([GA4] Set up Analytics for a website and/or app)
You are using WeTravel's embedded checkout process with "Book Now" buttons on your website. (How to embed a 'Book Now' button into your website)
Step 1: Enable Advanced Web Analytics on WeTravel
Navigate to your WeTravel Profile page.
Scroll down to the WeTravel Pro Settings section and click "Add" next to Google Analytics.
In the pop-up window, select Advanced Web Analytics. You do not need to enter your Google tag ID here, as the tracking will be handled by the code on your website.
Click "Confirm" to save the changes.
Step 2: Insert the Tracking Code into Your Website’s Header
To capture the events from the WeTravel widget, you need to add the following JavaScript code snippet to the <head> section of your website's HTML.
🚨 Remember to replace G-XXXXXXXXXX with your actual GA4 Measurement ID.
Note: The tracking script must be placed in the header of your own website to capture events from the embedded “Book Now” buttons. It will not be added to the WeTravel platform.
<!-- Google tag initializing (gtag.js) | TODO: Adjust Tracking Id -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
// ######### START configuring GA (ignore if you already have this part) #########
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX'); // TODO: Adjust Tracking Id
// ######### END configuring GA #########
// ######### START initializing Listener for events #########
const eventMethod = window.addEventListener
? 'addEventListener'
: 'attachEvent';
const eventer = window[eventMethod];
const messageEvent = eventMethod === 'attachEvent' ? 'onmessage' : 'message';
eventer(messageEvent, (e) => {
var data = e.data;
if (data.type === 'bookingConfirmed') {
// ######### START Tracking Booking Conformation event #########
gtag('event', 'purchase', {
transaction_id: data.order_id,
value: data.total_amount,
currency: data.currency,
items: [
{
affiliation: 'WeTravel',
item_id: data.trip_uuid,
item_name: data.trip_title,
item_category: data.trip_category,
quantity: 1,
price: data.total_amount,
},
],
});
// ######### END Tracking Booking Conformation event #########
}
if (e.data.type === 'bookNowClicked') {
// ######### START Tracking Book Now Button Click event #########
gtag('event', 'Book Now Button Click', {
event_category: data.source,
event_label: data.trip_title,
});
// ######### END Tracking Book Now Button Click event #########
}
});
// ######### END initializing Listener for events #########
</script>
[Optional] Step 3: Connect Google Ads to Google Analytics
Once you are tracking purchase events in GA4, you can import them into Google Ads as conversions. This allows you to measure the direct impact of your ad campaigns on sales.
Link Your Accounts:
In Admin, under Product links, click Google Ads links.
Click Link.
Click Choose Google Ads accounts, then select the Google Ads accounts you want to link. If you don't see the Google Ads account you want to link, you may not have the required permissions.
Click Confirm.
Enable Auto-Tagging: Ensure auto-tagging is enabled in your Google Ads account.
For a detailed, step-by-step guide, please refer to the official Google Help Article: ➡️ [GA4] Connect Google Ads to Google Analytics
Frequently Asked Questions (FAQ)
How can I test if the tracking is working correctly?
The best way to test is by using the DebugView and Realtime reports in your Google Analytics 4 property.
Open your website page where the WeTravel button is embedded.
In a separate tab, open Google Analytics and navigate to Admin > Data display > DebugView.
Go back to your website and click the "Book Now" button. You should see the begin_checkout event appear in DebugView.
If you complete a test booking, the purchase event should also appear.
Do I have to use the embedded "Book Now" buttons on my website for this to work?
Yes. This advanced tracking method depends on communication between the WeTravel widget and your website. It only works if the “Book Now” button or widget is embedded directly on your site. It won’t work if you're sending customers to a WeTravel-hosted trip page via a direct link (e.g., on wetravel.com).
For Google Ads, is the booking confirmation page URL the same for all bookings, or does it change?
The URL does not change because the entire booking process happens within the WeTravel pop-up widget on your website. The customer never leaves your site, so there is no unique "thank you" page URL to track.
Troubleshooting Common Issues
You use Google Tag Manager (GTM) instead of the G-tag: The script provided is for a standard gtag.js implementation. This integration is not compatible with Google Tag Manager (GTM).
Tracking isn't working for some events: Double-check that you are using the embedded "Book Now" buttons on your website. If you are using direct links to your WeTravel trip page or registering a participant on your trip manually, the script on your website will not track these events.
Events aren’t firing: Confirm the tracking script includes your correct G-Tag and is placed in the <head> section of your website’s HTML. If it’s added to the <body> or <footer>, it may not load early enough to capture events properly.