Finalize Analytics & Tag Manager informing about existing tags
See original GitHub issueFollow-up to #4913, #4934, #5046.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Relying on the feature/existing-tag-simplification branch:
- The
UseSnippetSwitchcomponents for all three modulesanalytics,analytics-4, andtagmanagershould have theirisSetupprop removed again. Instead, they should going forward always use the styling that is currently only present in case theisSetupprop is active (i.e. the description is in a smaller font size and closer to the toggle label). - The
SettingsUseSnippetSwitchcomponents for all three modulesanalytics,analytics-4, andtagmanagershould be updated as follows:- If there is an existing tag, they should display the same copy like their respective
SetupUseSnippetSwitchcounterpart. - If there is no existing tag, they should display the same copy that they display today.
- The only exception / additional requirement here is for
analytics: In there, thecanUseSnippet === falsecondition should still take precedence. In other words, if Tag Manager has prevented tag placement by Analytics, that message should still be displayed even if there is an existing tag.
- If there is an existing tag, they should display the same copy like their respective
- The
ExistingTagNoticeused in Analytics should be entirely removed, as it is now covered by the above information in the toggle, even in the settings UI. - The
FormInstructionsin Tag Manager should have all information related to existing tags removed and theshowExistingTagMessageprop should be removed as well, as it is now covered by the above information in the toggle, even in the settings UI.
Implementation Brief
Any PR for this must be based on and target the feature/existing-tag-simplification branch.
- In
UseSnippetSwitchcomponents ofanalytics,analytics-4andtagmanagermodules:- Remove
isSetupprop and the class that it adds conditionally. - Remove unused imports.
- Remove
- In
assets/sass/components/global/_googlesitekit-use-snippet-switch.scss- Remove the
&--setupand put all the styles inside.googlesitekit-analytics-usesnippet, .googlesitekit-tagmanager-usesnippet.
- Remove the
- Update the
SettingsUseSnippetSwitchofanalyticsmodule:- Get
existingTagandpropertyIDusing their respective selectors. - If
canUseSnippet === false, returnThe code is controlled by the Tag Manager module.as the description. - If there’s an
existingTag, return thedescriptionfrom theSetupUseSnippetSwitchcomponent of the same module, based on the value ofpropertyID === existingTag. - if there’s no
existingTag, continue returning the currentdescriptionbased on the value ofuseSnippetandcanUseSnippet.
- Get
- Update the
SettingsUseSnippetSwitchofanalytics-4module:- Get
existingTagandmeasurementIDusing their respective selectors. - If there’s an
existingTag, return thedescriptionfrom theSetupUseSnippetSwitchcomponent of the same module, based on the value ofmeasurementID === existingTag. - if there’s no
existingTag, continue returning the currentdescriptionbased on the value ofuseSnippet.
- Get
- Update the
SettingsUseSnippetSwitchoftagmanagermodule:- Get
containerIDusinggetPrimaryContainerIDandexistingTagusinggetExistingTagselectors. - If there’s no
existingTag, continue returning the currentdescriptionbased on the value ofuseSnippet. - If there’s an
existingTag, return thedescriptionfrom theSetupUseSnippetSwitchcomponent of the same module, based on the value ofprimaryContainerID === existingTag.
- Get
- Update
SetupUseSnippetSwitchofanalytics,analytics-4andtagmanagermodules:- Remove
isSetupprop from theUseSnippetSwitchelement as it is no longer used.
- Remove
- Remove
assets/js/modules/analytics/components/common/ExistingTagNotice.jsand all its usage. - In
assets/js/modules/tagmanager/components/common/FormInstructions.js:- Remove
showExistingTagMessageprop. - Remove
hasExistingTagconstant. - Remove the message that is shown based on the above prop and constant.
- Remove unused proptype and import.
- Remove
- in
assets/js/modules/tagmanager/components/settings/SettingsForm.js:- Remove
showExistingTagMessageprop fromFormInstructionselement as it’s no longer used.
- Remove
Test Coverage
- Update any failing (E2E) tests.
QA Brief
- For Analytivs, Analytics 4 and Tag Manager module, all the existing tag related messages are collocated with their respectibe Snippet Toggle Switch for both Setup and Settings Pages.
- GTM related messages are still placed on top of Setup/Settings Forms.
- Make sure copy matches AC.
Changelog entry
- Ensure that snippet toggle in Analytics and Tag Manager correctly inform about existing tags.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Analyze existing tag configurations - Google Developers
To assess your existing tags, use the following resources: Google Tag Assistant; Features within Google Tag Manager; Manual code inspection techniques ...
Read more >Google tag management - Analytics Help
To see all the tags you have access to, go to Google Tag Manager and click the “Google tags” tab on the Accounts...
Read more >Simplify Tag Manager UX for existing tags #4713 - GitHub
Tag manager Setup will show updated copy when there is Existing Tag to make user aware that they can select the Account and...
Read more >Server-side Tagging In Google Tag Manager - Simo Ahava
An introduction to Server-side tagging in Google Tag Manager. The article contains examples and walkthroughs for getting started with the ...
Read more >Conversion tracking for websites - Twitter for Business
New Deduplication Logic. Revamped Pixel Helper. Updated Tag Manager Templates. These updates should not disrupt existing measurement or campaign performance.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

There’s a few E2E that selects element/waits for elements based on texts that is being changed here. Shouldn’t be a huge deal, just use new/different texts for those and it should be GTG. Cheers.
cc @kuasha420 This is the follow up issue for #5046.