Hi,
At what points in the booking process do you need to run tracking codes?
Thread Starter
nostro
(@nostro)
Hi,
the moment when the user clicks “book now” button / get’s the “thanks for your booking” message. The easiest thing would be to link to a “thank-you” page, but the “thank you” message gets displayed directly in the same page.
Thanks for helping us out on this one, I’ve spent days trying to figure it out, and it’s really important for our project.
If you add this snippet to the functions.php file of your theme, it should redirect users to a thank you page:
function my_em_booking_redirect(){
?>
jQuery(document).bind('em_booking_success', function() {
window.location.href = "PAGE";
});
<?php
}
add_action('em_gateway_js', 'my_em_booking_redirect');
Make sure you change PAGE to the full URL of the page, which can be a standard page in WordPress. You can add something like this
if (is_page('thank-you'){
// tracking code here
}
to the header.php file of your theme to run the tracking code only on the thank you page.
Thread Starter
nostro
(@nostro)
Thanks Caimin!
This works like a charm and is very useful to track conversions on google analytics and other sites.
Sorry for the late reply though.
Thanks again,
M.