OneTrust script not loaded - missing document.write support?

Hi,

we’re using OneTrust for consent management and want to display the consent banner via Matomo Tag Manager. Currently, we’re using Google Tag Manager, but want to switch to MTM.

With GTM, we can display the consent banner by using a custom html tag with the setting “support document.write”. In MTM, I can’t find a setting for supporting document.write.
Problem at the moment: the consent banner won’t be displayed via MTM.

We see this error message in the browser console:
Failed to load resource: the server responded with a status of 404 () (in cdn.cookielaw.org/consent//.json:1)

The OneTrust support insists that support “document.write” needs to be selected with GTM. But they have no experience with MTM.

Is there a possibility to change setting for “support document.write” in a custom html tag?
Or might it be another problem that is not connected to the support of document.write?

Thanks a lot for your help!

Hello christine.
We’re experiencing the same issue. Have you found a solution since your initial post six months ago?
R

Hi,

I am facing the same problem as you.

I found an example that works with Tealium and seems to work for matomo tag manager.

Here is the code to insert:

<script type="text/javascript">
    let domainId = '[INSERT DATA DOMAIN ID]';

    let head = document.getElementsByTagName('head')[0];
    let script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js';
    script.setAttribute("data-domain-script", domainId);
    script.async = true;
    head.appendChild(script);
    function OptanonWrapper() { }
</script>

Ex from Onetrust/Tealium : https://my.onetrust.com/s/article/UUID-f1c120fb-da3c-f54c-9d03-75a0742ed1fd