-
Notifications
You must be signed in to change notification settings - Fork 293
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
Check GA4 measurement ID mapping from Google Tag periodically #6083
Comments
@felixarntz are we possibly in a position to add the ACs to this one now at all? And did you mention there were some additional GH issues to create now the one-pager has been approved? Just trying to work out timelines on this one holistically. |
@eclarke1 Indeed, I have this on my list for Monday. |
@hussain-t, I don't feel that we really need to change the way how the |
@eugenemanuilov that would contradict the aims of the AC, e.g.
Also, we want to run it on the same schedule; otherwise, we’ll add another regular API call. I have slightly updated the IB to rename the action and the selector. LMK WDYT? Thanks! cc: @techanvil |
@hussain-t, ok, let it be it. IB ✔️ |
Note: I initially wrote the IB to make the changes in |
@felixarntz is this part of the AC correct? Shouldn't this be "If so," (then nothing needs to happen) rather than if not? If the |
@aaemnnosttv Good catch, after reviewing, this was just a mistake in my writing of the ACs - it should be the opposite. I've updated that bit of the ACs accordingly. |
…apping Check Google Tag mapping periodically
QA Update:
|
Hi @wpdarren!
This is correct. The list of Google Tag IDs will only have items when the Google Tag ID configuration (in tagmanager.google.com) has other destinations added. So, even though the current measurement ID/destination is removed from the Google Tag configuration, if it has other destination IDs, they'll show up in the Banner Notification. Here is a screenshot of my Google Tag configuration with my test site's measurement ID/destination is removed, but it still has a different destination added: And here is a screenshot of my Banner Notification: For question 2, I have updated the QAB. It was a mistake on my end and the Google Tag settings aren't supposed to be updated automatically. Let me know what you think. Thanks! |
QA Update: ✅
The UI will be implemented in a follow up issue. |
When the
Analytics_4
module is active, Site Kit should regularly check whether the mapping between the Google Tag and the GA4 measurement ID that Site Kit has stored is still accurate. If not, it needs to alert the user about it so that they can make a decision on how to proceed.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
With the
gteSupport
feature flag enabled and the Analytics / GA4 module active: The logic added in #6082 to periodically check for the Google tag ID should be expanded. That issue added logic that populates thegoogleTagID
only when it was empty before. This issue here is focused on adding further logic for the other case (whengoogleTagID
is already set), as thegoogleTagID
needs to be regularly checked to continuously ensure its correctness (since external changes outside of Site Kit may affect it). See below for detailed requirements:googleTagID
module setting is already populated. It then needs to be checked whether the currentgoogleTagID
setting (still) refers to one of the IDs in the container'stagIds
property.googleTagID
would send the data to the wrong place (i.e. no longer to the currently configured GA4 measurement ID). Therefore, in this scenario a banner notification needs to be shown (see below).getGoogleTagContainerDestinations
selector (also see Implement Google Tag container lookup and destinations list JS selectors #6079) needs to be used, passing the currentgoogleTagAccountID
andgoogleTagContainerID
.destinationId
field.destinationId
s. It doesn't matter what it looks like, as the UI will be implemented in a follow up issue.Implementation Brief
In
assets/js/modules/analytics-4/datastore/properties.js
, add the following:setHasMismatchedGoogleTagID
which takes a boolean value and sets thehasMismatchedTag
value in the state.hasMismatchedGoogleTagID
which returns thehasMismatchedTag
value from the state.hasMismatchedTag
with a default valuefalse
.Update the
*syncGoogleTagSettings
action (which is being implemented in Populate Google Tag data for existing site using GA4 #6082) with the following:googleTagID
is already set, check if it's one of thetagIds
in thegetGoogleTagContainer.tagIds[]
array.setHasMismatchedGoogleTagID
action withtrue
.googleTagAccountID
,googleTagContainerID
andgoogleTagID
should be skipped.googleTagLastSyncedAt
timestamp hourly.In
assets/js/components/notifications
, create a new component,GoogleTagIDMismatchNotification
with the following:hasMismatchedGoogleTagID
selector.false
, returnnull
.googleTagAccountID
fromgetGoogleTagAccountID
andgoogleTagContainerID
from thegetGoogleTagContainerID
selectors.getGoogleTagContainerDestinations
selector.destinationId
property.BannerNotification
component with the following props:id
-google-tag-id-mismatch
title
-Google Tag ID mismatch
description
-The following mismatched Google Tag IDs were found: {comma-separated list of destination IDs}.
dismiss
-Cancel
Test Coverage
setHasMismatchedGoogleTagID
action andhasMismatchedGoogleTagID
selector.*syncGoogleTagSettings
action.GoogleTagIDMismatchNotification
component.QA Brief
Google tags
tab.Changelog entry
The text was updated successfully, but these errors were encountered: