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
UseSnippetSwitch
components for all three modulesanalytics
,analytics-4
, andtagmanager
should have theirisSetup
prop removed again. Instead, they should going forward always use the styling that is currently only present in case theisSetup
prop is active (i.e. the description is in a smaller font size and closer to the toggle label). - The
SettingsUseSnippetSwitch
components for all three modulesanalytics
,analytics-4
, andtagmanager
should be updated as follows:- If there is an existing tag, they should display the same copy like their respective
SetupUseSnippetSwitch
counterpart. - 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 === false
condition 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
ExistingTagNotice
used in Analytics should be entirely removed, as it is now covered by the above information in the toggle, even in the settings UI. - The
FormInstructions
in Tag Manager should have all information related to existing tags removed and theshowExistingTagMessage
prop 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
UseSnippetSwitch
components ofanalytics
,analytics-4
andtagmanager
modules:- Remove
isSetup
prop and the class that it adds conditionally. - Remove unused imports.
- Remove
- In
assets/sass/components/global/_googlesitekit-use-snippet-switch.scss
- Remove the
&--setup
and put all the styles inside.googlesitekit-analytics-usesnippet, .googlesitekit-tagmanager-usesnippet
.
- Remove the
- Update the
SettingsUseSnippetSwitch
ofanalytics
module:- Get
existingTag
andpropertyID
using their respective selectors. - If
canUseSnippet === false
, returnThe code is controlled by the Tag Manager module.
as the description. - If there’s an
existingTag
, return thedescription
from theSetupUseSnippetSwitch
component of the same module, based on the value ofpropertyID === existingTag
. - if there’s no
existingTag
, continue returning the currentdescription
based on the value ofuseSnippet
andcanUseSnippet
.
- Get
- Update the
SettingsUseSnippetSwitch
ofanalytics-4
module:- Get
existingTag
andmeasurementID
using their respective selectors. - If there’s an
existingTag
, return thedescription
from theSetupUseSnippetSwitch
component of the same module, based on the value ofmeasurementID === existingTag
. - if there’s no
existingTag
, continue returning the currentdescription
based on the value ofuseSnippet
.
- Get
- Update the
SettingsUseSnippetSwitch
oftagmanager
module:- Get
containerID
usinggetPrimaryContainerID
andexistingTag
usinggetExistingTag
selectors. - If there’s no
existingTag
, continue returning the currentdescription
based on the value ofuseSnippet
. - If there’s an
existingTag
, return thedescription
from theSetupUseSnippetSwitch
component of the same module, based on the value ofprimaryContainerID === existingTag
.
- Get
- Update
SetupUseSnippetSwitch
ofanalytics
,analytics-4
andtagmanager
modules:- Remove
isSetup
prop from theUseSnippetSwitch
element as it is no longer used.
- Remove
- Remove
assets/js/modules/analytics/components/common/ExistingTagNotice.js
and all its usage. - In
assets/js/modules/tagmanager/components/common/FormInstructions.js
:- Remove
showExistingTagMessage
prop. - Remove
hasExistingTag
constant. - 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
showExistingTagMessage
prop fromFormInstructions
element 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.