# Consent banner behaviour when switching URL with different path

**URL:** <https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311>\
**Category:** Privacy\
**Created:** [December 1, 2023, 11:42am UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311 "2023-12-01T11:42:24Z")\
**Posts on this page:** 9\
**Page:** 1

<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 1, 2023, 11:42am UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/1 "2023-12-01T11:42:24Z")

</div>

Hello  
I have 2 websites :  
example.group/en  
example.group/en-us

They have two differents PIwik instance (different Piwik id) and the consent manager have been enabled on both sites.

My question is simple.  
**What would be the behavior when switching from a website (/en) to an other (en-us) ?**

If I refuse the cookie on /en, is the cookie banner will be displayed if I go on /en-us  
For me yes because we have an other instance of Piwik so the user will be considered as new user.  
Thank you for your confirmation

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [December 4, 2023, 10:35am UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/2 "2023-12-04T10:35:11Z")

</div>

Hi @romainproximity,

Yes, you are correct. When there are two different containers a consent decision will not be shared between them, hence visitor will be asked for consent two times.

Best,  
Oliwer

---

<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 5, 2023, 10:20am UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/3 "2023-12-05T10:20:23Z")

</div>

Hello Oliwer,

Thank you for your confirmation.

And if my Piwik Pro instance is installed in 2 differents domains :  
[abc.com](http://abc.com) and def.app

**Will my cookie banner reappear when I switch from a domain to an other ?**

Because I’m doing some test on my staging environment and I still have my cookie banner on the second site even if I accepted at the first touch point.  
Even if I have the same visitor id for the both domain in my report I don’t want that my user can say yes to the consent at the first touchpoint and no at the second.

PS : my tracking is done according to the CNIL/GDPR configuration.

Thank you very much for your help

Best  
Romain

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [December 5, 2023, 12:24pm UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/4 "2023-12-05T12:24:22Z")

</div>

Yes, consent form will appear again on the second domain.

Best,  
Oliwer

---

<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 5, 2023, 1:51pm UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/5 "2023-12-05T13:51:08Z")

</div>

Hello @Oliwer_Kaczmarek

Thank you.  
Is it possible to avoid this behavior ?  
Or is it only because I have 2 differents domains ?

Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [December 6, 2023, 9:33am UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/6 "2023-12-06T09:33:06Z")

</div>

Hi @romainproximity,

That is correct. Piwik PRO Consent Manager uses a first-party cookie to save the consent status for each consent type. That means that as of now the consent cannot be shared between domains (but can be shared between subdomains).

---

<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 6, 2023, 9:39am UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/7 "2023-12-06T09:39:29Z")

</div>

> [@anthonybartczak](#):
>
> That means that as of now the consent cannot be shared between domains (but can be shared between subdomains).

Thank you Anthony for this confirmation.  
Best regards

---

<div class="post-metadata">

**Author:** ![alexanderf](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@alexanderf](https://community.piwik.pro/u/alexanderf)\
**Post date:** [December 6, 2023, 12:06pm UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/8 "2023-12-06T12:06:27Z")

</div>

In theory this could be done by appending the consent status in the URL as a parameter and then using that to set the appropriate consent through your tag manager. E.g. example.group/en-us?consent=110 or so.

You’d need some way to dynamically populate the outlinks though so probably some custom code somewhere. Haven’t done it before though.

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [December 6, 2023, 7:04pm UTC](https://community.piwik.pro/t/consent-banner-behaviour-when-switching-url-with-different-path/3311/9 "2023-12-06T19:04:50Z")

</div>

Yeah, seems like an interesting option. E.g. getting the consent settings from the query parameters of your URL and passing them to [setComplianceSettings](https://developers.piwik.pro/en/latest/consent_manager/js_api/index.html#set-compliance-settings). It would probably still count as consent decision changed event as the consent manager would set initial values in the background.

Haven’t tried this yet, might try in the future.
