Pro Feature: This functionality 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 customers' 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.
3. Contact & Trip Inquiry Forms - This event fires when a visitor submits the embedded Contact or Trip Inquiry form on your website. It captures the following details:
type: inquirySent
event_name: Inquiry Sent
event_category: Trip Inquiry Form" | Contact Form
trip_name: Trip title, or empty for contact form
trip_link: Public trip URL, or empty for contact form
✅ The Advantage: Tracking Contact Form and Trip Inquiry Form submissions helps you see which visitors are actively expressing interest in your business or a specific trip. By tracking these events, you can measure interest earlier in the customer journey, identify which marketing channels are driving qualified inquiries, and follow up with potential travelers more effectively.
For instructions on embedding custom WeTravel widgets on your website, visit the Embedding Widgets into your Website page in our Help Center.
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)
For tracking Contact Form and Trip Inquiry Form submissions, you will also need to use WeTravel's embedded widgets on your site.
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 initializing Listener for events #########
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 #########
}
if (data.type === "inquirySent") {
// ######### START Custom Form submissions event #########
gtag("event", "Inquiry Sent", {
event_category: data.event_category, // "Trip Inquiry Form" or "Contact Form"
trip_name: data.trip_name,
trip_link: data.trip_link,
});
// ######### END Custom Form submissions 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 Book Now Button Click 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).
Do I have to use WeTravel's embedded "Contact Form" and "Tip Inquiry Form" on my website for this to work?
Yes, if you want to track WeTravel form submissions using this advanced tracking method. The tracking code is designed to work with WeTravel’s embedded Contact Form and Trip Inquiry Form because those embedded forms can communicate with your website when a visitor submits an inquiry.
If you want to track non-WeTravel forms on your website, such as a custom form or a form from another provider, you’ll need to set that up separately within your own website or tracking tool. WeTravel’s tracking code will not automatically track forms that are not powered by WeTravel.
For Google Ads, is the booking confirmation page URL the same for all bookings, or does it change?
The URL doesn’t change during the booking process because the entire transaction takes place within the WeTravel pop-up widget on your site. Since the customer never leaves your website, there’s no separate "Thank You" page URL to track. However, the purchase event will still be tracked when using the embedded Book Now button, as it’s designed to trigger the event automatically within the widget.
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.
Events are tracking twice: Confirm that you've switched your settings to "Advanced Web Analytics", located on your WeTravel Profile settings.
🚨 Important: This feature can only be set up and managed by the admin on the account. Team members cannot access it.

