Closed ioweb-gr closed 1 year ago
As a notice, the scripts that aren't loaded appear to be the ones located in the page after the initCookieConsent function invocation.
What's more weird, is that it's selecting items like this script[data-cookiecategory]
and it's finding only the first 4 elements, but when I do the same in the inspector it finds 6+ items.
After adding the init on dom loaded event , it started catching all the scripts. So order priority matters.
document.addEventListener('DOMContentLoaded', function() {
//init cookie consent
});
Hi @ioweb-gr,
script order doesn't really matter; you just need to make sure the plugin is loaded after the page is fully fetched. You can do this by using the defer
keyword (for external scripts) or your approach for inline scripts.
Expected Behavior
All scripts are triggered based on their category
Current Behavior
In my page I have multiple scripts like this
However, I notice not all of them trigger after accepting the cookies and the selected categories. Some of them are, some of them are staying as text/plain
Steps to reproduce
I'm not sure how to reproduce that and looking for ideas on what to check so that I can get to the bottom of this.
Proposed fix or additional info.
No response
Version
v2.9.2
On which browser do you see the issue?
Chrome