- Status changed to Closed: works as designed
almost 2 years ago 7:45pm 9 May 2023
Edit: after contacting Iubenda support, they said that changing script tags to "text/plain" was part of its function to disable all scripts until the user accepts the cookie agreement. The problem may lie in Drupal, since our Drupal 9 sites are the ones breaking, but a Drupal 8 site is able to run both googletag and Iubenda. I am hacking the problem by forcing Doubleclick's JavaScript to wait until its variables are declared before running the rest of its code.
We have been using Doubleclick for Publishers for years, and recently installed Iubenda Integration.
Iubenda Integration for some reason changes the type attribute of some
elements to type="text/plain." This means the JavaScript inside that elemenet does not run. In this case, it is where the googletag variable (used by Doubleclick) is being declared , resulting in multiple errors that say "Uncaught ReferenceError: googeltag is not defined." I'm trying to hack a solution by injecting the block of JavaScript into the page somewhere. I created a new JS file in the theme folder and linked it in the theme.libraries.yml. The script runs, but the problem is it doesn't run before the other code, resulting in the same reference errors. In other words, I need my custom code to run first in order to declare the variables that are being using by the module. Is there a way to make a specific JS file run before any other JS code? I would of course be open to better solutions to this conflict.Closed: works as designed
4.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.