URL Decoration Method

Two Domains

Since 3rd party cookies are phased out in most of today's browsers, the URL decoration method works by appending the woopra_id to the URL when users navigate from one domain to another. Woopra's code then extracts the ID from the domain so all the events are sent to the same profile in Woopra -- otherwise, without the URL decoration method, the pageview events will cause a split profile.

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. 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:

woopra.config({ 
  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.

woopra.config({ 
  domain: 'primary-domain.com', 
  cross_domain: 'primary-domain.com' 
});

Over Two Domains

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:

woopra.config({ 
  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.

woopra.config({ 
  domain: 'primary-domain.com', 
  cross_domain: ['primary-domain.com', 'third-domain.com', 'fourth-domain.com'] 
});

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.

Hiding the woopra_id from the URL

To hide the woopra_id, you can add a line to the woopra.config()

woopra.config('hide_xdm_data', true)

This line will automatically remove the woopra_id so the end user doesn't see this in the URL.