Cross-domain tracking allows you to seamlessly track and attribute orders across multiple domains using specific URL parameters. This ensures accurate order tracking and campaign performance measurement, even if your ecommerce store and marketing campaigns are on subdomains while customers check out on your main Shopify domain.
Accurate cross-domain tracking is essential for accurately attributing customer actions—such as purchases—to the appropriate originating domain. This guide will walk you through how to implement cross-domain tracking using the OptiMonkEmbedded.getCrossDomainTrackingParams()
function.
Example Use Case
If a user starts their journey on store.sissora.com
and completes a purchase on sissora.com
, the tracking parameters attached to the redirect URL allow OptiMonk to identify the original domain. As a result, the purchase is correctly attributed to the campaign running on store.sissora.com
.
Follow these steps to ensure seamless tracking across domains.
How to set up Cross-Domain Tracking
When a user interacts with an OptiMonk popup on a domain where tracking is desired (e.g., store.sissora.com
), you can use the OptiMonkEmbedded.getCrossDomainTrackingParams()
function to generate the necessary parameters for tracking. These parameters include information about the user, session, and originating domain, allowing OptiMonk to attribute actions to the correct source.
Here’s an example of the parameter list generated by the function:
optiMonkClientId=ac8aaa80-a0d5-8115-6a8e-7bfc22b6538d&providerServiceId=store.sissora.com&provider=shopify&url=https%3A%2F%2Fwww.store.sissora.com%2F&visitorInExperiment=%5B%5D
Step-by-Step Implementation
1. Generate Tracking Parameters
On the domain where you want to track actions (e.g., store.sissora.com
), call the following function in your script:
const trackingParams = OptiMonkEmbedded.getCrossDomainTrackingParams();
This function returns a URL-encoded string containing the tracking parameters.
2. Append Parameters to the URL
When redirecting the user to another domain (e.g., sissora.com
), append the generated parameters to the URL as a query string. For example:
https://sissora.com/checkouts/?optiMonkClientId=ac8aaa80-a0d5-8115-6a8e-7bfc22b6538d&providerServiceId=store.sissora.com&provider=shopify&url=https%3A%2F%2Fwww.store.sissora.com%2F&visitorInExperiment=%5B%5D
Important Notes
- Shopify-Only Support: This functionality is currently only available for Shopify orders. The purchase must be completed using the Shopify checkout system to ensure proper tracking.
- Thorough Testing Required: Before deploying cross-domain tracking, thoroughly test the implementation to confirm that all actions are tracked and attributed correctly.
Following this guide, you can effectively implement cross-domain tracking, ensuring reliable and comprehensive data attribution across your domains.
✉️ If you need any further help or have any questions, please let us know at support@optimonk.com, and we would be happy to assist you :)
Comments