Conflict between Iubenda Integration and Doubleclick for Publsihers

Created on 16 January 2023, over 1 year ago
Updated 9 May 2023, about 1 year ago

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.

Problem/Motivation

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.

Steps to reproduce

Install both Iubenda Integration and Doubleclick for Publishers: https://www.drupal.org/project/dfp

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

🇺🇸United States esorum

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024