@Anoia wrote:
Hello community,
I tried to use the new setSecureCookie method for https only sites, but can’t get it working.
First there is a difference between the API documentation and piwik.js:
API Doc: setSecureCookies( book )
piwik.js: setSecureCookie( bool ), default = falseSo I assumed typos and added the second version to my tracking code:
var _paq = _paq || []; _paq.push(['setVisitorCookieTimeout', '604800']); _paq.push(['setSecureCookie', true]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://piwik.example.com/"; _paq.push(['setTrackerUrl', u+'js/']); _paq.push(['setSiteId', 123]); 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+'js/'; s.parentNode.insertBefore(g,s); })();
But it didn’t work and the Developer Console showed the error:
The method ‘setSecureCookie’ was not found in “_paq” variableDid I get something completely wrong or is it a bug?
Thank you very much in advance!
Posts: 1
Participants: 1