Skip to content

Conversation

@asvinb
Copy link
Collaborator

@asvinb asvinb commented Dec 3, 2025

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/GOOWOO-361/hide-ui-when-gtg-feature-flag-is-disabled

Replace this with a good description of your changes & reasoning.

Screenshots:

Detailed test instructions:

  1. Enable the GTG feature flag by updating enabledFeatures in src/Admin/Admin.php to be [ 'google_tag_gateway' ]
  2. Check that the GTG component is rendered in the Settings page.
  3. Disable the GTG feature flag ( [] ).
  4. Check that the GTG component is not rendered in the Settings page and there's no mention of GTG when an Ads account is not connected in the settings page.
  5. Also check the GTG tour is not rendered if the feature flag is not set and the onboarding success modal does not mention GTG.

Additional details:

Changelog entry

This commit introduces a feature toggle for Google Tag Gateway, enabling conditional rendering based on feature flags. It includes new constants, hooks, and UI updates to support this functionality.
@github-actions github-actions bot added type: enhancement The issue is a request for an enhancement. changelog: add A new feature, function, or functionality was added. labels Dec 3, 2025
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.8%. Comparing base (84c06b6) to head (247cf57).
⚠️ Report is 1 commits behind head on feature/GOOWOO-263-google-tag-gateway.

Files with missing lines Patch % Lines
src/Admin/Admin.php 0.0% 3 Missing ⚠️
...rnal/DependencyManagement/AdminServiceProvider.php 0.0% 2 Missing ⚠️
...ges/product-feed/submission-success-guide/index.js 80.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                            Coverage Diff                             @@
##             feature/GOOWOO-263-google-tag-gateway   #3162      +/-   ##
==========================================================================
- Coverage                                     67.5%   66.8%    -0.8%     
- Complexity                                       0    5116    +5116     
==========================================================================
  Files                                          357     868     +511     
  Lines                                         5812   26227   +20415     
  Branches                                      1437    1444       +7     
==========================================================================
+ Hits                                          3924   17510   +13586     
- Misses                                        1717    8546    +6829     
  Partials                                       171     171              
Flag Coverage Δ
js-unit-tests 67.6% <91.7%> (+<0.1%) ⬆️
php-unit-tests 66.5% <58.3%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
js/src/constants.js 100.0% <100.0%> (ø)
js/src/utils/isFeatureEnabled.js 100.0% <100.0%> (ø)
src/Options/Features.php 90.2% <100.0%> (ø)
...ges/product-feed/submission-success-guide/index.js 62.1% <80.0%> (+3.7%) ⬆️
...rnal/DependencyManagement/AdminServiceProvider.php 0.0% <0.0%> (ø)
src/Admin/Admin.php 0.0% <0.0%> (ø)

... and 507 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ankitguptaindia ankitguptaindia self-requested a review December 9, 2025 11:22
@ankitguptaindia
Copy link
Collaborator

QA Status: Need Feedback/fixes. ⚠️

Summary

When the GTG feature flag is disabled by setting enabledFeatures => [] in src/Admin/Admin.php, the UI components are correctly hidden, but GTG scripts continue to be injected into the frontend source code. I believe the feature flag should remove both UI setting AND script injection.

@asvinb Please let me know if this is intentional behaviour?

Steps to Reproduce

  1. Open src/Admin/Admin.php
  2. Set enabledFeatures to an empty array:
    'enabledFeatures' => [],
  3. Save the file and refresh WordPress admin
  4. Navigate to the Settings page
    • Expected: GTG component is not visible (this works correctly)
  5. Visit the frontend website and view page source
    • Bug: GTG scripts are still present in the HTML:
      <script>
      (function(w,i,g){w[g]=w[g]||[];if(typeof w[g].push=='function')w[g].push.apply(w[g], i)})
                  (window,['AW-16732375809'],'google_tags_first_party');
      </script>
      <script src="/wp-content/plugins/google-listings-and-ads/vendor/google/gtg-ads/dist/measurement.php?id=AW-16732375809" async>
      </script>
Recording.1594.mp4

@asvinb
Copy link
Collaborator Author

asvinb commented Dec 9, 2025

@ankitguptaindia That's correct. GTG scripts should not be present on the FE. @jamesmorrison @jjgrainger Can you kindly take a look please? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: add A new feature, function, or functionality was added. type: enhancement The issue is a request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants