DEV Community

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

Rick Viscomi on September 26, 2018

What is CrUX The Chrome UX Report (AKA "CrUX") is a dataset of real user experiences measured by Chrome. Google releases monthly snaps...
Collapse
 
shmdhussain12 profile image
Mohamed Hussain • Edited

How to have the customized crUX dashboard, clicked the chrome ux dashboard, there I am able to see only the report FCP chart only .

I am seeing only one option to edit the origin name only, not able to customize the metrics and dimensions to match my needs

as you shown, how to compare two websites and how to see the users distribution of devices

Collapse
 
rick_viscomi profile image
Rick Viscomi

Great question. You're right, it's not obvious. I will write up a short guide on how to make a competitive dashboard.

Collapse
 
shmdhussain12 profile image
Mohamed Hussain

After playing with it, found out how to see the device distribution and connection type...still not able to compare with competitions....one doubt any idea why unnesting the perf data (fcp) in from clause of sql...

Thread Thread
 
hulyacobans profile image
Hülya Çoban

You can use this dashboard with competitors!

datastudio.google.com/u/0/reportin...

Thread Thread
 
shmdhussain12 profile image
Mohamed Hussain

Thank you so much Hulya ...I used your report. It is working good.

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 ?

Collapse
 
souders profile image
Steve Souders

You mention that people should plug their URL into PageSpeed Insights to see if CrUX data is available for the URL, but it's cumbersome to come up with a list of URLs and test each one. Is there a way to get a list of URLs that have data in CrUX for a given domain?

Collapse
 
rick_viscomi profile image
Rick Viscomi

To check if a single origin or URL is in CrUX, the PSI web UI is the quickest way.

If you have a batch of known URLs you can use a script similar to the PSI Monitoring code to test them all against the PSI API.

If you have a batch of known origins, you could write a query against the BigQuery dataset similar to SELECT DISTINCT origin FROM chrome-ux-report... WHERE origin IN (a,b,c).

To get all unknown URLs for a given origin, there is no equivalent queryable dataset. The only scenario I can imagine this info being provided is if the requester can verify permission from the webmaster.

Collapse
 
ahmadawais profile image
Ahmad Awais ⚡️

This was super insightful, thanks a lot for putting this all up here, Rick.

P.S. Long time no see. 🙌

Collapse
 
rick_viscomi profile image
Rick Viscomi

Thanks Ahmad!

Collapse
 
ahmadawais profile image
Ahmad Awais ⚡️ • Edited

One thing folks, make sure all the URLs are in lowercase — since DomainName like CamelCase in my case 🤣 didn't work on page insights.

Collapse
 
rick_viscomi profile image
Rick Viscomi

Yes and generally I'd recommend people plug their URLs into PageSpeed Insights as a first step to 1) see if it's supported by CrUX ("Unavailable" or not), and 2) resolve it to its canonical URL. Then you can take that and plug it into BigQuery, Data Studio, or the PSI API with confidence.

Thread Thread
 
ahmadawais profile image
Ahmad Awais ⚡️

Makes sense. Thanks for explaining. ✅

Collapse
 
aaronpeters profile image
Aaron Peters • Edited

Hey Rick,

I've adapted the Google Sheets + App Script + daily monitor and all is well, except: I keep running into the issue with getting Quota exceeded errors. Don't understand this at all, as the quota are way higher than what I need, e.g. 100 request per 100 seconds. My script does a request to the API once a day, for 5 URLs. The Google Cloud Console shows I've done 11 requests today and yet the Quota exceeded error is returned.
Any tips for getting this solved?
As it is now, I can't rely on the data getting pulled in.

Collapse
 
rick_viscomi profile image
Rick Viscomi

Hi Aaron. Can you add me as an editor of your script/sheet so I can debug?

Collapse
 
aaronpeters profile image
Aaron Peters

Hi Rick, sent DM via Twitter ... and you took a look, thanks so much !!

Collapse
 
paleofit profile image
paleofit

8/6/2019 the PSI code I got from this article started throwing this error: TypeError: Cannot read property "metrics" from undefined. (line 40, file "Code"). Anyone else?

Could it be related to the new chrominium stuff that's happening to Google tools? webmasters.googleblog.com/2019/08/...

Collapse
 
yewei1993 profile image
yewei1993

Hi Rick,

I am relatively new to Java but is it possible to get the rating (Fast,Average or Slow) as well as the median FCP and DCL for each of the origins? Like the one that is showing on the PSI web UI.

Thanks!

Collapse
 
tobstar profile image
tobstar

This has been awesome for me, but on 19/02/07 it stopped working on a few of the competitors I was tracking.

I get the following error: TypeError: Cannot read property "metrics" from undefined. (line 46, file "Code")

For 5 of 12 to stop working overnight that can't be a coincidence, any ideas?

It's stopped on one of my sites as well so that might help diagnose the issue....

Collapse
 
mattiemarc profile image
Marc v Herrikhuijzen

Howdy Rick,

When adding the PSI_API_KEY to script properties I can not fill in the API KEY, there is no field available to enter the KEY. Am I missing a step? Or I authorised the PSI API in the GCP.

Thanks in advance.

Collapse
 
fedex1 profile image
Ralph Yozzo

Hi Rick, Thanks for the useful presentation on Core Web Vitals, etc. at GDGNYC yesterday.

I copied the Apps Script sheet that you referred to above and also in the presentation.

I needed to change one line:

var pageSpeedUrl = 'googleapis.com/pagespeedonline/v5/...' + url + '&fields=loadingExperience&key=' + pageSpeedApiKey + '&strategy=' + strategy;

I changed from v4 to v5

I'm not sure if others also would be affected so I post this in case it will help others.

Ralph

Collapse
 
rick_viscomi profile image
Rick Viscomi

Hi Ralph, glad you found it useful!

This is an old blog post for using the PSI API. If you want to use the CrUX API, I'd recommend taking a look at this Apps Script file instead: github.com/GoogleChrome/CrUX/blob/...

Collapse
 
akhiljp_dev profile image
Akhil Jay

Hi Rick, what does this line exactly mean "return data.loadingExperience.metrics.FIRST_CONTENTFUL_PAINT_MS.distributions[0].proportion;" ?

I have gone through and setup the steps you have provided, but curious to know what the values in the column mean (i.e the percentage of FCP values in google sheets).

Collapse
 
rick_viscomi profile image
Rick Viscomi

Hi Akhil, these values represent the percent of user experiences that are considered "fast" for the given metric.

Collapse
 
rhymes profile image
rhymes

This is all amazing Rick! Thank you!

Collapse
 
hulyacobans profile image
Hülya Çoban

Hello Rick, is there any problem with the script on sheets? I just couldn't make it work, even if I write the API key :/

Collapse
 
gabortordaseo profile image
Gabor Torda

Guys, how to do that comparison stats side-by-side for 2 domains in data studio?

Collapse
 
rick_viscomi profile image
Rick Viscomi

I'll share another post documenting how to do that. Thanks for reminding me.

Collapse
 
4ps_andyl profile image
Andrew Limn

Hey Rick do you know if there are plans to provide First Input Delay data too via the Page Speed Insights API?

Thanks for sharing

Collapse
 
rick_viscomi profile image
Rick Viscomi

Just to update, FID is now available in PageSpeed Insights v5! \o/