@parruc opened this Issue on June 15th 2015 Contributor

I have some subdirs that I want to track as different sites. Following the docs I called, in the tracking code, setCookiesPath but two id cookies are created the first on / and the second on the right subdir.

I've debugged the js and the first cookie is created at constructor time

rows: 5340 and 5341

var applyFirst = ['disableCookies', 'setTrackerUrl', 'setAPIUrl', 'setUserId', 'setSiteId', 'enableLinkTracking'];
_paq = applyMethodsInOrder(_paq, applyFirst);

In particular setSiteId sets the id cookie too soon (before I can call setCookiesPath) my and I end up having 2 id cookies, one for the root and one for my selected subdir.

@mattab commented on June 16th 2015 Member

Hi @parruc

could you paste here your Piwik JavaScript Tracking code?

@parruc commented on June 16th 2015 Contributor

Here it is the tracking code I'm using @mattab:

<!-- Piwik -->
<script type="text/javascript">
     var paq = paq || [];
     _paq.push(['setCookiePath', '/people/john.doe']);
    (function () {
        var u = "https://example.com/";
        _paq.push(['setTrackerUrl', u + 'piwik.php']);
        _paq.push(['setSiteId', 14302]);
        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 + 'piwik.js'; s.parentNode.insertBefore(g, s);
<noscript><p><img src="https://example.com/piwik.php?idsite=14302" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
@parruc commented on June 26th 2015 Contributor

Were you able to reproduce it @mattab ?

@mattab commented on July 7th 2015 Member

Fixed in #8265 @parruc if it's not fixed please re-open

This Issue was closed on July 7th 2015
Powered by GitHub Issue Mirror