I am trying to: Get GDPR Cookie Consent to function on /de and /fr
Link to a page where the issue can be seen: hidden link
Works as expected in default/English page hidden link
I expected to see: After clicking [ Accept ] cookies button, a newly loaded page with GTM and AddThis scripts in it (search elements/source for "google tag manager" or "addthis.com"
Instead, I got: The unchanged page (except for cookie values) reloaded.
Has this come up before? I haven't been able to find any threads about it. This specific plugin is mentioned in WPML documentation, but only in a how-to about displaying translated content. No mention of functionality issues.
Does WPML add something or treat localized pages differently in a way that would interfere with this plugin?
We are working on this in the live production site, so I'm not authorized to give access and can't enable DEBUG. Please let me know if that's absolutely necessary (and at what user level) to diagnose/resolve this. Thanks.
Conjecture—Does WPML somehow treat each set of localized pages as its own "domain" with caching rules that would override how cookies are allowed or read compared to at the default (in this case English) site? In our case, the /fr and /de pages seem to behave as if they are hosted on a server with server-side caching that shows the same page on clicking [ Accept ] cookies as on first landing. If this is the case, how to force WPML to serve a fresh uncached page?
We ran into this issue with WPEngine hosting's server-side caching. The solution was to have them explicitly add GDPR Cookie Consent cookies to a "do not cache" list. Is there an option like that for WPML language folders?
As I said, conjecture. This is what the behavior *seems* or *feels* like.
Better (hopefully) described to me by a developer…
For /fr and /de pages, the browser is sending cookie values along w the request for the page, but the server, when rendering those pages, isn't able to get those values. Testing shows that the cookie banner cookies are not being found. These are the cookies that are important for returning the correct rendered page (with or without cookies/scripts, based on whether visitor clicks Accept or Reject in GDPR banner).