Script Blocking – Explained
-
First of all, let me say I am in no way affiliated with this plugin other than that I’m using it and the below might not be accurate in every scenario. It’s simply a report of what seems to be the case from what I can ascertain in my particular setup.
I did however try to make sense of the description under the script blocking section and searched high and low regarding how to – in my case – deal with a google analytics implementation.
So the below only refers to that , but I would assume it’s applicable to all sorts of things.In short: the description (as it stands in the current version of the plugin anyway) says: “Enter non functional cookies Javascript code here…etc”
That’s somewhat misleading from what I can make out and to me seems to be something that’s got “lost in translation” so to speak (why would I possibly want to put non functional code anywhere ?!)
I think a better description would be (something like):
“Put your javascript code here you want to be executed when ‘third party non functional cookies’ have been accepted”Because what seems to happen is the code you can put in that textarea will only get added to the/a page if a user accepted those 3rd party cookies (Note: I have not tested what happens when using caching plugins as that might well throw some “spanners in the works” so to speak)
as a real world example (works for me anyway – mileage might vary)
I had a google analytics plugin installed on my site which generated more or less the following code on each page (sensitive data removed):
<script type="text/javascript"> var _gaq=_gaq||[]; _gaq.push(["_setAccount","xxxxx"]),_gaq.push(["_setDomainName",".xxxxx.com"]),_gaq.push(["_trackPageview"]),function(){var t=document.createElement("script"); .....some more code ........ a.parentNode.insertBefore(t,a)}(); </script>
what needed to be done was to add that whole code (including
<script .... </script>
) into the “Script blocking” textbox of this cookie plugin and subsequently de-activate the google analytics plugin that i used (as it knows nothing about that cookie consent plugin) so only the code added to that “Script blocking” box was being executed and only if consent was givenThat’s all from me on that subject.
maybe it helps someone as I have come across many (unanswered) questions to that effect when searching for a solution myself……
- The topic ‘Script Blocking – Explained’ is closed to new replies.