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

Show a small overlay/callout to AdSense + GA4 users who have linked their account and now have data available to see in a widget #8237

Closed
11 tasks
tofumatt opened this issue Feb 8, 2024 · 8 comments
Labels
javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues P1 Medium priority Sp Wk 2 Issues to be completed in the second week of the assigned sprint Type: Feature New feature

Comments

@tofumatt
Copy link
Collaborator

tofumatt commented Feb 8, 2024

Feature Description

Similar in style to the callout added for users who have not linked their accounts (see #8236), we should have a callout/notification for users when there is data available for their accounts after they have been linked. Note that the style is different to many "post-connection" notifications, and instead uses a small callout/overlay.

When clicked, the "Show me" CTA button should scroll the user to the widget that displays the new info.

Figma design: https://www.figma.com/file/7ba0pj1rLuvLvJhy3NiHOj/AdSense?type=design&node-id=10-5478&mode=design&t=lwcDSKVER9BoOVmZ-0

Screenshot 2024-02-19 at 23 35 03


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

Acceptance criteria

  • This overlay should only be rendered when the ga4AdSenseIntegration feature flag (Add ga4AdSenseIntegration feature flag #8288) is enabled. When it is disabled, there should be no overlay/prompt shown.
  • When a user has both AdSense and Analytics 4 modules connected, and the adSenseLinked setting (see Update Analytics_4 settings to include AdSense Link-related Settings fields (adSenseLinked and adSenseLinkedLastSyncedAt) #8047) is set AND there is data to see in the AdSense + GA4 Top Earnings Pages report (see:
    const args = {
    startDate,
    endDate,
    dimensions: [ 'ga:pageTitle', 'ga:pagePath' ],
    metrics: [
    { expression: 'ga:adsenseRevenue', alias: 'Earnings' },
    { expression: 'ga:adsenseECPM', alias: 'Page RPM' },
    {
    expression: 'ga:adsensePageImpressions',
    alias: 'Impressions',
    },
    ],
    orderby: {
    fieldName: 'ga:adsenseRevenue',
    sortOrder: 'DESCENDING',
    },
    limit: 5,
    };
    const data = useInViewSelect( ( select ) =>
    select( MODULES_ANALYTICS ).getReport( args )
    );
    ), an overlay informing them that their accounts are now linked and data is available to view (see screenshot/Figma design) should appear in the bottom-right corner of the page.
    • If this overlay appears, the notice from Show a small notification when AdSense + GA4 accounts are detected as linked #8238 should be dismissed and not shown to the user.
    • The overlay should be fixed to always appear in the bottom corner of the screen regardless of page scroll position.
    • The overlay should match the Figma design, including the image. On mobile, it can probably span the full-width of the screen.
    • The primary CTA should dismiss the overlay (so it does not appear again) and scroll the user down to the Top Earning Pages widget in the "Monetization" section of the Site Kit Dashboard.
    • The secondary CTA should dismiss the overlay, causing it to no longer appear.
  • Copy:
    • Top heading: See your top earning content
    • Content: Data is now available for the pages that earn the most AdSense revenue.
    • Primary CTA: Show me
    • Secondary CTA: Maybe later

Implementation Brief

  • Create an overlay notification (assets/js/components/OverlayNotification/AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification.js) using the OverlayNotificationBase component with this overlay's content, roughly:
<OverlayNotificationBase>
  <svgHeader />
  <Heading>See your top earning content</Heading>
  <Text>Data is now available for the pages that earn the most AdSense revenue.</Text>
  <Button>Show me</Button>
  <Button>Maybe later</Button>
</OverlayNotificationBase>
  • This styles used for Show a small overlay/callout to AdSense + GA4 users whose accounts are not linked #8236 should largely/entirely be applicable here, except the different SVG header.
  • A new constant can be made in this file for dismissing this notification (eg. ANALYTICS_ADSENSE_OVERLAY_DETECTED_AS_LINKED_DISMISSED = 'analytics-and-adsense-overlay-are-linked';)
  • Both CTA buttons should use const { dismissItem } = useDispatch( CORE_USER ); and dismissItem( ANALYTICS_ADSENSE_OVERLAY_DETECTED_AS_LINKED_DISMISSED )
  • The primary CTA should scroll the user to the "Top Earning Pages" widget in the "Monetization" section of the Site Kit Dashboard.
  • This component should only render when:
    • The ga4AdSenseIntegration feature flag is enabled
    • Analytics is connected
    • The can access Analytics (eg. select( CORE_USER ).hasAccessToShareableModule( 'analytics-4' ))
    • select( CORE_USER ).isItemDismissed( ANALYTICS_ADSENSE_OVERLAY_DETECTED_AS_LINKED_DISMISSED ) is false
  • Use the useOverlayNotification hook to manage the state of this overlay, similar to Show a small overlay/callout to AdSense + GA4 users whose accounts are not linked #8236, but with the component name 'AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification' as an argument, eg useOverlayNotification( 'AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification' ).

Test Coverage

  • Add VRTs for the AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification component.

QA Brief

  • Connect Analytics, AdSense and Link AdSense Account and Analytics property.
  • Visit Site Kit Dashboard so a cron is scheduled for syncing the linked state. See QAB of Schedule a cron task to sync adSenseLinked status #8049 for details.
  • Wait or manually trigger scheduled cron tasks.
  • Ensure linked state is updated to true. googlesitekit.data.select('modules/analytics-4').getAdSenseLinked().
  • If the connected property has AdSense data, the overlay notification should show up, Verify copy, graphics and the CTA behaviors described in the ACs.

Changelog entry

  • Add a notification for users who have linked AdSense and Analytics accounts when data becomes available to view in their dashboard.
@tofumatt tofumatt self-assigned this Feb 8, 2024
@tofumatt tofumatt added P1 Medium priority Module: Analytics Google Analytics module related issues javascript Pull requests that update Javascript code Next Up Issues to prioritize for definition labels Feb 8, 2024
@bethanylang
Copy link
Collaborator

@tofumatt @marrrmarrr Some comment as #8236, should we add a "The" in front of "top earning content" here?

@tofumatt
Copy link
Collaborator Author

Assigning this a rough estimate of 15 just for planning purposes, but as soon as someone can take on the IB it might need slight adjustment.

@tofumatt tofumatt self-assigned this Feb 22, 2024
@tofumatt
Copy link
Collaborator Author

Marking this as blocked by #8236, because it contains the logic to deal with showing these notifications in general…

@tofumatt tofumatt removed their assignment Feb 23, 2024
@bethanylang bethanylang added Sp Wk 1 Issues to be completed in the first week of the assigned sprint Sp Wk 2 Issues to be completed in the second week of the assigned sprint and removed Sp Wk 1 Issues to be completed in the first week of the assigned sprint labels Feb 23, 2024
@bethanylang
Copy link
Collaborator

Thanks @tofumatt! I've added a Sp Wk 2 label here and a Sp Wk 1 label to #8237, since these are both planned for Sprint 122.

@eugene-manuilov eugene-manuilov self-assigned this Feb 26, 2024
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Feb 27, 2024
@bethanylang bethanylang removed the Next Up Issues to prioritize for definition label Feb 28, 2024
@kuasha420 kuasha420 self-assigned this Mar 1, 2024
@kuasha420 kuasha420 added the Type: Feature New feature label Mar 3, 2024
@kuasha420 kuasha420 removed their assignment Mar 15, 2024
@zutigrm zutigrm assigned zutigrm and kuasha420 and unassigned zutigrm Mar 18, 2024
@kuasha420 kuasha420 assigned zutigrm and unassigned kuasha420 Mar 20, 2024
@zutigrm zutigrm removed their assignment Mar 20, 2024
@tofumatt tofumatt assigned tofumatt and kuasha420 and unassigned tofumatt Mar 20, 2024
@kuasha420 kuasha420 assigned tofumatt and unassigned kuasha420 Mar 21, 2024
@tofumatt tofumatt removed their assignment Mar 21, 2024
@mohitwp mohitwp self-assigned this Mar 25, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 1, 2024

QA Update ❌

  • Tested on dev environment.
  • Verified overlay with Figma design.
  • Verified overlay in different viewports.
  • Verified behaviour of both Primary and secondary CTA's.
  • Verified overlay on 'View only' dashboard.
  • Verified that on entity dashboard overlay is not showing.

@zutigrm

Issue

I noticed clicking on Primary CTA not scrolling down to Monetization section as mentioned in AC.

The primary CTA should dismiss the overlay (so it does not appear again) and scroll the user down to the Top Earning Pages widget in the "Monetization" section of the Site Kit Dashboard.

Admin Main Dashboard

Recording.841.mp4

View only Dashboard

Recording.842.mp4

Q-2) I noticed that overlay is showing for all admin and on all view only dashboard. Is this expected ?

image

PASS CASES

image

Recording.840.mp4
>

@mohitwp mohitwp assigned zutigrm and kuasha420 and unassigned mohitwp and zutigrm Apr 1, 2024
@kuasha420
Copy link
Collaborator

Thanks @mohitwp ! I've fixed the scrolling on a follow up PR. And yes, it's fine to appear on second admins and view only dashboard provided that the Second Admin has access to both Analytics and Adsense or both modules are shared.

Sending back to CR.

@kuasha420 kuasha420 removed their assignment Apr 2, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Apr 2, 2024
@tofumatt tofumatt assigned tofumatt and mohitwp and unassigned tofumatt Apr 2, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 3, 2024

QA Update ✅

  • Tested on dev environment.
  • Verified that issue mentioned above is resolve now and scroll is implemented successfully.
  • Verified on mobile viewports.
  • Verified on view only dashboard.
  • Verified overlay with Figma design.
  • Verified overlay in different viewports.
  • Verified behaviour of both Primary and secondary CTA's.
  • Verified overlay on 'View only' dashboard.
  • Verified that on entity dashboard overlay is not showing.
Recording.851.mp4
Recording.852.mp4

image

Recording.840.mp4

@mohitwp mohitwp removed their assignment Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code Module: Analytics Google Analytics module related issues P1 Medium priority Sp Wk 2 Issues to be completed in the second week of the assigned sprint Type: Feature New feature
Projects
None yet
Development

No branches or pull requests

7 participants