Autoblocking Checklist

How to make sure your site is blocking cookies like Google Analytics 

The placement of our blocking script is automatic, but in some sites using certain plugins / setups, there are "techniques" used by 3rd parties like Google and Facebook to "jump" their scripts to the top so that any blocking mechanism leaves them unaffected. 

Please follow these steps in order to determine whether the blocking script is working as expected:

  1. If your website has a Login feature, please make sure you are logged-out and viewing your website as an unregistered / anonymous user. We do not block scripts for logged-in users. If someone has an account on your site, with a username and password, then they have agreed to your Terms of Service, which is a form of consent that supersedes the Cookie Consent.
  2. Please go to your WordPress plugin settings page and make sure the Autoblocking box is checked:
    Screen-Shot-2021-03-31-at-12-06-35-PM.png

  3. Check the position of the blocking script. Open an anonymous browser window and go to your website. Right click and "Inspect Element" to access the HTML elements. Open the <head> tag and find the blocking script: 
    <head> 	 	
    	<!--Hu-Banner--> 	 	
    	<script type="text/javascript" src>...</script>
    	<script type="text/javascript" src="//cdn.hu-manity.co/hu-banner.min.js"></script>
    
    </head>
    	

If there are any <script> placed before the <---Hu-Banner--->, the blocking function will not be able to recognize it, and cookies placed by that script will be set prior to consent being registered. 

How to solve blocking script position issues:

If you have manually placed tracking scripts in your header.php theme file:

  • Make sure any custom script added is placed just before the CLOSING </head> tag, and not after the opening <head> tag. 

If there are any scripts placed just below the opening <head> tag, then cut and paste them to just above the closing </head> tag. Make sure that any custom scripts added via this method are added BELOW the <?php wp_head(); ?> in the header.php file (shown above)

If you use a caching plugin (e.g. WP Super Cache, WP Total Cache, WP Rocket, WP Fastest Cache):

  • The root of the issue may be in the usage of minification / compression, or script deferring. Some of these features can change the order of how scripts are loaded on a website, or can generate unexpected behavior on the JavaScript (JS) side. In this case, the caching plugin takes all the scripts on a website and puts them in a cached file - this might result in changing the order of the scripts execution. Try to disable these features one-by-one; minification / compression can generally be used if they do not generate any issues, however script deferring will cause the banner to malfunction. Script deferring changes the way scripts are executed on a website. Our script cannot be deferred because it has to be initialized before any other scripts are executed in order to function correctly. 
  • Once disabled, clear the cache and Publish your banner to check whether blocking is working as expected. 

Still need help? Contact Us Contact Us