Scaffold the Setup Component variants
See original GitHub issueFeature Description
Prepare the Setup Component variants based on the presence of an existing GA4 property in the user’s Analytics account (“existing GA4 property”) and/or existing manually inserted tag on the page (“existing tag”).
- No existing GA4 property, no existing tag.
- CTA button: Create property.
- Existing GA4 property, no existing tag.
- CTA button: Connect.
- Existing GA4 property, existing tag.
- CTA button: Connect.
- No existing GA4 property, existing tag.
- CTA button: Create property.
Ensure the relevant variant is displayed, showing the text as per the design. If necessary, modify the BannerNotification component to allow content to be displayed below the CTA - a footer prop could be appropriate.
However do not implement the dropdown or toggle controls for the “existing GA4 property” variants, they will be added separately.
- Design Doc: https://docs.google.com/document/d/1DeWo38lcV7lvLFfcmt-mQ0iaxzB4qfiPArs_yZzYkIM/edit#heading=h.2g0r7ejoqctz
- Figma: https://www.figma.com/file/vMaCWwr6lpk4PrJWb7jIpz/GA4-Banner-Input?node-id=1082%3A1549
Acceptance criteria
- The placeholder version of the Setup Component (see #5270) should be replaced with the fully-realised design - except for the dropdown and toggle controls (which will be implemented in another issue, see: #5276). For reference, see Figma.
- For each variant display text as follows.
- No existing GA4 property, no existing tag.
- Title: No existing Google Analytics 4 property found, Site Kit will help you create a new one and insert it on your site
- CTA button: Create property.
- Footer: You can always add/edit this in the Site Kit Settings.
- Existing GA4 property, no existing tag.
- Title: Connect the Google Analytics 4 property that’s associated with your existing Universal Analytics property
- CTA button: Connect.
- Footer: You can always add/edit this in the Site Kit Settings.
- Existing GA4 property, existing tag.
- Title: Connect the Google Analytics 4 property that’s associated with your existing Universal Analytics property
- CTA button: Connect.
- Footer: You can always add/edit this in the Site Kit Settings.
- No existing GA4 property, existing tag.
- Title: No existing Google Analytics 4 property found, Site Kit will help you create a new one and insert it on your site
- CTA button: Create property.
- Footer: A GA4 tag {property_ID} is found on this site but this property is not associated with your Google Analytics account. You can always add/edit this in the Site Kit Settings.
- No existing GA4 property, no existing tag.
Implementation Brief
In assets/js/components/notifications/BannerNotification/index.js:
- Add an optional
footerprop of typePropTypes.node. - If
footeris provided, render it within a newRowat the end of theGrid.
In assets/js/modules/analytics-4/components/dashboard/ActivationBanner/SetupBanner.js:
- To check for an existing GA4 property, use the
MODULES_ANALYTICS_4store’sgetMeasurementIDselector. - To check for an existing tag, use the
MODULES_ANALYTICS_4store’sgetExistingTagselector. - For each variant described in the AC, set the corresponding
BannerNotificationprops:titlewith the specified Title text.ctaLabelwith the specified CTA button text.footerwith the specified Footer text.
- The footer may benefit from wrapping in a paragraph
pfor styling.
Make any styling updates needed.
BannerNotificationstyles can be found inassets/sass/components/global/_googlesitekit-publisher-wins.scss- Consider adding
assets/sass/components/activation/_googlesitekit-ga4-activation-banner.scssif it makes sense to do so.
Test Coverage
- Add Storybook stories for the new Activation Banner variations and add to the VRT suite.
QA Brief
- Activate the
ga4ActivationBannerfeature flag from the tester plugin. - Go to the Site Kit Dashboard.
- Click on
Set up nowin the displayed banner. - Verify that the banner displayed afterwards matches the text in the AC and designs in Figma (do not that due to the GM2+, some styles may be different).
- Verify the
Modules/Analytics4/ActivationBanner/SetupBannerstory displays correctly.
Changelog entry
- N/A
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top Results From Across the Web
Scaffold a Feature and create a Rendering Variant ... - YouTube
Scaffold a Feature and create a Rendering Variant enabled component clone · Key moments. View all · Key moments · Description · Key...
Read more >Create and use variants - Figma Help Center
Variants allow you to group and organize similar components into a single container. This simplifies your component library and makes it easier for...
Read more >Material Components and layouts | Jetpack Compose
Scaffold. Compose provides convenient layouts for combining Material Components into common screen patterns. Composables such as Scaffold provide slots for ...
Read more >Vue Enterprise Patterns - How to Build Components With ...
We have a basic setup, so let's add CSS variables and styles for each of the variants in the BaseButton component.
Read more >Scaffolding | Adobe Experience Manager
Component dialogs provide fields for only those values needed to define the content of a single specific component. A scaffold dialog must ...
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

Adding a note to mention that the IB and subsequent implementation was a bit wrong here and we should have been checking the result of the
analytics-4getPropertiesselector to check for an existing property/properties, rather thangetMeasurementID.This has come up while QAing https://github.com/google/site-kit-wp/issues/5276 and a followup PR to that issue has been created to fix it: https://github.com/google/site-kit-wp/pull/5793
Thank you for the review, @techanvil!
@wpdarren That would be fab! I’m already working on #5276 and I have already included the fixes there. Thank you!