Review getDefaultTagId()

Created on 20 March 2025, 16 days ago

Problem/Motivation

getDefaultTagId() appears that it should be checking for the first GTM code in the list to match GOOGLE_TAG_MANAGER_MATCH regex. However, the condition is === 0 meaning that it will return the first code that doesn't match the regex of GOOGLE_TAG_MANAGER_MATCH

I believe the condition should be === 1 and the first code in tests should be 'GTM-XXXXXX' instead of 'GT-XXXXXX'

Steps to reproduce

Change the unit test to 'GTM-XXXXXX' in PageAttachmentsHookTest::testAttachments and see it fail.

Proposed resolution

Change the condition and update the tests to use the correct code.

Remaining tasks

Review the incoming merge request

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States andyg5000 North Carolina, USA

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

Comments & Activities

Production build 0.71.5 2024