• Hi,
    I have implemented OneTrust cookie banner on my website through GTM. Also, I’m using AutoBlocking script.

    Now I don’t understand how I can add the below script on my website head without using GTM.
    <script type="text/javascript" src="https://cdn.cookielaw.org/consent/47734a0a-fb4c-41ed-996f-xxxxxx-test/OtAutoBlock.js" ></script>

    • This topic was modified 3 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there.

    After quickly reading about the OneTrust Cookie Auto-Blocking feature, their instructions suggest you can turn on this feature from the OneTrust Cookie settings, and the Auto-Blocking script will automatically be included in your main OneTrust Cookie script. Here is the article explaining this. Have you tried this already?

    Could you please explain further why you need to add the AutoBlock script without using GTM? If it’s because GTM is being blocked by the Auto-Blocking script, there is another article here explaining how you can prevent Auto-Block from blocking GTM, specifically:

    Auto-Blocking is capable of blocking Google Tag Manager. If this occurs, use one of the follow methods to unblock Google Tag Manager:

    j.setAttributeNode(d.createAttribute(‘data-ot-ignore’));
    j.setAttribute(‘class’,’optanon-category-C0001′);

    If the above options with GTM don’t sound applicable, you could consider adding the script directly in your website head rather than through GTM.

    You can add a script to your website head by either directly editing your theme’s header.php file (where you should find your website’s <head> tag), or by using a plugin such as Insert Headers and Footers. If you try this method, OneTrust suggests adding the script as close to the top of the <head> section as possible.

    I’ve just spotted that CookiePro have their own WordPress plugin. Again this means you wouldn’t be using a GTM implementation, but it’s another alternative you might want to try if you haven’t already.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add OneTrust AutoBlocking script to head’ is closed to new replies.