# Consent across domains

**URL:** <https://community.piwik.pro/t/consent-across-domains/1369>\
**Category:** Data collection and tags\
**Created:** [December 16, 2022, 9:52am UTC](https://community.piwik.pro/t/consent-across-domains/1369 "2022-12-16T09:52:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![YvesBeebole](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/yvesbeebole/32/1022_2.png) [@YvesBeebole](https://community.piwik.pro/u/YvesBeebole)\
**Post date:** [December 16, 2022, 9:52am UTC](https://community.piwik.pro/t/consent-across-domains/1369/1 "2022-12-16T09:52:55Z")

</div>

Hello,

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?

Yves

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [December 19, 2022, 9:54am UTC](https://community.piwik.pro/t/consent-across-domains/1369/2 "2022-12-19T09:54:53Z")

</div>

We don’t have sharing consents across different top level domains. However, you can use [our APIs](https://developers.piwik.pro/en/latest/consent_manager/js_api/index.html) 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.

---

<div class="post-metadata">

**Author:** ![YvesBeebole](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/yvesbeebole/32/1022_2.png) [@YvesBeebole](https://community.piwik.pro/u/YvesBeebole)\
**Post date:** [December 20, 2022, 10:36am UTC](https://community.piwik.pro/t/consent-across-domains/1369/3 "2022-12-20T10:36:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [December 20, 2022, 10:43am UTC](https://community.piwik.pro/t/consent-across-domains/1369/4 "2022-12-20T10:43:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![YvesBeebole](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/yvesbeebole/32/1022_2.png) [@YvesBeebole](https://community.piwik.pro/u/YvesBeebole)\
**Post date:** [December 20, 2022, 11:01am UTC](https://community.piwik.pro/t/consent-across-domains/1369/5 "2022-12-20T11:01:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [December 20, 2022, 11:03am UTC](https://community.piwik.pro/t/consent-across-domains/1369/6 "2022-12-20T11:03:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![YvesBeebole](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/yvesbeebole/32/1022_2.png) [@YvesBeebole](https://community.piwik.pro/u/YvesBeebole)\
**Post date:** [December 20, 2022, 11:08am UTC](https://community.piwik.pro/t/consent-across-domains/1369/7 "2022-12-20T11:08:04Z")

</div>

Ok.

I guess, then, it is about using this piece of code:

```auto
ppms.cm.api(
  "setInitialComplianceSettings",
  { consents: ["analytics"] },
  function () {},
  function () {}
);
ppms.cm.api(
  "setComplianceSettings",
  { 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.

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [December 20, 2022, 12:29pm UTC](https://community.piwik.pro/t/consent-across-domains/1369/8 "2022-12-20T12:29:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![edsi](https://avatars.discourse-cdn.com/v4/letter/e/ecc23a/32.png) [@edsi](https://community.piwik.pro/u/edsi)\
**Post date:** [November 30, 2023, 4:13pm UTC](https://community.piwik.pro/t/consent-across-domains/1369/9 "2023-11-30T16:13:47Z")

</div>

Hi @kuba any news about this topic? is piwik PRO currently supporting cross domain consent without API?

Thank you so much, Elisa

---

<div class="post-metadata">

**Author:** ![romainproximity](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@romainproximity](https://community.piwik.pro/u/romainproximity)\
**Post date:** [December 11, 2023, 2:38pm UTC](https://community.piwik.pro/t/consent-across-domains/1369/10 "2023-12-11T14:38:24Z")

</div>

> [@YvesBeebole](#):
>
> I could not find anything in the interface to define that the consent should also be ported.

I hase the same problem than Yves but withing the subdomain.  
When I say yes to the cookie banner on domain 1, I still have the cookie banner displayed in the next subdomain.

If someone have a clue on this.  
Thank you

---

<div class="post-metadata">

**Author:** ![hakim\_azzouzi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/hakim_azzouzi/32/3759_2.png) [@hakim\_azzouzi](https://community.piwik.pro/u/hakim_azzouzi)\
**Post date:** [October 2, 2024, 1:55pm UTC](https://community.piwik.pro/t/consent-across-domains/1369/11 "2024-10-02T13:55:07Z")

</div>

Hi,

i’m facing the exact same problem.

Does anyone solved this problem please ?

---

<div class="post-metadata">

**Author:** ![Elena\_Benito\_Ruiz](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/elena_benito_ruiz/32/1823_2.png) [@Elena\_Benito\_Ruiz](https://community.piwik.pro/u/Elena_Benito_Ruiz)\
**Post date:** [October 17, 2024, 7:49am UTC](https://community.piwik.pro/t/consent-across-domains/1369/12 "2024-10-17T07:49:40Z")

</div>

Any update on this feature: porting consent across domains 🙏🏻🙏🏻 @kuba
