-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
BugFor errors / faults / flaws / inconsistencies etc.For errors / faults / flaws / inconsistencies etc.
Milestone
Description
The "_pk_id" cookie is set by the setSiteId()
method before the setVisitorCookieTimeout()
and setCookieNamePrefix()
are executed. As a result it is not possible to change the prefix and lifetime for that cookie. The other cookies change with the the prefix and you will get a second id cookie sometimes.
Tracking Code example:
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['setCookieNamePrefix', 'stats']);
_paq.push(['setVisitorCookieTimeout', '0']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo-dev/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
Call Stack:
Metadata
Metadata
Assignees
Labels
BugFor errors / faults / flaws / inconsistencies etc.For errors / faults / flaws / inconsistencies etc.