Skip to content

Conversation

@rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Nov 18, 2022

Part of: #8156

Description

This PR adds Networking support for retrieving the Average Order Value data from requests to GET /wc-analytics/reports/revenue/stats, to use on the Order Analytics card in Analytics Hub.

(We already make requests to this endpoint when dashboard stats load on the My Store screen but we aren't yet using Average Order Value in the app.)

Changes

  • Adds the averageOrderValue property to the OrderStatsV4Totals model.
  • Updates unit tests, mocks, etc to include this property.

Testing

  1. Build and run the app.
  2. When your dashboard stats load, confirm there are no decoding errors.

Submitter Checklist

Update release notes:

  • 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 category: tracks Related to analytics, including Tracks Events. label Nov 18, 2022
@rachelmcr rachelmcr added this to the 11.4 milestone Nov 18, 2022
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 18, 2022

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8157-5289894 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@rachelmcr rachelmcr marked this pull request as ready for review November 18, 2022 17:03
Copy link
Contributor

@Ecarrion Ecarrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Are you planning to update the storage layer in the next PR? If not I think the changes won't be reflected when fetched via the results controller.

@rachelmcr
Copy link
Contributor Author

Are you planning to update the storage layer in the next PR?

Yep! #8162 updates the storage layer so we can store and fetch this data.

@rachelmcr rachelmcr merged commit 207ea58 into trunk Nov 21, 2022
@rachelmcr rachelmcr deleted the issue/8156-orders-analytics-networking branch November 21, 2022 10:58
@rachelmcr rachelmcr linked an issue Dec 5, 2022 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Analytics Hub] Add support for Orders Analytics card data

4 participants