As your agency adds more clients, maintaining high performance across all the sites you manage can quickly become a challenge. Poorly coded plugins, unoptimized images, and third-party scripts can slow down your client sites and gradually lower PageSpeed Insights (PSI) scores.

Instead of manually checking each WordPress site, you can automate performance monitoring across all your sites and focus on investigating anomalies only when they arise, saving your team hours of work each month through simple, efficient automated checks.

In this article, you’ll learn how to automate your workflow for monitoring the performance of all your agency’s Kinsta-hosted WordPress sites by using the Kinsta API and Google PageSpeed Insights API together. As a final step, you will learn how to share this data with your team in real-time using Slack webhooks and automate the process with a cron job.

Exciting, right? Let’s get started.

Workflow overview: Kinsta to PageSpeed Insights to Slack

The script links three APIs. Kinsta, Google PageSpeed Insights, and Slack, to automate site performance monitoring.

Start by querying the Kinsta API to fetch your website domains and environments. This ensures your domain list stays current as you add client sites.

Then, for each site returned by the Kinsta API, your script uses the Google PSI API to extract key metrics: Performance Score (0–100), First Contentful Paint (FCP), and Largest Contentful Paint (LCP).

Finally, the script posts these metrics, site name, the three scores, and a PageSpeed Insights link to a designated Slack channel.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.