Cross-domain tracking
Last updated
Last updated
During your first few weeks on Flip.to's Discovery, we conduct A/B tests that rely on cross-domain tracking to measure results accurately. Discovery supports this tracking out-of-the-box. For the Control (your current booking flow without Discovery), you may need an additional snippet of code to set your website up for tracking.
If you use JavaScript to navigate users from your website to your booking engine, this guide will help you complete your implementation of Discovery.
Before you begin: your Flip.to code snippets should already be added to your website. See the guide to if you haven't completed this step.
There are specific ways to set up tracking based on different JavaScript navigation approaches. Look for the approach that you use on your website and apply the appropriate code.
If you use the location.href property to redirect users (can also be location.assign, location.replace, window.open, $.post, or similar), and there is a delay or a user action is required before redirecting:
Add the following code before you redirect the user (using location.href as an example).
If you use a formObject to redirect users (can also be document.form[0].submit(), document.querySelector(“nav.form”).submit, or similar):
Add the following code before you redirect the user (using formObject.submit() as an example).
If you use location.href to redirect users (can also be location.assign, location.replace, window.open, $.post, or similar), and there is no delay and no user action is required before redirecting:
Replace your existing redirect with the following code. Adjust the code for your specific redirect property and preferred timing options (using location.href as an example).
The above shows waiting on fliptoDecorate up to 2 seconds, checking every 100ms.