Skip to content
Extraits de code Groupes Projets
Valider def6da2e rédigé par mattab's avatar mattab
Parcourir les fichiers

Fixes #4217 Load Visitor ID from first party cookie if available

parent fd85b68b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -716,16 +716,11 @@ class PiwikTracker ...@@ -716,16 +716,11 @@ class PiwikTracker
* *
* Allowed only for Admin/Super User, must be used along with setTokenAuth(). * Allowed only for Admin/Super User, must be used along with setTokenAuth().
* *
* For example, on your website if you use the Javascript tracker in some pages * You may set the Visitor ID based on a user attribute, for example the user email:
* and the PHP tracker in other pages, you can write:
* $v->setVisitorId( $v->getVisitorId() );
*
* This will set this visitor's ID to the ID found in the 1st party Piwik cookies
* (created earlier by the Javascript tracker).
*
* Alternatively you can set the Visitor ID based on a user attribute, for example the user email:
* $v->setVisitorId( substr(md5( $userEmail ), 0, 16)); * $v->setVisitorId( substr(md5( $userEmail ), 0, 16));
* *
* If not set, the visitor ID will be fetched from the 1st party cookie, or will be set to a random UUID.
*
* @see setTokenAuth() * @see setTokenAuth()
* @param string $visitorId 16 hexadecimal characters visitor ID, eg. "33c31e01394bdc63" * @param string $visitorId 16 hexadecimal characters visitor ID, eg. "33c31e01394bdc63"
* @throws Exception * @throws Exception
...@@ -1050,7 +1045,7 @@ class PiwikTracker ...@@ -1050,7 +1045,7 @@ class PiwikTracker
// Only allowed for Super User, token_auth required, // Only allowed for Super User, token_auth required,
(!empty($this->ip) ? '&cip=' . $this->ip : '') . (!empty($this->ip) ? '&cip=' . $this->ip : '') .
(!empty($this->forcedVisitorId) ? '&cid=' . $this->forcedVisitorId : '&_id=' . $this->visitorId) . (!empty($this->forcedVisitorId) ? '&cid=' . $this->forcedVisitorId : '&_id=' . $this->getVisitorId()) .
(!empty($this->forcedDatetime) ? '&cdt=' . urlencode($this->forcedDatetime) : '') . (!empty($this->forcedDatetime) ? '&cdt=' . urlencode($this->forcedDatetime) : '') .
((!empty($this->token_auth) && !$this->doBulkRequests) ? '&token_auth=' . urlencode($this->token_auth) : '') . ((!empty($this->token_auth) && !$this->doBulkRequests) ? '&token_auth=' . urlencode($this->token_auth) : '') .
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter