Support » Plugin: Cookie Notice for GDPR » script blocking field

  • Resolved Ambyomoron


    Could someone please share examples of what you put in the script blocking field? Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • For example something like this (for google analytics)

    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

    ga(‘create’, ‘UA-XXXXX-Y’, ‘auto’);
    ga(‘send’, ‘pageview’);



    Thank you, fermanus. Are you saying that the purpose of this field is just to allow you to run any script on your site’s pages?

    Isn’t it true that the script you indicate creates a tracking cookie with the tracking ID indicated and sends the fact of a page view to Google? Why would I put such a script in a plugin that is fundamentally to allow visitors to NOT have cookies saved on their devices and not be tracked if they don’t want to be tracked???

    I apologize for this very basic question, but there is something fundamental about the plugin that I have not capture, and the available plugin documentation is quite useless in that regard.

    Hi Josiah,

    The blocking field in this plugin is only so you can put the scripts ( like Google Analytics, Facebook pixels, conversion codes etc ) in there, so they are blocked and will stay blocked until a user hits the “accept/ok” button.

    You need to remove those scripts from where they where added before ( like using a plugin as Monsterinsights or manually added ). Those scripts now can only reside in the blocking feature, so they will only work if and until the ok button is hit.

    Hope this helps?

    • This reply was modified 7 months, 1 week ago by  LogoLogics.


    That makes perfect sense, Annie, and I thank you for the first clear explanation of how this plugin is supposed to work.
    Just to make sure I have understood correctly, if:
    – I make sure that there is no other script to set a Google Analytics cookie; and
    – I enter that script in the script blocking field; and either
    – A visitor to the site does not click on the button to accept cookies; or
    – A visitor first clicks on the button to accept cookies and then later clicks on the Refuse Cookies button; then
    – That script in the Script Blocking field will NOT be executed; otherwise
    – That script WILL be executed

    Is that correct?

    I think it works as follows:

    1 is correct (the GA script should only be in the script blocking field).
    2 If the visitor does not click anything the notice bar will not disappear and the script(s) won’t be executed. If he (she) clicks on the “refuse” button the script(s) won’t be executed but the notice bar will disappear.
    3. If he clicks “accept”, the script will be executed and the notice bar disappears. If he decides that after all he does not want to be tracked he needs access to the notice bar. First click the “revoke” button. The notice bar pops-up and a new choice can be made. Of course this way one can also change from “refuse” to “accept”.



    I think we’re on the same page. Thanks very much.

    Hi Josiah,

    You´re welcome!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘script blocking field’ is closed to new replies.