Google PageSpeed Insights API
Prospect customers on our Enterprise level plans can now use the Google PageSpeed Insights test within their reports, as opposed to using Prospect’s own website speed test. However, for this to work a valid Google API key is required and this page provides information on how to set this up.
Generate an API key
This guide assumes you have access to a Google Developer account, as you will need to generate an appropriate API key which will be used in your Prospect account.
- Go to https://console.developers.google.com/ – you may need to agree to the terms of service if you have not accessed the console recently
- At the top of the screen, you should see an option called “Enable APIs and Services” – select that:
- On the next screen, you can see all the services available that you can generate API keys for – please note, this does not mean that Prospect offers all the same services. Search or find “PageSpeed Insights API” and then select it
- Once the page loads, select the “Enable” option:
- You now need to create a new project by clicking the “Create” button – you will then be asked for a project name (i.e. Silktide Prospect), an organisation and location – the latter two are usually related to your own Google account:
- Once the project has been completed, you may need to click “Enable” again as shown in step 4 – if not, continue to the next step
- Now, you will need to create credentials for the integration to work. You can either click on the “Create Credentials” button, or use the “Credentials” option on the left-side menu:
- If you have used the “Create Credentials” button, this process is slightly different. You will need to select the service you are creating the credentials for – in the drop-down menu that appears, select “PageSpeed Insights API” and then select the “What credentials do I need?” option – your API key will be shown on the next screen – it is usually a 30+ combination of randomized numbers and letters
- If you have used the “Credentials” option on the left side, you can select the “Create credentials” drop down button and then select “API key” – your API key will be shown
Adding the API key to Prospect
Once you have generated your API key using the method outlined above, you will need to add this to your Google PageSpeed Insights test inside your Prospect account. This assumes you are an administrator of the Prospect account in question, as only administrators have the ability to customize the tests carried out.
- Log into your Prospect account as normal
- Go to the account settings dashboard (profile icon –> account settings)
- Select the analysis tab
- From the menu on the left, select test configuration
- Scroll down to the test called Website speed (PageSpeed Insights) and enable the test using the toggle switch
- A small cog should appear next to the toggle switch – select that to open the configuration options for that test
- Paste your API key into the box called “API key”
- If required, review the score weight by adjusting the slider
- Once done, scroll to the bottom of the screen and hit save.
The above will configure the test accordingly and will use the API key that you just generated. The final step of this is to add the new website speed test to your overview screen to ensure that it appears in the relevant section. Additional information on how to customize the overview layout screen is available on this page.
You should now be able to display Google’s PageSpeed Insights test results in your Prospect report – this will only apply to reports created after the API key was generated and added to your account, but retesting any existing reports will show the new test.