Multiple containers don't load

Created on 25 July 2023, 11 months ago
Updated 27 June 2024, 2 days ago

Problem/Motivation

When configured to "Allow multiple Tag Containers" only the first container will ever be loaded.

Steps to reproduce

  1. Install like normal
  2. Go to the advanced settings: /admin/config/services/google-tag/settings and check the box to "Allow multiple Tag Containers"
  3. Configured at least 2 containers on /admin/config/services/google-tag/containers
  4. View the page source on the home page
  5. Observer only the first container ID is loaded.

Proposed resolution

Load all containers based on appropriate conditions.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇺🇸United States pookmish

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

Merge Requests

Comments & Activities

  • Issue created by @pookmish
  • 🇺🇸United States pookmish

    Looks like this starts at the container resolver and then issues propagate out to all the hooks. This likely will require some extensive refactoring.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 11 months ago
    48 pass, 2 fail
  • @pookmish opened merge request.
  • 🇺🇸United States trackleft2

    One use case for multiple containers:

    We have a distribution that manages configuration for 1000's of sites, and do not want to override our core distro config just to add an additional container for our clients that have them, because that adds significant service, support and maintenance overhead.

  • Status changed to Needs review 10 months ago
  • 🇺🇸United States joegraduate Arizona, USA
  • Status changed to Needs work 5 months ago
  • 🇺🇸United States japerry KVUO

    Fair enough use case indeed -- however tests are failing so moving to needs work until that issue can be uncovered.

  • 🇺🇸United States jeffreysmattson

    This patch wont apply to current 2.0.x-dev version. When viewing the MR the page throws an error and comments and MR not viewable. How do we move forward with this?

  • Status changed to Needs review 4 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 4 months ago
    48 pass, 2 fail
  • 🇮🇳India chaitanyadessai

    Please review Patch

  • The last submitted patch, 9: 3376960-9.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 4 months ago
    48 pass, 2 fail
  • First commit to issue fork.
  • Pipeline finished with Failed
    26 days ago
    Total: 189s
    #190289
  • 🇺🇸United States majorrobot

    @chaitanyadessai's patch seems to be a reroll of !54, so I applied that locally.

    I found that the code did not load multiple gtag script tags correctly. Multiple tags loaded, but each tag repeated the config of the first tag (except for that the tagId). This gave a 404 for those tags.

    To resolve this, I took the pattern from google_tag_page_top() and refactored google_tag_page_attachments() accordingly.

    gtm.js also needed to account for multiple tag configs, so I also refactored parts of that file.

    Since MR !54 was out of date, I took the MR's branch and rebased on 2.0.x., then added my changes and pushed the new branch. I created MR !83. I'm not completely clear if this handles every case, but it should get us closer.

  • Status changed to Needs review 25 days ago
  • Pipeline finished with Failed
    25 days ago
    Total: 211s
    #190986
  • 🇺🇸United States theMusician

    Confirming this is still an issue in 2.0.5. Our use case is similar to trackleft2. We are able to work around this for now as we don't have many instances where we use multiple containers.

Production build 0.69.0 2024