Consent across domains


I have turned on the cross domains tracking and I send correctly the pk_vid from one domain to the other domain via the URL.

However, the consent appears on the two domains even when it was approved in the first one.

I could not find anything in the interface to define that the consent should also be ported.

Am I missing something?


We don’t have sharing consents across different top level domains. However, you can use our APIs to get the information about consent and to apply it automatically. This would require using some custom code to pass the consent string via URL param.

Thank you for your answer.

Could it be possible to use two different sites to have the consent not requested on the second domain (a domain for our app where you are anyway identified) but to still be able to use cross-domain tracking across the two sites using the pk_vid parameter?

Yes. You would have to use APIs to apply consent automatically and the 2nd domain.

But can the pk_vid be shared in two different sites in Piwik? It would be two separated scripts for each domain.

Can the link be made via meta site then?

No. I was thinking about using the same property and container code for both domains. One goes by default with the consent popup enabled and on the other one you accept it in the background via our APIs. In this case, cross domain tracking will be working fine.


I guess, then, it is about using this piece of code:
  { consents: ["analytics"] },
  function () {},
  function () {}
  { consents: { analytics: { status: 1 } } },
  function () {},
  function () {}
document.getElementById('ppms_cm_consent_popup_<your site id>').style.display = "none";

Or sending via the URL the consent string if I want to take it into account.

Yes. I’m not sure if you have to hide the popup manually. You can check if it works correctly by analysing the value of ppms_privacy_<property-id> cookie.