DEV Community

Discussion on: A step by step guide to monitoring the competition with the Chrome UX Report

Collapse
 
sbonnetcds profile image
sbonnet-cds

Hi !
I saw that the FID metrics hab been recently added to the PSI reports.
How can we access this new metric from the API ?
I try to adapt the script in the google sheet exemple you gave tu us Rick but i need some help..
Thanks

Collapse
 
rick_viscomi profile image
Rick Viscomi

Hey! FID data is only available in v5 of the PageSpeed Insights API, and we have v4 hard-coded in the Apps Script.

Here's an example of a v5 API query with FID in the results: developers.google.com/apis-explore...

To get FID from the v5 API results, we'd also need a new function to extract it from the JSON data:

function getFastFID(data) {
  return data.loadingExperience.metrics.FIRST_INPUT_DELAY_MS.distributions[0].proportion;
}
Collapse
 
sbonnetcds profile image
sbonnet-cds

Thanks Rick !
It's Ok and i have my FID metrics :-)

Other question : I was monitoring the median FCP but, in the V5 API, the median is no longer in the json response...
Do you know why ?
If i want to continue with this metric and keep history of it : i have to stay on the V4 version ?