Consent information lost between main domain and subdomain

I have a subdomain (login wall) that is lacking the consent that was previously granted on the main domain. I have wildcard-based subdomain definition set up in the admin for consent sharing. The container is injected on both the main domain and the subdomain, all tags are firing as they should (when consent is granted). So in theory everything looks fine. Still, when entering the subdomain the consent information is missing and the consent window pops up. It seems like as if the settings in the admin would not work for the consent manager, or if the consent information would not be passed over to the subdomain. Any hints?

Hi! Welcome to our community :smile:

What do you mean by “wildcard-based subdomain definition”? Where did you set up the wildcard-based URLs?
Also, did you follow our guide on setting up cross-domain tracking? (How can I recognize a visitor across subdomains? | Piwik PRO help center)

Hi and sorry for the long silence. We’ve been investigating the setup a lot, found some minor bugs and changed some settings. To make sure we have the consent from the users everywhere we enabled the consent on both the main domain and the specific subdomain where the login wall is active (ie created 2 consent buckets in admin). So right now the users are exposed to the consent popup twice during a typical visit - not a nice solution, but better safe than sorry. We also noticed that in some cases the consent popup is not presented in incognito mode; and that adblockers are also blocking it - all fine and acceptable.
However, we are still facing one major question. When looking at the session log we can see several sessions where the user gave their consent, but still only basic information is collected, no custom dimensions populated, no custom events are being captured. This is a SPA, whereas we set up pageviews to fire on history change, and custom pageload events (and other events) to fire on datalayer push. So in normal case we see two events coming in parallel, one history-change based pageview and one datalayer pageload event, both populated with multiple custom dimensions. But in many of the cases we cannot see the custom events firing, nor the extra parameters being populated. You can see examples on the screenshot, both sessions have consent, still the logs look completely different.
We were wondering what the reason could be of this difference, why do we see sometimes all kind of custom information populated, while nothing in other cases, despite having the consent. We checked all around both in the code and in live environment and the datalayer push is never blocked or failing, so we have a strong assumption that the root cause is somewhere in consent management. There are a lot of redirects happening when the users are logging in, so maybe the consent info gets lost? But the consent is set in a cookie, so any redirects that eventually link back to the original domain should be fine and handled. Anyone had similar experience or have an idea?


Could you tell me more about how you have the custom events and dimensions set up? Are they dependent on a consent decision? Are there specific conditions when you execute the data layer push?

The tags are only dependent on the analytics consent and there are no specific conditions for triggering them, simply the datalayer event is triggering them on all pages.

Could you share the URL of the website you’re reffering to? If you want, I can check the setup and see what could be causing this issue. You can share it with me via private message or here in the thread :smile:


We investigated your issue and found that on the second website (P+ Medlemsportal) there some data missing from the data layer (such as pagePath and pageUrl), which causes errors in the console and, subsequently, causes the dimensions to be undefined. Are you able to double check the setup and confirm whether there is some issue wirth pushing this data to the data layer?