Skip to content

Add UTM card to Stats#25178

Merged
kean merged 2 commits intotrunkfrom
task/utm-sources-card
Jan 30, 2026
Merged

Add UTM card to Stats#25178
kean merged 2 commits intotrunkfrom
task/utm-sources-card

Conversation

@kean
Copy link
Contributor

@kean kean commented Jan 28, 2026

Description

Closes CMM-597: Add UTM sources chart.

Similarly to #25176, it "simply" introduces one more "Top List" item type: "UTM". I used the Calypso codebase as a reference for implementing it. There is nothing out of the ordinary in this PR.

Testing instructions

I tested it end-to-end on one of the production sites. Ping me if you need more details.

Screenshots

Screenshot 2026-01-28 at 4 28 47 PM

@kean kean added this to the 26.7 milestone Jan 28, 2026
@kean kean added the Stats label Jan 28, 2026
@kean kean requested a review from crazytonyli January 28, 2026 21:35
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@kean kean force-pushed the task/utm-sources-card branch from 2b3b6dc to 9651a5d Compare January 28, 2026 21:36
@kean
Copy link
Contributor Author

kean commented Jan 28, 2026

I'm not sure why the web has a different blue. I thought I used the same one in the app. It's now clear side-by-side it's not. I'll look into ways to make them more consistent.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 28, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30680
VersionPR #25178
Bundle IDorg.wordpress.alpha
Commitf48ea71
Installation URL13fq71hqqhq0o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 28, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30680
VersionPR #25178
Bundle IDcom.jetpack.alpha
Commitf48ea71
Installation URL6v1mfcfoaohbg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@kean kean force-pushed the task/utm-sources-card branch 2 times, most recently from bcd62b0 to 2871861 Compare January 29, 2026 14:38
// If it's a single value, return it in an array
// Remove surrounding quotes if present
let trimmed = key.trimmingCharacters(in: CharacterSet(charactersIn: "\""))
return [trimmed]
Copy link
Contributor

Choose a reason for hiding this comment

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

Something like this, so that we don't need to manually parse the quotes and square brackets?

let decoder = JSONDecoder()
let data = key.data(using: .utf8)
if let values = try? decoder.decode([String].self, from: data) {
  return values
}
if let string = try? decoder.decode(String.self, from: data) {
  return [string]
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's defensive code. It does look cleaner with decoder. Updated.

Base automatically changed from task/devices-card to trunk January 30, 2026 16:45
@kean kean force-pushed the task/utm-sources-card branch from 2871861 to f48ea71 Compare January 30, 2026 19:15
@kean kean enabled auto-merge January 30, 2026 19:15
@sonarqubecloud
Copy link

@kean kean added this pull request to the merge queue Jan 30, 2026
Merged via the queue into trunk with commit 4f770f6 Jan 30, 2026
32 of 34 checks passed
@kean kean deleted the task/utm-sources-card branch January 30, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants