'Response statuses' settings (admin/config/system/google_tag) do not appear to be honored. The default configuration is as follows:

  • Override path condition for listed response statuses
    • Unchecked
  • Listed statuses
    • 403 Forbidden
    • 404 Not Found

The GTM snippet appears on pages regardless of the 'response statuses' settings.

Even with 'response statuses' setting configured, the status under the vertical tab item is displayed as 'No statuses'

Steps to Reproduce

  • Enable Google Tag Manager module
  • Navigate to a restricted page that will result in a 403 response code
  • View page source to verify GTM snippet is loading
    • GTM snippet should not be loading per 'response statuses' settings
  • Navigate to a non-existent page that will result in a 404 response code
  • View page source to verify GTM snippet is loading
    • GTM snippet should not be loading per 'response statuses' settings

Comments

solotandem’s picture

Status: Active » Needs review
StatusFileSize
new743 bytes

The logic was incorrect for the case of the status condition not being enabled. If enabled, then the condition is applied properly.

Please test with latest commit and report your findings.

chris burge’s picture

When I originally posted, I misunderstood the purpose of the 'response statuses' function. I have applied the patch and can confirm the 'response statuses' feature now works as designed.

chris burge’s picture

Status: Needs review » Closed (fixed)