setDomains

The setDomains() method sets a list of domains that will be tracked as one site or app. Use the same tracking code for each of these domains.

Syntax

setDomains(domains)
 setDomains(domains): void
 setDomains(domains): void
 setDomains(domains): void
 setDomains(domains): void
 setDomains(domains): void
 setDomains(domains): void

Parameters

domains (array , required)

A list of domains that are tracked as one site or app. Domains can contain a wildcard character ("*") or leading dot.

Examples

To set a list of domains example.com and example.co.uk to be tracked as one site or app:

_paq.push(\["setDomains", [".example.com", ".example.co.uk"]]);
ClientConfiguration.setDomains(domains);
ClientConfiguration.setDomains(domains);
ClientConfiguration.setDomains(domains);
ClientConfiguration.setDomains(domains);
ClientConfiguration.setDomains(domains);
ClientConfiguration.setDomains(domains);

Notes

  • Listed domains won't be treated as outlinks.
  • Listed domains get the pk_vid parameter to pass the visitor ID between them when you use enableCrossDomainLinking().
  • For the links that are added dynamically, you need to call enableLinkTracking() each time.

Related methods