question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 UseSnippetSwitch using the .googlesitekit-analytics-usesnippet--setup and .googlesitekit-tagmanager-usesnippet--setup classes.
    • 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.scss file to the assets/sass/admin.scss file.
  • Update UseSnippetSwitch component of both analytics, analytics-4 and tagmanager modules:
    • Make the description prop to accept react node (PropTypes.node).
    • Additionally take another boolean prop isSetup.
    • using classnames package, add googlesitekit-analytics-usesnippet--setup/googlesitekit-tagmanager-usesnippet--setup class to the parent div based on the value of isSetup prop.
    • Render the description node below the Switch.
  • Update SetupUseSnippetSwitch component of analytics, analytics-4 and tagmanager modules:
    • Construct the description nodes by breaking up the two sentences into two separate paragraphs and pass it to the description prop of UseSnippetSwitch element.
    • Additionally pass isSetup to the aforementioned element.
  • Update SettingsUseSnippetSwitch component of analytics, analytics-4 and tagmanager modules:
    • Pass the description string wrapped in paragraph as react node to the UseSnippetSwitch element to account for the changes made to the element.
  • Complete and merge #5115
    • The PR only has changes needed for tagmanager module so far.

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:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
wpdarrencommented, Apr 25, 2022

QA Update: ✅

Verified;

  • Checked the Snippet Toggles on UA, GA4 and Tag Manager module and confirmed they match the Figma design.
  • Tested on desktop and small screen sizes.
Section Title

image

image

1reaction
tofumattcommented, Apr 20, 2022

@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 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GA4] Troubleshoot tag setup on your website - Analytics Help
The measurement code is not installed on your website. You can install Google Analytics on your website using the Google tag (gtag.js) or...
Read more >
How to Setup and Install Google Analytics 4 with Google Tag ...
Here's the process of how to install Google Analytics 4 with Google Tag Manager: Create a new GA4 property; Create a data stream...
Read more >
Ensure the toggle to allow Site Kit to place Analytics tracking ...
Some possible solutions to ensure users have Analytics tracking code remaining on their site (if chosen) include: Adding a notice when disconnecting Tag...
Read more >
GA4 Form Tracking via Google Tag Manager - Optimize Smart
Learn to set up GA4 form tracking via Google Tag Manager. ... Name your new tag, select 'Google Analytics: GA4 Event' as the...
Read more >
Google Tag Manager Tutorial for Beginners (2022) - YouTube
A step-by-step guide on how to get started with Google Tag Manager (and install Google Analytics 4)If you are working with Google Analytics...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found