Chapter 6. Getting a PageSpeed Insights API Key

How the Key Is Used Pro

  • It is stored in your site's JCH Optimize settings, as your AI provider's key is. Bulk Settings leaves it alone: it isn't exported, an import doesn't replace it, and resetting to the default settings keeps it.

  • It is sent to JCH Optimize's analysis service with each step of a run, and used only to measure that run's pages with PageSpeed Insights. The service keeps it encrypted while the run goes on and deletes it when the run ends. It never appears in the service's logs or in the diagnostic details kept for support (see the section called “Your Data, Your Key and Your Costs”).

If Google refuses the key, because it isn't valid, the PageSpeed Insights API isn't enabled in its project, or it is restricted to other APIs or to a website or IP address, the run stops for review with Google refused your PageSpeed Insights API key. Check the key against the steps above, save it again, and start a new run.

When Google stops answering a key's requests for a moment, the run waits a minute and asks again. If Google still doesn't answer, the run pauses (state paused) where it was. Nothing it has done is lost, and the run window says what you can do:

  • On JCH Optimize's shared key, its daily limit is used up for every site. Enter your own key in the run window and click Save my key and resume the run: the key is saved in your settings, as if you had saved it with your AI provider's key, and the run measures on it from where it stopped. Try the shared key again resumes on the shared key, which answers again once Google's daily limits renew, at midnight Pacific Time.

  • On your own key, its quota is used up for now, or it was sent more requests at once than Google takes. Wait for the quota to renew (a daily quota renews at midnight Pacific Time), or raise it in the Google Cloud console on the PageSpeed Insights API's Quotas page. Check that nothing else uses the key, such as another site or a monitoring tool, since they share its quota. Or enter a key from another Google Cloud project in the run window: each project has a quota of its own. Then click Resume the run.

If the pause comes while the run checks your live site, the run's settings are already on your site and stay there; resuming checks the live site again, and the run can't be cancelled meanwhile. A paused run waits for two weeks.