Ability to Exclude Specific Pages/Widgets from Loading the Script
G
George Zammit
I’m reaching out to request a feature enhancement for the cookie script: the ability to selectively exclude certain pages or widgets from loading the script.
Context: Previously, I integrated the cookie script through Google Tag Manager (GTM), which allowed me to control where and when the script loaded. However, due to Apple’s Safari update blocking GTM functionalities, I had to embed the cookie script directly in the website header. This change has led to an unintended issue where multiple consent forms are displayed on a single page due to the inclusion of iframes and other third-party widgets, each loading its own version of the script.
Proposed Solution: Adding an option to exclude specific pages or widgets would resolve this by allowing finer control over where the script is active. This would prevent duplicate consent prompts while ensuring compliance with cookie regulations..
G
George Zammit
Thanks! that worked well :)
Jānis Elmeris
Maybe it could be used to not display the pop-up on the cookie policy page which should be available before the user is asked to make any cookie-related choices.
Although, for us, we want the Cookie-Script to load (and display the badge and do some cookie blocking if applicable), we just don't want the pop-up to appear automatically.
As a workaround, we're using this code on the pages where we don't need the pop-up
<script type="text/javascript">
window.addEventListener('CookieScriptLoaded', function() {
CookieScript.instance.hide();
});
</script>