default_google_tag_entity config is not respected when loading tags

Created on 22 May 2024, over 1 year ago

Problem/Motivation

default_google_tag_entity option of google_tag.settings config is not respected when rendering gtm containers on frontend.
I would like to be able to put empty default tag in settings file to override default config for testing purposes.

Steps to reproduce

  1. Configure GTM tag and save
  2. Check that it works correctly on frontend
  3. Add the following to settings file:
    // Disable GTM. <br>
    $config['google_tag.settings']['default_google_tag_entity'] = '';
  4. Double check that config is actually overwritten: drush cget google_tag.settings --include-overridden
  5. Check frontend and observe that nothing changed

Proposed resolution

Add condition that respects default_google_tag_entity config option on frontend

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇱Netherlands aposudevsky Eindhoven

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

Comments & Activities

  • Issue created by @aposudevsky
  • 🇳🇱Netherlands aposudevsky Eindhoven
  • Status changed to Closed: works as designed about 1 month ago
  • 🇦🇺Australia sime Melbourne

    It's not elegant but I think it's just a case of targetting the one you want to disable, as this settings name will not changed once it's created. I think this is the correct fix as you might have multiple properties like one for Dev and one for Prod.

    $config['google_tag.container.G-12345678.69b11f0a3df9b2.11221382']['status'] = FALSE;
    
Production build 0.71.5 2024