Tagmanager Script tag is created incorrectly
-
The <script> tag that is being generated by this plugin does not adhere to the recommended way of implementing manual consent as described in the documentation. See script output below .
Details:
We have set up Cookiebot with the WordPress plugin on our site , and we have configured MANUAL blocking and have enabled the Google Tagmanager integration.
For Tagmanager, we have configured the preferences,marketing and stats categories to be mandatory:The code that is now generated by the plugin in the frontend does not follow the documentation . While the data-Attributes data-cookieconsent are set correctly, the script tag remains without the recommended attribute type=text/plain to make it run only if consent is detected.
So the settings we made in the configuration are not transferred correctly to the generated frontend code. The consequence of this bug is that GTM is loaded even if no consent is given. Due to our internal policies an our interpretation of our local data protection laws, that is something we have to avoid.<script data-cookieconsent="preferences, statistics, marketing">
// SHOULD BE: script type=text/plain according to documentation!
(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({'gtm.start':new Date().getTime(), event: 'gtm.js'});
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l !== 'dataLayer' ? '&l=' + l : '';
j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);})(
window,
document,
'script',
'dataLayer',
'GTM-PHH9RFZ3'
);
</script>Will this be fixed? If not, do we have to disable GTM in the Plugin settings and add the code manually with the text/plain attribute?
Regards, Ulrich
The topic ‘Tagmanager Script tag is created incorrectly’ is closed to new replies.