Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GA4 Disconnected Banner CTA design when 3 or 4 metric tiles rely on GA4 #7278

Closed
jimmymadon opened this issue Jul 10, 2023 · 31 comments
Closed
Labels
P1 Medium priority Type: Enhancement Improvement of an existing feature

Comments

@jimmymadon
Copy link
Collaborator

jimmymadon commented Jul 10, 2023

Feature Description

When GA4 is disconnected and when more than 2 of the KMW tiles are dependant on GA4, we show the "Connect GA4 CTA Banner" in #6265. However, this behaviour was changed in #7337 where the individual "Connect GA4 CTA Tile" would stretch to take the space of as many GA4 widget tiles. This means that if 3 of the tiles are associated with GA4, a longer CTA tile will be displayed. The individual CTA was originally designed to cover one tile - now that this is getting longer and could potentially cover all 4 spaces, it should somehow "switch" to using the "Connect GA4 CTA Banner" component that was created in #6265.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Maintain Existing Display for 1 or 2 Metric Tiles:

Demonstrative POC Branch:

  • A POC branch has been created to demonstrate the implementation of the "Connect GA4 CTA Tile" with the ghost cards (for 3 tiles) and the "Connect GA4 CTA Banner" component (for 4 tiles).

Implement Extended "Connect GA4 CTA Tile" (For 3 Tiles):

In assets/js/components/KeyMetrics/ConnectModuleCTATile.js:

  • Check for the widgets that are reliant on GA4.
  • For 3 GA4-reliant widgets, render both GhostCardGreenSVG and GhostCardRedSVG components inside a div.
  • Arrange the cards horizontally. See the GhostCards component for implementation details.
  • Utilize the Grid->Row->Cell structure to wrap elements.
  • Ensure both existing elements and ghost cards occupy 50% width in the same row.
  • The styles should match the Figma designs.

Register the "Connect GA4 CTA" widget (for 4 tiles)

In assets/js/googlesitekit/widgets/register-defaults.js:

  • Register the ConnectGA4CTAWidget widget with the following slug and options:
    • keyMetricsConnectGA4CTA or any appropriate slug.
    • Component should be ConnectGA4CTAWidget.
    • width should be full width.
    • priority should be 1.
    • wrapWidget should be false.
    • isActive should check if GA4 is disconnected and if 4 of the selected metric tiles rely on GA4.
    • Should be registered in AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY.

In assets/js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js:

  • Check if all 4 metric tiles rely on GA4. If so, use the Null component as the second argument in the useWidgetStateEffect hook. Else, use the ConnectModuleCTATile component.

In assets/js/modules/analytics-4/components/widgets/ConnectGA4CTAWidget.js:

  • Modify the condition that renders the WidgetNull to check if 4 of the selected metric tiles rely on GA4.

Update the Stories

In assets/js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.stories.js:

  • Update the stories to have both versions with and without ghost cards.

Test Coverage

  • No new tests are to be added.

QA Brief

Adding a note here for QAB from #7285: When we test this ticket, we also need to go through these steps:

Click on the "Maybe later" CTA on the GA Disconnected widget.
Reconnect and disconnect the Analytics module.
The widget should correctly reappear.
  • Set up Site Kit and connect to GA4.
  • Set up the Key Metrics widgets.
  • Disconnect GA4.
  • For 1 or 2 KMW Tiles Reliant on GA4:
  • For 3 KMW Tiles Reliant on GA4:
    • Adjust your setup to have 3 of the selected metric tiles reliant on GA4.
    • Expect to see an extended "Connect GA4 CTA Tile Widget" as per the Figma mock, which now includes 1 or 2 or 3 ghost cards based on the container width.
    • Note: The Figma mock has only two ghost cards, but the implementation displays three for the larger container width.
    • Also note that displaying the ghost cards is implemented based on the container width, not the viewport width.
  • For 4 KMW Tiles Reliant on GA4:

Update

  • Verify that clicking the "Maybe later" button dismisses the "Connect GA4 CTA Widget" (full-width banner) permanently.

Changelog entry

  • Update the design of the CTA shown in the Key Metrics section when GA4 has been disconnected, for the cases where three or four GA4 widget tiles are present.
@jimmymadon jimmymadon self-assigned this Jul 10, 2023
@mxbclang mxbclang added P0 High priority Type: Infrastructure Engineering infrastructure & tooling labels Jul 10, 2023
@jimmymadon jimmymadon added the blocked upstream Issues which are blocked by external work label Jul 10, 2023
@jimmymadon
Copy link
Collaborator Author

Need to wait for the blocking issues here to be merged before we finalise the AC here. c.c. @bethanylang

@nfmohit
Copy link
Collaborator

nfmohit commented Jul 11, 2023

Hi, @jimmymadon! Just a heads-up that I code-reviewed #7061 and it does look like we'll need to proceed with this issue.

Currently, we're rendering a metric widget based on its availability in the response of the core/user getKeyMetrics selector, which doesn't account for the connection of GA4.

I don't think it needs to, but at least we should update the widget registrations for GA4-dependent metrics only to be active when GA4 is connected, I think that will most likely solve the issue.

Thanks!

@jimmymadon
Copy link
Collaborator Author

@nfmohit Thanks! I think the getWidgets selector takes into consideration the modules that are active if module slugs are passed as a param option. We probably don't want to modify the getKeyMetrics selector as it would be nice to know which key metrics are "selected" based on user input answers or user-picked metrics. Unless we refactor this selector to return more widget data in addition to the slugs. Of course, the exact implementation can be discussed in the IB.

@jimmymadon jimmymadon removed their assignment Jul 18, 2023
@jimmymadon jimmymadon removed the blocked upstream Issues which are blocked by external work label Jul 18, 2023
@aaemnnosttv
Copy link
Collaborator

  • There should be no console errors from requests being made by any such non-rendered widget tiles.

@jimmymadon should any requests be made at all from non-rendered widget tiles? I would think that really no side-effects should be triggered in this case since the widgets wouldn't be rendered at all? WDYT?

@jimmymadon
Copy link
Collaborator Author

@aaemnnosttv Absolutely - no requests should be made in the first place. I have worded this better.

@jimmymadon jimmymadon assigned aaemnnosttv and unassigned jimmymadon Jul 19, 2023
@aaemnnosttv
Copy link
Collaborator

Thanks @jimmymadon 👍 AC ✅

@aaemnnosttv aaemnnosttv removed their assignment Jul 20, 2023
@aaemnnosttv aaemnnosttv added Type: Enhancement Improvement of an existing feature and removed Type: Infrastructure Engineering infrastructure & tooling labels Jul 20, 2023
@hussain-t hussain-t self-assigned this Jul 21, 2023
@aaemnnosttv
Copy link
Collaborator

Reducing the priority here as discussed as non-critical for launch and more thought is needed around the full-width widget special cases.

@aaemnnosttv aaemnnosttv added P1 Medium priority and removed P0 High priority labels Jul 24, 2023
@jimmymadon jimmymadon assigned jimmymadon and unassigned hussain-t Jul 28, 2023
@jimmymadon
Copy link
Collaborator Author

@marrrmarrr @sigal-teller

As the description suggests, when engineering the full-width "Connect GA4 CTA Banner" @aaemnnosttv realised that the approach to render this banner was not in line with our existing Widgets API infrastructure. In order to reuse the Widgets API, we have decided to "stretch" the single "Connect GA4 CTA Tile" to cover as many spaces as there were GA4 widget tiles. So we are deviating slightly from the design doc here.

Originally, if 1 or 2 metric tiles were reliant on GA4, we would show the individual "Connect GA4 CTA" tile. If 3 or 4 metric tiles were reliant on GA4, then we would show the banner.

Now, in 7337, we have decided to stretch the individual "Connect GA4 CTA" tile to take up either 1, 2, 3 or 4 spaces depending on how many ever GA4 tiles there were.

The main deviation here is when 3 metrics are GA4 tiles and 1 metric is a Search Console tile. Originally, we planned to not show the SC tile and simply render the "Connect GA4 CTA" full width banner. This "special case", while possible, is causing us to deviate from patterns we use in our existing widgets API infrastructure. We also think that showing the single SC metric tile data might be helpful to some users who temporarily have some problems connecting GA4 (and not force them to hide the Key Metrics widget completely).

This issue is being treated as a "Nice to have" currently and will be implemented in the bug bash remediation sprints and so we would like to (re)define this. So in the event where 1 of the metric tiles is dependant on SC and the remaining three are dependant on GA4, how should we proceed? Some potential options:

  1. Show the SC tile and the individual "Connect GA4 CTA" metric tile stretched to 3 spaces. Looks like this:
    image (1)
  2. Show the SC tile and show the "Connect GA4 CTA" banner for the remainder 3 spaces. (Might be worth redesigning a mock here).
  3. Hide the SC tile completely and show the full-width banner as we planned originally in the design doc. (We can still engineer this somehow - not impossible).

@hussain-t hussain-t removed their assignment Sep 22, 2023
@techanvil techanvil assigned techanvil and hussain-t and unassigned techanvil Sep 26, 2023
@hussain-t hussain-t assigned techanvil and unassigned hussain-t Sep 27, 2023
techanvil added a commit that referenced this issue Sep 27, 2023
@techanvil techanvil removed their assignment Sep 27, 2023
@mohitwp mohitwp self-assigned this Sep 27, 2023
@mohitwp
Copy link
Collaborator

mohitwp commented Sep 29, 2023

QA update ❌

@hussain-t

Issue 1: I found little awkward responsive issue when viewport size is 601px to 960px. Can we show CTA with 1 ghost tile or no ghost tile in this case ?

When 2 KMW Tiles Reliant on GA4:

image

image

When 3 KMW Tiles Reliant on GA4:

image

Issue 2 : Different wording on CTA version For 4 KMW Tiles Reliant on GA4 and For 3 KMW Tiles Reliant on GA4 or For 2 KMW Tiles Reliant on GA4

image

image

Issue 3 : 'May be later' button is not functional. Nothing happen when user clicks on 'May be later' button.

image

@mohitwp mohitwp assigned mohitwp and hussain-t and unassigned mohitwp Sep 29, 2023
@hussain-t
Copy link
Collaborator

Thanks, @mohitwp. Regarding your observations:

Issue 1: I found little awkward responsive issue when viewport size is 601px to 960px. Can we show CTA with 1 ghost tile or no ghost tile in this case ?

The tile is displayed in full width regardless of the ghost cards. It's an existing issue. You can verify it in the main branch. Previously, I had discussed this with @jimmymadon as well.

I want to clarify the visibility of the ghost cards again, it is displayed based on the container width, i.e., the size of the CTA banner width, not the viewport width. Please refer to this point in the IB:

Also note that displaying the ghost cards is implemented based on the container width, not the viewport width.

CTA without the Ghost Cards

Screenshot 2023-09-29 at 3 44 39 PM

Issue 2 : Different wording on CTA version For 4 KMW Tiles Reliant on GA4 and For 3 KMW Tiles Reliant on GA4 or For 2 KMW Tiles Reliant on GA4

This is not related to this issue. @jimmymadon can provide if keeping the text as it is or changing would be preferred.

Issue 3 : 'May be later' button is not functional. Nothing happen when user clicks on 'May be later' button.

This is a valid issue. I will fix it in a follow-up PR.

@hussain-t
Copy link
Collaborator

@mohitwp, I have created a follow-up PR to fix the non-functional "Maybe later" button issue and updated the QAB.

@hussain-t hussain-t assigned techanvil and unassigned hussain-t Sep 29, 2023
techanvil added a commit that referenced this issue Oct 2, 2023
@techanvil techanvil assigned mohitwp and unassigned techanvil Oct 2, 2023
@techanvil
Copy link
Collaborator

Back to you for another pass, @mohitwp.

@jimmymadon
Copy link
Collaborator Author

Issue 2 : Different wording on CTA version For 4 KMW Tiles Reliant on GA4 and For 3 KMW Tiles Reliant on GA4 or For 2 KMW Tiles Reliant on GA4

I would like to get @sigal-teller's / @marrrmarrr's opinion here. Currently, we use the "module's name" for this CTA since it is being used by other modules as well (AdSense). When referring to Analytics throughout the plugin, we always just use "Analytics". Should the "Disconnected Module CTA"'s here be an exception where we use "Google Analytics" or should we stick to just "Analytics"? Or should we consider changing the name of Analytics to Google Analytics all throughout the plugin?

@marrrmarrr
Copy link
Collaborator

@jimmymadon Site Kit is Google's official plugin, so all the services connected are by default Google services. So I don't think it's necessary to explicitly append "Google Analytics" everywhere.

@mohitwp
Copy link
Collaborator

mohitwp commented Oct 4, 2023

QA Update ✅

  • Tested on main environment.
  • Verified GA4 Disconnected Banner CTA design when 1 or 2 or 3 or 4 metric tiles rely on GA4 as per AC.
  • Verified 'May be later' button functionality.
  • Verified that that clicking the "Maybe later" button dismisses the "Connect GA4 CTA Widget" (full-width banner) permanently.
  • Verified that after reconnecting and disconnecting analytics The widget correctly reappears.
    Note : I will create separate ticket for issue 2 reported above.
Recording.589.mp4

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests