-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amend GA4 tag placement logic to use Google Tag ID if set #6080
Comments
IB ✅ |
NOTE: This issue is blocked by #6078 in Sprint 91. |
…le-tag Place Google Tag ID if available instead of GA4 tag
QA Update: ✅@kuasha420 it's my understanding that we were going to do some quick checks and move this ticket to approved. We need to make sure any additional testing would be picked up in #6081. My understanding is that you completed some regression testing and all seems good. I have therefore moved this to approved! |
Gave this a quick review as well; a simple change that will get more testing before we start to roll it out as well, but LGTM 👍 |
Instead of assuming that the GA4 web data stream measurement ID is the correct ID to inject in the frontend, the
Analytics_4\Web_Tag
implementation needs to instead place the Google Tag ID determined by the module (will be implemented in a separate issue) if it is already set. Existing sites may not have it set yet, so in those cases it still needs to fall back to using the measurement ID like it has been doing.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Analytics_4
module should, if thegteSupport
feature flag from Implement Google Tag container lookup and destinations list REST data points #6078 is enabled and if the newgoogleTagID
module setting from Add Google Tag settings to theAnalytics_4
module #6077 is set, use that tag ID in the JS gtag snippet, instead of themeasurementID
.measurementID
as a fallback if that value is not set / empty.Implementation Brief
includes/Modules/Analytics_4.php
,register_tag
method,gteSupport
feature flag is enabled via theFeature_Flags::enabled
method.googleTagID
from the module settings ($settings
) is set and if it's the case, instantiateWeb_Tag
with thegoogleTagID
settings value, if not, fallback to the existingmeasurementID
.Test Coverage
QA Brief
QA:Eng
gteSupport
feature flag from the tester plugin.<script>
tag with the IDgoogle_gtagjs-js-after
.gteSupport
feature flag is disabled, verify that the Google Tag ID is replaced with the fallback GA4 measurement ID.Changelog entry
The text was updated successfully, but these errors were encountered: