Discover how to integrate PageSpeed Insights and Databox, leveraging PSI's API to analyze and visualize your website's Core Web Vital metrics.
IN THIS ARTICLE
PageSpeed Insights (PSI) performs in-depth analysis of individual URLs, providing granular diagnostic information and actionable suggestions to improve page performance. PSI delivers both lab data (simulated performance) and field data (real-world user experiences), offering a comprehensive breakdown of various performance metrics beyond Core Web Vitals. This tool is ideal for obtaining specific recommendations and detailed insights to enhance the speed and user experience of particular web pages.
If you are unfamiliar with the Metric Builder, or need assistance setting up the metrics, feel free to reach out to our Support Team at firstname.lastname@example.org.
You can also book a call with one of our product experts:
- If you are a paying customer, book a call here
- Other Databox users, book a call here
The table below shows how the integration is implemented and provides additional helpful resources and information.
|Account Permissions Required
|API Versions Supported
|Any (v5 as of November 2023)
|API Scopes Required
How to connect PageSpeed Insights to Databox
Go to Data Manager > + New connection. Type PageSpeed Insights in the search bar and click on the Connect button. Next, click on the green Connect now button.
This will open the Authorization window, where you will be prompted to enter your Google login credentials and authorize the Databox app.
How to visualize data from PageSpeed Insights
First you'll need to create Custom Metrics using the Metric Builder. To do that, reference the API documentation for specifics on what parameters should be used.
- Navigate to Metrics > Custom Metrics to access the Metric Builder.
- Click the green + New Custom Metric button and select the PageSpeed Insights connection in Data Source drop-down list.
- Find the relevant endpoint in the API documentation that can be used to return the data you need. The base URL is already predefined, you only need to input the missing part of the chosen endpoint's URL.
- Add the query parameters. Parameters are required to specify the URL to pull data for, as well as information related to strategy and UTM parameters. They are defined as key-value pairs. Multiple parameters can be added by clicking on the + control.
- Add any necessary headers. v5 does not require any headers but this could change with future updates to the API.
- Once you have all necessary fields populated, click on the green Continue button. You will be directed to the Select value step.
- In the Select value step, select a property in the response that includes the metric value you'd like to use for the metric. A metric value must always be numeric.
- Once you have selected the value, click on the green Continue button.
- The Segment by dimension step is optional. This step will be taken into account only when you are trying to create a dimensional metric.
- If you'd like to segment your metric by multiple dimensions, choose one to complete during this set up, then start over and select a different dimension until each dimensional metric is created.
To skip this step, select None.
- The Select date step is optional as well. You can choose between:
- Use current time of storing data (Dynamic): select this option if you want to associate the values with the current time. You'll likely be using this option since the API does not return historical data.
- Use a field from response (optional): select this option if there is a date associated with each value.
- In the Preview & Customize step, you can see the JSONata expression that has been created based on the chosen options.
Pro tip: You can customize the JSONata expression in the right-hand panel, if you need further customization. More information about JSONata can be found here
- To continue, click on the Preview data button to apply the JSONata expression to the response received from the API. You should see a table with dates, values and dimensions (if selected).
- After you have previewed your data and verified it is working as expected, click on the green Continue button to proceed to the last step of the metric setup.
- In the Describe metric step, populate the following:
- Name your metric: a name for the metric.
- Data aggregation: this determines how the data is handled. It impacts the way data is grouped and displayed for longer Date Ranges. Learn more here.
- Favorable trend: this affects how comparison values (i.e. deltas) are calculated and displayed on our visualizations. Choose UP if higher values are more disabled, and DOWN otherwise.
- Once you completed the Describe metric step, click the green Continue button to save the metric in your account.
Below is a compiled list of suggested metrics that you can create from this integration.
Largest Contentful Paint (LCP) - Desktop
First Contentful Paint (FCP) - Desktop
Desktop Time to First Byte (TTFB)
Interaction to Next Paint (INP) - Desktop
First Input Delay (FID) - Desktop
Cumulative Layout Shift (CLS) - Desktop
Here are a few points to keep in mind about this integration.
Historical Data: The PageSpeed Insights API lacks historical data for its performance metrics. However, by utilizing Databox, you can gather and accumulate the values received during each sync. This accumulation enables you to approximate and track the changes in performance metrics over time, similar to what is displayed in the Google Search Console reports.
Lab vs Real-World Data: you can distinguish between them by referencing their properties in the response: originLoadingExperience and loadingExperience, respectively.