Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Tracker/TrackerCodeGenerator.php')
-rw-r--r--core/Tracker/TrackerCodeGenerator.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/Tracker/TrackerCodeGenerator.php b/core/Tracker/TrackerCodeGenerator.php
index fbf4b4c2be..c985db88e7 100644
--- a/core/Tracker/TrackerCodeGenerator.php
+++ b/core/Tracker/TrackerCodeGenerator.php
@@ -172,13 +172,23 @@ class TrackerCodeGenerator
}
// We need to parse_url to isolate hosts
$websiteHosts = array();
+ $firstHost = null;
foreach ($websiteUrls as $site_url) {
$referrerParsed = parse_url($site_url);
- $websiteHosts[] = $referrerParsed['host'];
+
+ if (!isset($firstHost)) {
+ $firstHost = $referrerParsed['host'];
+ }
+
+ $url = $referrerParsed['host'];
+ if (!empty($referrerParsed['path'])) {
+ $url .= $referrerParsed['path'];
+ }
+ $websiteHosts[] = $url;
}
$options = '';
- if ($mergeSubdomains && !empty($websiteHosts)) {
- $options .= ' _paq.push(["setCookieDomain", "*.' . $websiteHosts[0] . '"]);' . "\n";
+ if ($mergeSubdomains && !empty($firstHost)) {
+ $options .= ' _paq.push(["setCookieDomain", "*.' . $firstHost . '"]);' . "\n";
}
if ($mergeAliasUrls && !empty($websiteHosts)) {
$urls = '["*.' . implode('","*.', $websiteHosts) . '"]';