-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
[Bug]: Scripts with data-category are running before cookies are accepted #699
Comments
The Your script tags should look like this instead: <script type="text/plain" data-category="ads">
document.getElementById("console-log").innerHTML+= "--- Running ads script ---<br>"
</script>
<script type="text/plain" data-category="analytics">
document.getElementById("console-log").innerHTML+= "--- Running analytics script ---<br>"
</script> On Codepen it looks like it's working but it's actually not. Here is the console log of codepen:
|
I see... It should've been obvious, but I haven't thought about that at all. Thanks a lot for your help and for a great product! |
how do you unblock these scripts once user gives consent? |
@shibusahu30 they are enabled by the plugin through this function: cookieconsent/src/utils/scripts.js Line 75 in c4d512f
|
Expected Behavior
Scripts that have
data-category
argument provided should be blocked until user accepts cookie consent message.Current Behavior
Scripts are running on page load, before user accepts cookie consent message.
Steps to reproduce
I have recreated this issue on StackBlitz
Additional info
When I've tried recreating this issue on CodePen, everything works as expected
Version
3.0.1
On which browser do you see the issue?
Firefox, Chrome, Safari
The text was updated successfully, but these errors were encountered: