-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(theme): dynamically render the cookie consent scripts only on *.commercetools.com domain #348
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/commercetools/commercetools-docs-kit/blda3wmqt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment, I would avoid using a class and instead just remove the container
894e019
to
20d23b2
Compare
20d23b2
to
1e95c89
Compare
if (window && window.location.host.includes('.commercetools.com')) { | ||
injectScript( | ||
'https://cdn.cookielaw.org/consent/b104027d-4d10-4b75-9675-9ffef11562a8/OtAutoBlock.js' | ||
); | ||
injectScript( | ||
'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js', | ||
{ 'data-domain-script': 'b104027d-4d10-4b75-9675-9ffef11562a8' }, | ||
'function OptanonWrapper() {};' | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nkuehn please take a look, I would like to try this approach first. |
OK, just merge and approve yourself - we'll have to wait all through production anyways to test. |
I'll test the canary release on appkit. |
1e95c89
to
ed2b9e9
Compare
addresses #346
This is the technique that is used on the current docs.commercetools.com site - it's a client side approach that activates a CSS rule that removes the complete thing from the visible DOM, letting it do it's buggy work however it wants as long as it doesn't show up.
The check is on the .commercetools.com domain level because that's the cookie scope the script uses.
The root cause it that the cookie consent script fails on other domains and does not close.