Fix UI for new Analytics and Tag Manager toggles in setup
See original GitHub issue#4913 and #4934 introduce a similar new kind of snippet toggle in the Analytics and Tag Manager module setup UI. However, the styling of that toggle does not follow the Figma design as it should have.
See for example the screenshots in https://github.com/google/site-kit-wp/issues/4913#issuecomment-1072353138: Comparing that to the Figma design for the toggle with its label and explanation text, we can see that the explanation needs to be in a smaller font size and it needs to be indented to the same horizontal position as the label, to make it more visually clear that it belongs together with the toggle.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The style for the new setup toggle (not settings toggle) for Analytics and Tag Manager should be fixed to follow the Figma design.
Implementation Brief
Note: This should be implemented based on the feature/existing-tag-simplification branch.
- Create
assets/sass/components/global/_googlesitekit-use-snippet-switch.scss.- Target the Setup Variants of Analytics and Tag Manager
UseSnippetSwitchusing the.googlesitekit-analytics-usesnippet--setupand.googlesitekit-tagmanager-usesnippet--setupclasses. - Using the above classes adjust the margin and font size of paragraphs and other tags to match Figma design.
- Include the newly created
_googlesitekit-use-snippet-switch.scssfile to theassets/sass/admin.scssfile.
- Target the Setup Variants of Analytics and Tag Manager
- Update
UseSnippetSwitchcomponent of bothanalytics,analytics-4andtagmanagermodules:- Make the
descriptionprop to accept react node (PropTypes.node). - Additionally take another boolean prop
isSetup. - using
classnamespackage, addgooglesitekit-analytics-usesnippet--setup/googlesitekit-tagmanager-usesnippet--setupclass to the parentdivbased on the value ofisSetupprop. - Render the
descriptionnode below theSwitch.
- Make the
- Update
SetupUseSnippetSwitchcomponent ofanalytics,analytics-4andtagmanagermodules:- Construct the
descriptionnodes by breaking up the two sentences into two separate paragraphs and pass it to thedescriptionprop ofUseSnippetSwitchelement. - Additionally pass
isSetupto the aforementioned element.
- Construct the
- Update
SettingsUseSnippetSwitchcomponent ofanalytics,analytics-4andtagmanagermodules:- Pass the
descriptionstring wrapped in paragraph as react node to theUseSnippetSwitchelement to account for the changes made to the element.
- Pass the
- Complete and merge #5115
- The PR only has changes needed for
tagmanagermodule so far.
- The PR only has changes needed for
Test Coverage
- VRTs may need updating
QA Brief
- Use Snippet Toggles of Analytics, Analytics 4 and Tag Manager module will match the Figma design.
- Caveat: The font sizes will not match exactly as we use a different base font size compared to the Figma design. However they should be roughly proportional and convey the same design intent.
Changelog entry
- N/A
Issue Analytics
- State:
- Created a year ago
- Comments:5

Top Related StackOverflow Question
QA Update: ✅
Verified;
Section Title
@kuasha420 Assigning this to you since you did the IB + proof-of-concept, but if that’s wrong feel free to unassign yourself and I can grab it for this sprint 👍🏻