diff options
Diffstat (limited to 'core/Tracker/TrackerCodeGenerator.php')
-rw-r--r-- | core/Tracker/TrackerCodeGenerator.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/Tracker/TrackerCodeGenerator.php b/core/Tracker/TrackerCodeGenerator.php index ac958e6102..79b80e8bf1 100644 --- a/core/Tracker/TrackerCodeGenerator.php +++ b/core/Tracker/TrackerCodeGenerator.php @@ -46,7 +46,8 @@ class TrackerCodeGenerator $customCampaignKeywordParam = null, $doNotTrack = false, $disableCookies = false, - $trackNoScript = false + $trackNoScript = false, + $crossDomain = false ) { // changes made to this code should be mirrored in plugins/CoreAdminHome/javascripts/jsTrackingGenerator.js var generateJsCode @@ -62,9 +63,18 @@ class TrackerCodeGenerator if ($groupPageTitlesByDomain) { $options .= ' _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);' . "\n"; } + if ($crossDomain) { + // When enabling cross domain, we also need to call `setDomains` + $mergeAliasUrls = true; + } if ($mergeSubdomains || $mergeAliasUrls) { $options .= $this->getJavascriptTagOptions($idSite, $mergeSubdomains, $mergeAliasUrls); } + + if ($crossDomain) { + $options .= ' _paq.push(["enableCrossDomainLinking"]);' . "\n"; + } + $maxCustomVars = CustomVariables::getNumUsableCustomVariables(); if ($visitorCustomVariables && count($visitorCustomVariables) > 0) { |