Pro module5 abilities

Site Kit by Google ability reference

Reference for the GoBuildWP Pro 1.12.4 source. Installed schemas and policy remain authoritative.

This Site Kit by Google ability reference covers read-only Search Console, Google Analytics 4 and PageSpeed Insights data, fetched through the Google connection Site Kit already holds. An agent can compare top queries and pages with the previous period, find pages that are missing clicks, and pull one page's search, traffic and speed figures in a single call.

Read-only, write and destructive groups describe the source annotations. They do not establish a minimum safety profile, human approval or undo support. Those controls are separate: check the installed ability, the connected user and the active site policy before calling it. A read can still return sensitive data. These pages are not evidence that every operation passed an end-to-end runtime test.

What Site Kit by Google needs before these load

Site Kit by Google 1.150.0 or newer. The data calls register when GOOGLESITEKIT_VERSION meets that floor and Site Kit's plugin class is loaded. The status call registers on every site, so an agent can find out what is missing. Status needs GoBuildWP's own permission (manage_options); the data calls also need Site Kit's googlesitekit_view_posts_insights or googlesitekit_setup capability. A site administrator still has to connect each Google service inside Site Kit, because GoBuildWP cannot perform the Google sign-in.

Minimum (base)
1.150.0 WPPILOT_PRO_SITE_KIT_MIN_VERSION
Site Kit by Google editions
free, pro
Agent skills shipped
site-kit-integration

GoBuildWP never holds a Google token

Every read is dispatched in-process to Site Kit's own REST routes. Site Kit keeps the OAuth tokens, decides whose Google account answers (the user's own, or the module owner's when the dashboard is shared with that role) and applies its own permission checks; the status call reports credentials_stored_by_wppilot as false. GA4 metrics and dimensions come from a fixed list. All of them except the source_medium dimension are on Site Kit's shareable list, so a user reading through a shared dashboard gets the owner's figures for those; for source_medium that user gets wppilot_site_kit_not_shareable, and channel is the shareable substitute.

Google and Site Kit errors are mapped to codes that say who can fix them, since an agent cannot: wppilot_site_kit_not_connected, wppilot_site_kit_forbidden, wppilot_site_kit_insufficient_scopes, wppilot_site_kit_reauth, wppilot_site_kit_quota and wppilot_site_kit_google_permission among them.

An hour of cache, kept per user

Results are cached as transients for an hour. The key covers the module, the datapoint, the parameters and the WordPress user, because Site Kit may show one user data it refuses another, so a shared cache could leak it. Errors are never cached, so a quota refusal does not outlast the quota window. refresh=true skips the cache and costs Google quota.

A date range can span at most 480 days. Lists default to 25 rows and stop at 100, but comparison lookups ask Google for 500 rows so a query that ranked 26th last period is not reported as new.

How the opportunity lists are worked out

The low-CTR list keeps pages whose click-through rate is under half the site's and sorts them by missed_clicks, the extra clicks they would have had at the site rate. The striking-distance list keeps queries with an average position from 5 to 20, sorted by impressions. In the single-page call each section fails on its own, and PageSpeed runs a live Lighthouse test that takes 10 to 30 seconds when uncached.

Before accepting the result

Read property, date range, timezone and report freshness before interpreting metrics. Search Console, GA4 and lab diagnostics measure different things; a sample response is not evidence of the current property’s performance.

Safety profiles and human confirmation

Representative call sequence

This sequence describes the documented calls and checks to perform. It is not a recorded result from an installed WordPress site. Inspect returned errors and partial results, then verify the saved values and affected output before proceeding.

Choose which pages most deserve a rewritten title and meta description.

  1. 01 wppilot/site-kit-status Confirms Search Console is connected and readable by this user, or lists the next steps a site administrator must take.
  2. 02 wppilot/site-kit-search-pages Returns top pages against the previous period plus the low-CTR list ordered by missed clicks.
  3. 03 wppilot/site-kit-page-insights For the top candidate, returns its search totals and top queries, GA4 engagement and PageSpeed data in one response.

Site Kit in practice

Date windows that end yesterday, and the period they are compared with

With no dates supplied, every Site Kit read ends yesterday in the site's own timezone and starts 27 days earlier, a 28-day window. Today is left out because its numbers are partial and would read as a drop against any full day. The comparison period has the same number of days and ends the day before start_date. Dates must be strict Y-m-d values: an impossible date, a start after the end, or a span longer than 480 days returns wppilot_site_kit_invalid_date.

Search Console figures lag by two to three days, so the last days of a window can still move. Before drawing a conclusion, the agent should say which dates it read, using the period and previous_period fields that come back with the data.

How many Google requests one Site Kit call spends

wppilot/site-kit-search-pages is the heaviest read. It asks Search Console for up to 500 page rows for the current period plus a one-row totals query, another 500 page rows for the previous period when compare is on, and up to 1,000 query-and-page rows whenever opportunity_limit is above zero. Sending compare: false or opportunity_limit: 0 drops the matching requests. Each request is cached on its own, and the cached flag is true only when every part came from the cache.

wppilot/site-kit-page-insights sends three Search Console requests (current totals, previous totals and the top queries for that URL), one GA4 report and, unless include_pagespeed is false, a PageSpeed run. GA4 reports carry both periods in a single request using named date ranges, so a comparison does not double the Analytics cost. When Google refuses on quota the call returns wppilot_site_kit_quota, and answers cached during the past hour stay available meanwhile.

Reading Search Console and GA4 comparison fields

The comparison fields are computed by GoBuildWP from Site Kit's rows, so their conventions are worth knowing before quoting them to a site owner.

  • ctr is a fraction between 0 and 1, rounded to four places; multiply by 100 before calling it a percentage.
  • position is an average rounded to one decimal, and position_improvement is the previous position minus the current one, so a positive number means the page or query moved up.
  • clicks_pct, impressions_pct and each GA4 change_pct value are null when the previous period was zero, instead of showing an infinite rise.
  • On the top-pages list, previous is null when the page had no row among the 500 previous-period pages fetched, so it was absent or very far down, not merely outside the top 25.
  • missed_clicks is impressions multiplied by the site CTR, minus actual clicks. A page needs min_impressions (100 by default) to qualify as low CTR, and a query needs min_query_impressions (10 by default) for the position 5 to 20 list.

GA4 metrics, aliases and the shared-dashboard limit

wppilot/site-kit-analytics-report accepts up to 10 metrics from a fixed list (sessions, totalUsers, activeUsers, screenPageViews, engagedSessions, engagementRate, averageSessionDuration, bounceRate, keyEvents, sessionKeyEventRate, ecommercePurchases and eventCount) and orders rows by the first one. conversions is accepted as an alias for keyEvents, because GA4 renamed the measure and people still ask for it by the old name. Dimensions are page, page_title, source_medium, channel, country, device, date or none, and date rows come back in date order instead. Anything else returns wppilot_site_kit_invalid_metric or wppilot_site_kit_invalid_dimension.

source_medium is outside Site Kit's shareable list. A user who reads Analytics through a shared dashboard rather than their own Google sign-in gets wppilot_site_kit_not_shareable for it, and channel is the shareable substitute.

Pointing a Site Kit read at a single page

The per-page calls take post_id or url. A post_id must be a published post the current user can edit, mirroring Site Kit's own rule for post insights; otherwise the call returns wppilot_site_kit_invalid_target or wppilot_site_kit_forbidden. A url may be absolute or a path starting with a slash, and must be on the site's own host (a leading www. is ignored), because Google filters on exact URLs and a page on another host would silently read as no traffic.

In page insights, PageSpeed returns a performance score, lab timings and, only when Google holds field data for that URL, a field block; most low-traffic pages have none. strategy defaults to mobile. A single Lighthouse run is a lab measurement, so report it as such. Only when no section returns any data does the whole call fail, and then it carries the Search Console section's error so the cause is not lost.

What the Site Kit status call shows a non-administrator

wppilot/site-kit-status reads Site Kit's connection route, which only users with googlesitekit_setup may call; for anyone else the site block is null rather than guessed. Per module it reports active, connected, shareable, the owner's user id, the stored property ids and current_user_can_read. If Site Kit refuses its module list, the result adds modules_error and the data calls make the final decision themselves. Every call in the module is a read: nothing is written to Site Kit, Google or site content (only GoBuildWP's own hour-long cache transients), so the module stays available under the Read Only safety profile and there is nothing for the change ledger to record.

  • wppilot_site_kit_reauth: the Google sign-in expired or was revoked; the account owner signs in again in Site Kit.
  • wppilot_site_kit_google_permission: Google says the connected account cannot see that property; its owner grants access, or Site Kit is reconnected with an account that has it.
  • wppilot_site_kit_insufficient_scopes: not every permission was accepted at sign-in; reconnect and accept them all. When nobody has signed in at all, the same Site Kit answer is reported as wppilot_site_kit_not_connected instead.
  • wppilot_site_kit_unavailable: Site Kit's REST routes are not registered on the request, usually because Site Kit is inactive or failed to load.

Questions about Site Kit by Google

An editor gets wppilot_site_kit_forbidden. What fixes it?

First check GoBuildWP’s own manage_options permission; ordinary Editor access alone does not satisfy it. For a user who passes that gate, Site Kit may still refuse access. Either they sign in to Site Kit with their own Google account, or the Site Kit admin shares the module with their role under Dashboard sharing. For an administrator who is not signed in to Google, the error is wppilot_site_kit_not_shared instead, and GoBuildWP Free's wppilot/site-kit-enable-sharing turns on read-only sharing for Administrators through Site Kit's own route, run by the module's owner.

Why do the numbers match what I saw an hour ago?

Results are cached per user for an hour. Pass refresh=true when fresh figures matter, keeping in mind that it spends Google quota.

Site Kit by Google reads

AbilityWhat it does
wppilot/site-kit-analytics-reportAnalytics (GA4) ReportA Google Analytics 4 report through Site Kit: sessions, users, page views, engagement and key events (conversions) broken down by page, page title, source/medium, channel, country, device or date, with previous-period comparison. Metrics and dimensions come from a fixed allow-list. Cached for an hour.
wppilot/site-kit-page-insightsPage Insights (Search, Analytics, PageSpeed)Everything Site Kit knows about one post or URL in one call: Search Console totals and top queries, GA4 sessions, users, page views, engagement and key events, each with previous-period comparison, and PageSpeed Insights lab data when that module is connected. A section that fails reports its own error; the others still return. Cached for an hour.
wppilot/site-kit-search-pagesSearch Console Top Pages and OpportunitiesTop pages in Google Search by clicks or impressions, compared with the previous period, plus two derived opportunity lists: pages with many impressions but a CTR under half the site average (with the clicks they miss), and queries ranking at average position 5-20 with the page that ranks. Read through Site Kit; cached for an hour.
wppilot/site-kit-search-queriesSearch Console Top QueriesTop Google Search queries (clicks, impressions, CTR, average position) for the whole site or one page, over a date range (default last 28 days), each compared with the previous period of equal length, plus period totals. Read through Site Kit; cached for an hour.
wppilot/site-kit-statusSite Kit StatusReports whether Site Kit by Google is active and connected, which of Search Console, Analytics (GA4) and PageSpeed Insights are connected, their property IDs, whether the current user can read each, and what the site owner must do in Site Kit when something is missing. Makes no Google request.