script embed breaking

Created on 28 September 2024, 6 months ago

Problem/Motivation

We have some embed code in script tags and after upgrading 2.0.6 they fail to work.

Steps to reproduce

have a script in your source code

and Google tag 2.0.6

Proposed resolution

2.0.5 does not have this issue.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States jaygriggs

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

Merge Requests

Comments & Activities

  • Issue created by @jaygriggs
  • 🇹🇭Thailand peterbkk

    I have the same issue, had to down grade to 2.0.5 for it to work again.

  • 🇺🇸United States lefteous

    Our team is also running into this issue. It seems to be completely random whether our scripts fire off or not. Found that it's only when GTM scripts are attached, even if those do nothing at all. 2.0.5 works fine.
    Main problem is I don't get any sort of error in the logs or console related to whatever is breaking.

  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 372s
    #328190
  • Pipeline finished with Success
    5 months ago
    Total: 256s
    #328231
  • 🇮🇳India ankitv18

    Please review and validate MR!95

  • Pipeline finished with Success
    5 months ago
    Total: 198s
    #329758
  • 🇮🇳India vishalkhode

    Reviewed changes, looks good to me now. Hence, RTBC.

  • Status changed to RTBC 3 months ago
  • First commit to issue fork.
  • 🇧🇪Belgium Jonasanne

    I have tested this MR and can confirm that it fixes the problem.

    Could we get a new release as soon as possible, please?

    I’ve also resolved the merge conflict and included a diff of the merge here for convenience as a patch. Additionally, I’ve removed the comments from the libraries file, as they are not necessary to retain.

    Thank you!

  • I have tested the #9 patch, and can confirm that it works well. Thanks!

  • 🇯🇵Japan ilfelice

    Howdy,

    Applied #9 to version 2.0.8, and it seems to work ok.

  • 🇺🇸United States luke.leber Pennsylvania

    The root cause here is that version 2.0.6 introduced a MAJOR backwards compatibility problem.

    Prior to 2.0.6, library dependencies could be relied upon in order to prevent really gnarly race conditions from happening between the GTM JS and Drupal libraries.

    This happened because https://www.drupal.org/project/google_tag/issues/3452712 🐛 Possibly script loading/placement issue Fixed significantly changed the loading order in a way that bypasses dependency resolution. As a result, in order to prevent race conditions, any drupal library that is depended on by GTM must also be loaded in the head, and the GTM library definition must be hooked into in order to declare the dependency..

Production build 0.71.5 2024