diff options
author | Clayton Daley <clayton.daley@gmail.com> | 2013-10-15 08:30:23 +0400 |
---|---|---|
committer | Clayton Daley <clayton.daley@gmail.com> | 2013-10-15 08:30:23 +0400 |
commit | 581fe37bbf67efe8e066f43e8440d57e223f1afd (patch) | |
tree | af39ae339337f6395d092826e2694dcb74a00cb3 | |
parent | 4f425ab4697508f8df69d7662a59e46f9b012da6 (diff) |
Added logic to create custom variable in getRequest().
-rw-r--r-- | libs/PiwikTracker/PiwikTracker.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php index 7eb010837a..e73aff0752 100644 --- a/libs/PiwikTracker/PiwikTracker.php +++ b/libs/PiwikTracker/PiwikTracker.php @@ -1144,14 +1144,23 @@ class PiwikTracker if (empty($this->lastVisitTs)) { $this->loadVisitorIdCookie(); } + // Set the id cookie + $this->setVisitorIdCookie($this->getVisitorId(), $this->createTs, $this->visitCount, $this->currentTs, $this->lastVisitTs, $this->lastEcommerceOrderTs); + + // Set/update the session cookie $sesname = $this->getCookieName('ses'); if (!$this->getCookieMatchingName($sesname)) { // new session (new visit) $this->visitCount++; $this->lastVisitTs = $this->currentVisitTs; } - $this->setVisitorIdCookie($this->getVisitorId(), $this->createTs, $this->visitCount, $this->currentTs, $this->lastVisitTs, $this->lastEcommerceOrderTs); setrawcookie($sesname, '*', $this->currentTs + $this->configSessionCookieTimeout / 1000, $this->clientCookiePath, $this->clientCookieDomain); + + // Set the custom variable cookie if custom variables have been set + if (!empty($this->visitorCustomVar)) { + $cvarame = $this->getCookieName('cvar'); + setcookie($cvarname, json_encode($this->visitorCustomVar), $this->currentTs + $this->configSessionCookieTimeout / 1000, $this->clientCookiePath, $this->clientCookieDomain); + } } $url = $this->getBaseUrl() . |