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

[GLA Analytics] Add view model for Google Campaigns analytics card #13199

Merged
merged 11 commits into from
Jun 28, 2024

Conversation

rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Jun 28, 2024

Closes: #13186

Why

This adds the UI support needed to display the Google Campaigns analytics card in the Analytics Hub. (Fetching and displaying the card will be done in another PR; for now, the card is still not displayed.)

How

  • Adds the Google Programs web report to AnalyticsWebReport, so we can link from the card to the full web report.
  • Adds a property showImage to TopPerformersRow.Data. This defaults to true but allows us to hide the image placeholder in the list of campaigns.
  • Adds a property topPerformersTitle to AnalyticsTopPerformersCard, to allow a different title for the card and for the list of top performers. (In this case, "Google Campaigns" for the card and "Campaigns" for the list.)
  • Adds a view model GoogleAdsCampaignReportCardViewModel to handle the data for the Google Campaigns card.
    • Parses the GoogleAdsCampaignStats for the current and previous period to get the current Total Sales metric and percent change.
    • Parses the GoogleAdsCampaignStats for the current period to get the list of top 5 campaigns by total sales.
    • Provides a link to the Google Programs web report.

Testing information

The new Google Campaigns card isn't yet displayed in the Analytics Hub. There should be no changes to current behavior, in particular no changes to the images showing in the existing top performers cards (Products and Bundles).

To test:

  1. Build and run the app.
  2. Select "View all store analytics" on a dashboard card to open the Analytics Hub.
  3. Confirm all cards load with the expected content (no change from before). In particular, confirm the images and web reports load as expected.

Screenshots

Google Campaigns card Loading card Card with error
Screenshot 2024-06-28 at 16 57 33 Screenshot 2024-06-28 at 16 57 55 Screenshot 2024-06-28 at 16 58 19

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@rachelmcr rachelmcr added the feature: analytics hub In-app store analytics label Jun 28, 2024
@rachelmcr rachelmcr added this to the 19.4 milestone Jun 28, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 28, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr13199-7a0c0b3
Version19.2
Bundle IDcom.automattic.alpha.woocommerce
Commit7a0c0b3
App Center BuildWooCommerce - Prototype Builds #9810
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@rachelmcr rachelmcr merged commit 1b1a5b5 into trunk Jun 28, 2024
22 checks passed
@rachelmcr rachelmcr deleted the issue/13186-campaigns-card-vm branch June 28, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: analytics hub In-app store analytics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GLA Analytics] Add UI for Google Campaigns analytics card
2 participants