Description
SiteMetrics by Codengine brings the numbers you check every week into one WordPress admin screen. Connect the services you use, generate a report with one click, and export it to Excel or Google Sheets. Every integration is optional: the plugin reports only what you have connected, and values a service does not return are shown as “Not available”, never estimated.
Key benefits
- One overview for PageSpeed, Search Console, Google Analytics 4 and Ahrefs.
- Reports you can share: Excel (.xlsx) or Google Spreadsheet, with a tab per integration.
- History of your five most recent reports, with side-by-side comparison.
- Automatic reports on a daily, weekly or monthly schedule.
- Read-only access to Google data; API keys, OAuth secret and tokens stored encrypted.
PageSpeed Insights
- Performance, Accessibility, Best Practices and SEO scores for Mobile and Desktop.
- Lab metrics: First Contentful Paint, Largest Contentful Paint, Total Blocking Time, Cumulative Layout Shift and Speed Index, with target values.
- Audit details page for each category and device, grouped like Lighthouse into Opportunities, Diagnostics and Passed audits, with the audit tables returned by Google.
- Mobile and Desktop are analysed in parallel to shorten report time.
Google Search Console
- Clicks, impressions, average CTR and average position for the selected period, with a daily trend line.
- Breakdowns by device, country, top queries and top pages.
- Sitemap status (submitted, last read, errors and warnings).
- Index status of the home page and top pages through the URL Inspection API.
Google Analytics 4
- Active users, new users, sessions and engagement rate, with daily trend lines.
- User acquisition and traffic acquisition by channel, landing pages, events, browsers and top pages.
Ahrefs Site Audit
- Health Score, crawled URLs and URLs with errors from your Ahrefs Site Audit project.
- Issue distribution, top issues and HTTP status counts from the crawled pages.
- Requires an Ahrefs plan with API v3 access and a Site Audit project for the website.
Reports, history and comparison
- Generate a report from the Generate report menu at the top of every SiteMetrics page, as an Excel report or a Google Spreadsheet.
- Choose the period for Search Console and GA4 data: last 7 days, 28 days, 3, 6 or 12 months.
- The Reports page keeps your five most recent reports, with Open report, Compare and Details.
- Compare any report with the previous one, or pick two reports, to see what improved or declined in every integration.
- Automatic reports (Settings): daily, weekly or monthly with WP-Cron, with their own data period and format. Off by default.
Security and privacy
- Google access is read-only (Search Console and Analytics). Google Sheets export uses the drive.file permission, which only allows the plugin to open the spreadsheets it creates.
- Saved keys and secrets are never sent back to the browser; they are shown masked.
- Credentials are encrypted in the database with a key derived from your wp-config.php security keys.
- The plugin does not track your site’s visitors.
SiteMetrics by Codengine is an independent plugin. It is not affiliated with or endorsed by Google or Ahrefs. PageSpeed Insights, Google Search Console, Google Analytics and Google Sheets are trademarks of Google LLC; Ahrefs is a trademark of Ahrefs Pte. Ltd.
External services
SiteMetrics by Codengine connects to third-party services only when the corresponding integration is configured or a report/export action using that service is requested. These services are not used to track WordPress site visitors through the plugin.
Google PageSpeed Insights
The plugin uses the Google PageSpeed Insights API to analyze a URL and return website performance, accessibility, best-practices, SEO, and Lighthouse data. The URL being tested, selected strategy (mobile or desktop), requested categories, locale, and configured PageSpeed API key are sent to Google when a PageSpeed report is generated or the API key is validated.
Service: https://pagespeed.web.dev/
Terms: https://policies.google.com/terms
Privacy: https://policies.google.com/privacy
Google Search Console
The plugin uses the Google Search Console API to access reporting data for a Search Console property after the site administrator connects a Google account and grants the requested OAuth permissions. The plugin sends the selected Search Console property, reporting date range, requested dimensions and limits, the URLs of the home page and top pages for URL Inspection, and the OAuth access token required to authorize the API request. When the administrator disconnects Google, the token is sent to Google’s OAuth revocation endpoint (https://oauth2.googleapis.com/revoke). Search Console response data is processed to build the report.
Service: https://search.google.com/search-console/
Terms: https://policies.google.com/terms
Privacy: https://policies.google.com/privacy
Google API terms: https://developers.google.com/terms
Google user data policy: https://developers.google.com/workspace/workspace-api-user-data-developer-policy
Google Analytics Data API
The plugin uses the Google Analytics Data API to retrieve analytics reports for a configured GA4 property after the site administrator connects a Google account and grants the requested OAuth permissions. The plugin sends the configured GA4 property identifier, report dimensions/metrics and date-range parameters, together with the OAuth access token required to authorize the request. The returned analytics data is processed to build the report.
To list the GA4 properties the connected account can access (so the administrator can pick one), the plugin also calls the Google Analytics Admin API (accountSummaries.list) with the same OAuth token. To list Search Console properties it calls the Search Console sites.list method.
Service: https://analytics.google.com/
Terms: https://policies.google.com/terms
Privacy: https://policies.google.com/privacy
Google API terms: https://developers.google.com/terms
Google user data policy: https://developers.google.com/workspace/workspace-api-user-data-developer-policy
Google Sheets
The plugin uses the Google Sheets API only when the administrator chooses Google Spreadsheet as the report format and has granted the optional Google Sheets export permission. That permission uses the drive.file scope, which lets the plugin open only the spreadsheets it creates. It sends the generated report rows and formatting instructions to create, populate and format the spreadsheet.
Service: https://sheets.google.com/
Terms: https://policies.google.com/terms
Privacy: https://policies.google.com/privacy
Google API terms: https://developers.google.com/workspace/terms
Google user data policy: https://developers.google.com/workspace/workspace-api-user-data-developer-policy
Ahrefs
The plugin uses the Ahrefs API (v3, Site Audit endpoints) when an Ahrefs API key is configured and a report is generated or the key is tested. It sends the API key and the site/project parameters needed to read the Site Audit project for this website, and processes the returned Health Score, crawl statistics, issues and page data. Site Audit requests consume Ahrefs API units; the number of Page Explorer requests per report is limited (3 by default, adjustable with the wrws_ahrefs_max_page_requests filter).
Service: https://ahrefs.com/
Terms: https://ahrefs.com/legal/terms
Privacy: https://ahrefs.com/legal/privacy-policy
Data storage and authorization
Google OAuth authorization is initiated only when an administrator chooses to connect Google services. The OAuth authorization code is exchanged with Google for access credentials, and the resulting credentials are stored in the WordPress site’s options for subsequent authorized API requests. Report data and integration configuration are stored on the WordPress site where the plugin is installed.
Privacy
SiteMetrics by Codengine does not use the connected services to track WordPress site visitors. External API requests are made only when the relevant integration is configured and the corresponding connection, report, validation, or export action is performed.
The plugin stores its configuration and generated report history using WordPress data storage on the site where the plugin is installed. API keys, the Google OAuth client secret and Google OAuth tokens are stored encrypted in the WordPress database, using a key derived from the security keys in wp-config.php.
Installation
- In WordPress, go to Plugins > Add New > Upload Plugin, choose the plugin ZIP and click Install Now (or upload the
web-insights-by-codenginefolder to/wp-content/plugins/). - Activate the plugin. A SiteMetrics menu appears in the WordPress admin.
- Open SiteMetrics > Integrations and set up the services you want to use (see below).
- Click Generate report at the top of any SiteMetrics page and choose Excel report or Google Spreadsheet.
- Optional: turn on scheduled reports in SiteMetrics > Settings > Automatic reports.
Requirements
- WordPress 5.8 or later and PHP 7.4 or later.
- An administrator account (the
manage_optionscapability). - Outgoing HTTPS requests from your server to the services you connect.
- OpenSSL (AES-256-GCM) or Sodium, available on almost all hosts, to store credentials encrypted.
Setting up the integrations
PageSpeed Insights: create an API key in Google Cloud Console (APIs & Services > Credentials), enable the PageSpeed Insights API, paste the key on the Integrations page and click Validate API key.
Google account (Search Console, GA4 and Google Sheets):
- In Google Cloud Console, create an OAuth client of type Web application and add the Authorized redirect URI shown on the Integrations page.
- Enable the Google Search Console API, Google Analytics Data API and Google Analytics Admin API. Enable the Google Sheets API only if you want Google Spreadsheet export.
- Publish the OAuth consent screen (in Testing status Google ends the authorization after 7 days).
- Paste the Client ID and Client Secret, choose the permissions to request and click Connect Google.
- After you approve access, your Search Console and GA4 properties are listed and the ones matching your site are preselected. You can also enter a property manually.
Ahrefs: paste an Ahrefs API v3 key and click Test API key. The website must have a Site Audit project in Ahrefs.
FAQ
Do I need every integration?
No. Each integration is optional. Reports include only the integrations you have configured, and the report status section lists the ones that were not included and why.
Why does Google need a sign-in when PageSpeed only needs an API key?
PageSpeed Insights analyses public pages, so an API key is enough. Search Console and Analytics data is private to a Google account, so Google releases it only after the account owner approves access (OAuth).
Does the plugin change anything in my Google or Ahrefs accounts?
No. Search Console and Analytics access is read-only. The optional Google Sheets permission only lets the plugin create and edit its own spreadsheets.
Which period does a report cover?
Search Console and GA4 data use the period selected at the top of the page (or the data period set for automatic reports). PageSpeed Insights and Ahrefs always use the latest available measurement.
How many reports are kept?
The five most recent reports per administrator. Older reports and their files are removed automatically.
Can reports be generated automatically?
Yes. In SiteMetrics > Settings > Automatic reports, turn them on, choose Daily, Weekly or Monthly, the data period and Excel or Google Spreadsheet, and click Save. Reports run with WP-Cron for the administrator who saved the setting and appear on the Reports page. WP-Cron runs when the site receives visits, so a report can start a little later than scheduled. If the Google Sheets permission is missing, an Excel report is created instead.
Troubleshooting
- “No API key has been saved”: save your PageSpeed key on the Integrations page, then validate it.
- Google shows “redirect_uri_mismatch”: copy the Authorized redirect URI from the Integrations page into your OAuth client exactly.
- “Permission missing” or a section shows “Not granted”: click Reconnect Google and tick that permission on Google’s consent screen.
- Google authorization expired: if your consent screen is in Testing status, publish it, then reconnect.
- No GA4 properties listed: enable the Google Analytics Admin API in your Cloud project, or enter the property ID manually.
- Ahrefs returns an error: check that your plan includes API v3 access and that a Site Audit project exists for the site.
- API limits: Google and Ahrefs quotas apply; wait and generate the report again.
- Saved credentials cannot be read: this happens when the security keys in wp-config.php change. Enter the keys again and reconnect Google.
Screenshots







Changelog
1.0.9
- Enabled Google Search Console, Google Analytics 4 and Ahrefs reporting alongside PageSpeed Insights.
- Added Google account, Search Console, GA4 and Ahrefs settings with connection tests.
- Added Search Console URL Inspection index status and GA4 active users, new users, sessions and engagement rate.
- Excel and Google Sheets reports now include a tab for each integration with data and a per-integration status section.
- Dashboard, report history and report comparison now cover all integrations.
- Clear messages for missing credentials, missing permissions, expired authorization, API limits and empty results.
- API keys, the OAuth client secret and OAuth tokens are now stored encrypted; existing values are encrypted automatically.
- Google account card explains why OAuth is needed, lets you choose the permissions to request (Search Console, Analytics, optional Google Sheets export via drive.file) and shows which were granted.
- Saved keys and secrets are shown only as masked hints and never sent back to the browser; credentials can be removed individually.
- The PageSpeed API key is sent in a request header instead of the URL.
- After connecting Google, Search Console and GA4 properties are listed automatically and the matching ones are preselected; manual entry remains available.
- New SiteMetrics menu with Overview, Integrations, Reports and Settings pages.
- Reports page lists the five most recent reports (any period) with open, compare and details actions.
- Redesigned Overview with KPI cards and daily trend lines; click a section to open its full details.
- Period selector (last 7 days, 28 days, 3, 6 or 12 months) used for Search Console and Analytics 4 data.
- Generate report menu in the header of every page for Excel or Google Spreadsheet.
- Automatic reports: Settings can generate an Excel report or Google Spreadsheet daily, weekly or monthly with WP-Cron, with its own data period (off by default).
- Notices from other plugins are hidden on SiteMetrics screens.
- Consistent type scale and clearer disabled fields.
1.0.8
- Improved the PageSpeed audit details experience for Mobile and Desktop reports.
- Refined the admin interface and audit report presentation.
1.0.7
- Added encrypted report storage and migration.
- Improved report history protection and concurrent updates.
- Improved report storage validation and error handling.
1.0.5
- Updated plugin identity to SiteMetrics by Codengine.
- Improved WordPress-compatible script loading.
- Documented third-party services and data usage.
- Updated external service and privacy documentation.
1.0.4
- Previous release.
