-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add web vital attribution data (#1584)
## What are you changing? Updates web-vitals to 1. Send attribution data with CLS, LCP and INP 2. A new endpoint. The data will now go to the [events collector](https://github.com/guardian/events-collector). The events collector does not have separate endpoints for CODE and PROD environments. Instead, this stage is determined by the isDev parameter and added to the payload to allow us to separate the dataset by stage in big query. ## Why? Additional attribution data will help with diagnosing web vital issues on DCR. As well as this, the events collector provides a more agnostic schema with a focus on anonymity of data and is a more fitting pipeline for this dataset.
- Loading branch information
Showing
6 changed files
with
1,253 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@guardian/core-web-vitals': major | ||
--- | ||
|
||
This major change adds attribution data on 3 core web vital metrics; CLS, INP, and LCP. It also updates the endpoint so that this data will now be sent to a new table in big query. We now send the stage as a value to big query, rather than using separate endpoints. In addition, null values have been removed in favour of undefined. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
libs/@guardian/core-web-vitals/src/@types/CoreWebVitalsPayload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
export type CoreWebVitalsPayload = { | ||
page_view_id: string | null; | ||
browser_id: string | null; | ||
fid: null | number; | ||
cls: null | number; | ||
lcp: null | number; | ||
fcp: null | number; | ||
ttfb: null | number; | ||
inp: null | number; | ||
page_view_id: string; | ||
browser_id: string; | ||
cls: number; | ||
cls_target: string; | ||
inp: number; | ||
inp_target: string; | ||
lcp: number; | ||
lcp_target: string; | ||
fid: number; | ||
fcp: number; | ||
ttfb: number; | ||
stage: 'CODE' | 'PROD'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.