Hi,
I have attempted to implement the following script into our hubspot-hosted website to stop the automatic dropping of analytics cookies onto our website. The script looks like it should function fine but the ‘doNotTrack’ and ‘revokeConsent’ functions are not taking place as described in this documentation
When i call these commands through the console however, they work fine.
Why are these functions not operating as expected when inserted into the website via the page header/footer in the Hubspot page settings?
script:
$(window).load(function(){ var _hsp = window._hsp = window._hsp || []; _hsp.push([‘revokeCookieConsent’]); _hsq.push([‘doNotTrack’]);
Hi, @NDonnelly6
Thanks for reaching out! One question, have you tried experimenting with using the $(document).ready event instead of the $(window).load event?
Hey, @Anton @jonchim @Jnix284, do you have any advice for @NDonnelly6? Or troubleshooting steps you like to take in cases like this?
Thank you! — Jaycee
Hi @Jaycee_Lewis ,
Thanks for getting back! Tried replacing ‘$(document).ready’ event with the ‘$(window).load event’ and i can see the ‘__hs_do_not_track’ cookie dropping now on the page load but the ‘hubspotuk’ and ‘__hstc’ cookies are still dropping and not being removed on the load of the page/script
Sorry @Jaycee_Lewis and @NDonnelly6 cookie consent is way outside my area of expertise - honestly, I avoid it at all costs because it can be such a technical nuisance 
Hopefully one of the others can provide further guidance, if not, I’m happy to pass the question on to my usual source of help for these matters to see if they can jump in to help.