google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 291 forks source link

Filter Analytics data for Top Earning Content/Top Earning Pages to only include revenue from AdSense #8281

Closed tofumatt closed 8 months ago

tofumatt commented 8 months ago

Feature Description

Currently, the Top Earning Content Key Metric Tile (#6248) and the Top Earning Pages widget with GA4 data (#8059) do not filter out non-AdSense revenue. As discussed with @marrrmarrr in Slack (https://10up.slack.com/archives/CFFRMC5DE/p1708363912766809?thread_ts=1708361122.867059&cid=CFFRMC5DE), both these components' reports should filter out any data that does not include revenue sourced from AdSense.

The report data can be filtered by AdSense accountID to ensure only AdSense data is shown in Site Kit.


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

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

When the ga4AdSenseIntegration feature flag is disabled, this KMW tile should not appear.

Changelog entry

tofumatt commented 8 months ago

IB ✅

mohitwp commented 8 months ago

QA Update ❌

@benbowler

![image](https://github.com/google/site-kit-wp/assets/94359491/cd569a79-58df-4931-a2a8-ffcf61982c8e) ![image](https://github.com/google/site-kit-wp/assets/94359491/048d7d70-05d1-48fd-bc0a-d38819b265ee)

Q-2) As per Reports we are showing Total revenue in widgets which is the sum of Purchase revenue + Subscription Revenue + Ad revenue. Is this correct as we need to show only Ad Revenue.

image

benbowler commented 8 months ago

Hey @mohitwp, thanks for your QA. I've created a new PR and put this back to CR to confirm the approach. Both widgets for me now show the same revenue values for each page.

To your second point, it is not possible to filter by adSourceName in the GA4 dashboard and there is no page data in the AdSense reporting, therefore the report URL we are using in the widget is the best link we can get.

kuasha420 commented 8 months ago

@mohitwp Back to you for another pass.

mohitwp commented 8 months ago

QA Update ⚠️

@benbowler The 'Top earning pages' KM widget and Dashboard widgets are displaying the same data for the first page in the list on the Main Dashboard. However, when we visit the related report it shows different earnings.This discrepancy only occurs with the first page in the list; other pages display consistent earnings numbers on both the main dashboard and in the Analytics report.

![image](https://github.com/google/site-kit-wp/assets/94359491/6aaeea73-1332-485a-95a9-6abcf82e0e0d) ![image](https://github.com/google/site-kit-wp/assets/94359491/9c52084c-2026-4b1e-a6f0-3b2bafb80417) ![image](https://github.com/google/site-kit-wp/assets/94359491/51a81f3b-8e29-47c6-9f28-f69a63a2bbe4)
benbowler commented 8 months ago

Hey @mohitwp this is expected, unfortunately there is not a report in GA4 that we can link to that shows just the AdSense revenue (It's actually not possible in the GA4 interface to filter by the Ad Source Name as we can do in the API).

mohitwp commented 8 months ago

@benbowler Just wondering why this is happening only in case of first page in the list ?As you can see in screenshots shared above Rest of the pages are showing same earning on main dashboard widgets and under GA4 report.

benbowler commented 8 months ago

Hey @mohitwp, as I mentioned in Slack yesterday, by looking at some revenue reports in the GA dashboard I can confirm the only revenue source on oi.ie is the sites AdSense account.

I took another look at the widgets code an found that the pageTitle dimension, when removed, gives the correct full revenue amount for all pages. My hypothesis is the page title changed during the last 28 days meaning this dimension split the revenue shown in the widgets.

I've now created a follow up PR to bring the report numbers back into check, to match the report in GA.

kuasha420 commented 8 months ago

@mohitwp Back to you for another pass, hopefully all works this time. :pray:

mohitwp commented 8 months ago

QA Update ✅

![image](https://github.com/google/site-kit-wp/assets/94359491/fc4f6f39-7207-4a03-a57f-ba879116c537) ![image](https://github.com/google/site-kit-wp/assets/94359491/e7a7d1fd-27de-4406-91b6-10fb7c1e1fc3) ![image](https://github.com/google/site-kit-wp/assets/94359491/11e22d09-57d6-40f7-82dc-8ecd16493571)