Hi all,
I am working on a Piwik Pro Integration and instead of using the Piwik Pro script, I am using this one :
var _paq = _paq || [];
_paq.push(['setCustomUrl', "/" + {{Macro - Langue}} + "/#/" + {{Macro - FragmentNew}}]);
_paq.push(['setDocumentTitle', document.title ]);
_paq.push(['trackPageView']);
_paq.push(["enableLinkTracking"]);
(function() {
var u="https://XXXXX.piwik.pro/";
_paq.push(["setTrackerUrl", u+"ppms.php"]);
_paq.push(["setSiteId", {{Tableau - Hostname}}]);
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+"ppms.js"; s.parentNode.insertBefore(g,s);
})();
As we already use a Consent Management Platform on the website, we use this script to send the cookie choice made by the user. This one, is when the page is loading
ppms.cm.api(
"setInitialComplianceSettings",
{ consents: ["analytics"] },
function () {},
function () {}
);
This one is when th user made his choice (Analytics cookies accepeted)
ppms.cm.api(
"setComplianceSettings",
{ consents: { analytics: { status: 1 } } },
function () {},
function () {}
);
But when I checked the browser console, I have this error “Uncaught ReferenceError: ppms is not defined”. I imagine that it is because I’m not using the Piwik Pro container.
My question is, how can I send the cookie choice information to Piwik without using the piwik container script ?
I found this script maybe it could be a solution ?
_paq.push(["setUserIsAnonymous", true]);
_paq.push(["setUserIsAnonymous", false]);
Thank you
Regards
Pascal