SETUP > SITES > CONVERSION-TRACKING
Tracking Conversions Pro
If you use Google Analytics to track the sources of your website traffic, you can also use it to track which users make a booking on Bedful, which units and extras they choose to book, and how much they spend. Once the integration is set up and correctly configured, Bedful will send specific events to your Google Analytics property - when someone clicks 'Go' on the calendar widget, and an eCommerce event when a customer makes a booking.
Please note, this feature is optional, and requires Bedful Pro. Google Analytics show where the customer was online prior to booking. Returning customers tend to go via Google Search for efficiency. The Google Analytics Tracking ID is used to send e-commerce events to your Google Analytics property. This action is triggered when the booking is confirmed, and details of the booking will be sent to your Google Analytics including the price paid.
Prerequisites
In order to set up conversion tracking, you must have:
- Your Google Analytics tracking code, e.g. 'UA-123456-1', which can be found in the settings of your Google Analytics account. Please provide this code to your Bedful account manager, who will add it to your booking system.
- The ability to edit the HTML and JavaScript on your website. Your web developer may be able to help you with this.
Setting up Google Analytics
You should configure your Google Analytics property to have the following features switched on and settings applied:
- Ensure that you have eCommerce tracking switched on. This is required to track how many users complete the booking flow, and to record the amount they are spending.
- Add 'bedful.com' to the referral exclusion list on your property. This is required to ensure that the original source of the user is preserved (organic search, advertising campaign, social media etc.)
- Add 'Stripe.com' to the referral exclusion list on your property to avoid erroneously logging customers who return to your website after making a booking payment.
Setting up your website
To track conversions correctly, you will have to adjust the HTML code of your website in two places. The following snippets are provided as a guide to be customised, you may have to consult your web developer if your website or Google Analytics setup varies.
At the point where the Google Analytics tracker is created on the page, please ensure that auto-linking is switched on for the tracker, and bedful.com is auto-linked.
ga('create', 'UA-123456-1', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['bedful.com']);
At the point where the Bedful calendar widget is loaded on the page, you should use JavaScript to inject the linking parameter into the iframe URL. This is necessary to tie the booking to the original user that landed on your website. Note that this code must be executed after the iframe is loaded on the page, and you may have to adjust it for your purposes depending on the configuration of your website. You can either delay execution until after page load, or insert the script at the bottom of the page.
var linkerParam = '';
ga(function(tracker) {
linkerParam = tracker.get('linkerParam');
});
var iframe = document.getElementsByClassName('cc-booking-widget')[0];
iframe.src = iframe.src + '&' + linkerParam;
If you have any questions about setting up the Google Analytics integration, please contact us.
Caveats
Note that Google Analytics tracking will not register any users using an ad-blocker or other method to block tracking scripts, so be careful to turn off adblockers before testing, and bear in mind that Google Analytics statistics are limited to users who choose to send google data.