Woopra Documentation

Cross-Domain Tracking

Mobile app to a subdomain to the website and back again!

In this guide, we'll cover how you can track visitors in Woopra across all of your domains and sub-domains.

It's now fairly common for businesses to break down their applications into smaller parts by using different domains and sub-domains. This could be part of a marketing promotion, the learning portal for your product or even the company blog.

Fortunately, Woopra provides cross-domain and sub-domain tracking, so that you can track these visitors and continue to monitor the customer journey.

When you are working with unique domains, you can track visitors in a few different ways. You can track visitors using multiple Woopra projects and keep this data separate, or alternatively, you can send all of your customer data to a single project.

The second option is the Woopra preferred method for customer tracking, as this will provide a full customer journey and offers the most actionable insights for your business.

This guide will be covering the latter of these two methods, it will delve into the configuration required and detail the steps needed to successfully begin utilizing cross-domain or sub-domain tracking.

Cross-Domain Tracking

The importance of cross-domain tracking is to not only store your data in a single project, but to also maintain a visitors session when they explore unique domains. The events of previously identified visitors should be monitored and associated with the same customer profile, regardless of the domain they visit. This is the key to providing a comprehensive customer journey.

When a visitor visits an alternate domain, the cookies associated with that visitor are inaccessible, which causes split profiles in your Woopra project. Without the cookie to associate to the visitor, Woopra has no way of knowing that the visitor on the new domain is the same as the visitor from the previous domain. Woopra would require the visitor to again identify themselves by signing up to an email list or logging in to the platform.

This is the problem that cross-domain tracking solves. When configured correctly, Woopra will attach the cookie value to the url of all specified domains, allowing it to associate that cookie with the visitor from your previous domain.

Your Woopra configuration will require an update of your provided JavaScript Tracking code. In some instances, when using a different SDK, the tracking code will be different, but in this guide we will cover the implementation for our JavaScript tracking SDK.

The provided tracking code and woopra.config() will look as follows:

<!-- Start of Woopra Code -->
  (function(){ var t,i,e,n=window,o=document,a=arguments,s="script",r=["config","track","identify","visit","push","call","trackForm","trackClick"],c=function(){var t,i=this;for(i._e=[],t=0;r.length>t;t++)(function(t){i[t]=function(){return i._e.push([t].concat(Array.prototype.slice.call(arguments,0))),i}})(r[t])};for(n._w=n._w||{},t=0;a.length>t;t++)n._w[a[t]]=n[a[t]]=n[a[t]]||new c;i=o.createElement(s),i.async=1,i.src="//static.woopra.com/js/w.js",e=o.getElementsByTagName(s)[0],e.parentNode.insertBefore(i,e)

    domain: 'project-name.com'   
<!-- End of Woopra Code -->

Throughout the rest of this guide, we will show you the necessary woopra.config() alterations you will need to make within this tracking snippet.

URL Decoration Method

To get started with cross-domain tracking, you will need to configure your project as normal, setting the domain property in your woopra.config() to your current project name. But, you will also need to add the additional property cross_domain and specify the alternate domains you want to track.

The configuration for your primary domain will be as follows:

  domain: 'primary-domain.com', 
  cross_domain: 'secondary-domain.com' 

The configuration for your secondary domain will need some slight adjustment, with both domains being configured to the primary domain of your Woopra project.

  domain: 'primary-domain.com', 
  cross_domain: 'primary-domain.com' 

Cross-domain tracking will alter all outbound links to your secondary domain and attach the visitors cookie value to them. With the cookie value attached, Woopra can then recognize the visitor from the primary domain and associate this visit with the already created people profile within Woopra.

In the event you have multiple domains and would like to track users across all of them, you are able to assign an array of domain names to the cross_domain property.

Your woopra.config() will be configured as follows:

  domain: 'primary-domain.com', 
  cross_domain: ['secondary-domain.com', 'third-domain.com', 'fourth-domain.com'] 

Similar to the URL Decoration tracking configuration, you will then need to update all other domains setting the cross_domain property to show your primary project name as well as the other domains you wish to track.

  domain: 'primary-domain.com', 
  cross_domain: ['primary-domain.com', 'third-domain.com', 'fourth-domain.com'] 

As with the URL Decoration method of tracking, Woopra will attach the visitors cookie value to the url of each domain specified in the cross_domain property array.

With the cookie in place, Woopra can then attribute that visitor as the same visitor on each domain.

Sub-Domain tracking

The set up when tracking sub-domains is a little different to tracking unique domains.

While the process looks the same, slight alterations need to be made in your woopra.config() to achieve the desired results.

To track all sub-domains associated with your domain and store this data within a single project, you can do that by adding the cookie_domain property to your woopra.config().

As you can see from the code snippet below, your domain property value remains the same, but you will need to pass in the cookie_domain property in addition to your project name. This value is your Woopra projects name with a period in front of that value.

  domain: 'primary-domain.com',
  cookie_domain: '.primary-domain.com'    

For example, if your Woopra project name is google.com, your cookie_domain value will be '.google.com'.

Unlike when cross-domain tracking, you do not need to add these domains individually to your Woopra configuration, Woopra will do this automatically.

3rd-Party Cookie Method (Enterprise Only)

The 3rd-party cookie method requires little to no set up, nor does it require advanced changes to be made to your Woopra configuration in order to implement. This method is most commonly used by businesses when their visitors are anonymous and have not been identified using woopra.identify() .

Woopra will essentially store your visitors cookie values, from different domains, and associate these cookie values with each of your individual visitors. With this tracking method, visitors will not need to click links on your website in order to be tracked across all of your domains.

Our 3rd-party cookie method sound like the answer to all your questions, but they do have their limitations.

This method only works roughly 60% of the time, due to the more common use of tracking blockers and JavaScript being disabled on browsers. To give you some additional background, Chrome, which is the World's most popular browser, has 3rd-party cookies enabled by default, but Safari on the other hand, that is shipped with the macOS High Sierra, has 3rd-party cookies automatically blocked, so this option will not work for new Safari users.

It's important to understand your use case in order to identify the optimum method for your business.

Also worth noting, 3rd-party cookie tracking is easy to get rolling, the team at Woopra will take care of all the dirty work required, but it's important to note that this tracking method is an Enterprise only offering.

Which method should you use?

If your visitors are being identified on each of your domains, then there is no need for you to over-complicate your configuration with cross-domain tracking.

Woopra will use the email address or specified internal ID to consolidate your visitor profiles, across all domains. But that's unlikely to be the case for most of Woopra customers who run their business on multiple domains.

If your visitors are not getting identified on each of your domains, there are three questions we need to ask:

1. Are all my domains sharing the same main domain?

This is the typical subdomain use case and it's the easiest to solve.

You will simply need to update the woopra.config() to store the visitors cookie on your main project domain.

So, if your main domain is mybusiness.com (http://mybusiness.com/) and you have content on subdomains such as docs.mybusiness.com, app.mybusiness.com (http://app.mybusiness.com/) and status.mybusiness.com, you should use the Sub-domain tracking method.

2. Are visitors navigating between those domains by clicking on links that lead to the other domain?

If this is the case, we recommend using the URL decoration method, which is built into the Woopra tracker configuration, or your woopra.config().

In this instance, the URL Decoration method is most reliable because it will transfer the cookie value to the end of the query string of the new domain. Woopra will then automatically grab this cookie value from the URL and store it in the new domain.

3. Are visitors anonymous and not likely to navigate between multiple domains?
If your visitors are always anonymous and are not likely to navigate between multiple domains (that's a common case for publishers who have different domains), then we recommend using the 3rd-party cookie method.

Note: Remember this method is only available to our enterprise customers.

This method should be your final option to use, since it tends to be less accurate than the other solutions. Based on the industry benchmarks, this method will work for about 60% of the users on the web, depending on whether the 3rd-party cookies are enabled in your visitors browsers.

Chrome, which is the most popular browser, has that feature enabled by default. The last version of Safari that is shipped with the macOS High Sierra has 3rd-party cookies automatically blocked, so this option will not work for new Safari users.

This is everything you need to know to begin tracking your domains. Storing your analytics in one place allows you to understand your entire customer journey, and allows for more complete and reliable insights.

Cross-Domain Tracking

Mobile app to a subdomain to the website and back again!