Google Search Console supplies impressions, clicks, click-through rates and queries for PagibleAI page metrics. Chrome UX Report adds real-user performance data when Google has enough traffic data for the URL.
Configure Google Search Console
Get a Chrome UX Report key
- Open the Google Cloud Console and select the project for this site.
- Enable the Chrome UX Report API.
- Create an API key under APIs & Services > Credentials.
- Restrict the key to the Chrome UX Report API and, when practical, to your server.
- Copy it to your deployment secret store.
Create a Search Console service account
- Enable the Google Search Console API in the same project.
- Open IAM & Admin > Service Accounts and create an account for PagibleAI.
- Open its Keys tab and create a JSON key.
- Store the downloaded file outside the public web root and source control.
The JSON file contains a private key. Rotate it at once if it leaks.
Give the service account read access
- Copy the service account email address from Google Cloud.
- Open Google Search Console and select the property that serves your PagibleAI URLs.
- Open Settings > Users and permissions.
- Add the service account as a Restricted user.
Match the protocol and hostname used by the page URLs in PagibleAI.
Add the credentials to PagibleAI
Encode the whole service-account JSON file as one base64 string. Replace the example filename with the path to the downloaded file:
php -r 'echo base64_encode(file_get_contents("name-xxxxxxxxxxxx.json"));'
Put the command output in GOOGLE_AUTH, then add the restricted Chrome UX Report key:
CRUX_API_KEY="..."
GOOGLE_AUTH="..."
Run the command below, then restart Octane, queue workers and other long-running PHP processes.
php artisan config:clear
Check the Metrics tab
Sign in as a CMS user with page:metrics permission. Open a page and select Metrics. Search Console should show impressions, clicks and queries for the chosen period. The performance panel shows Chrome UX Report values when Google has data for that page or origin.
Check the home page and another established page before treating an empty result as a setup error.
Troubleshooting
Why is the Metrics tab missing?
The CMS user needs page:metrics permission. Assign a suitable role, then sign in again.
Why does Search Console deny access?
Add the service account to the exact property used by the page URL. Check the protocol, hostname and URL-prefix or domain-property choice.
Why is `GOOGLE_AUTH` rejected?
Encode the whole JSON key file, not its filename or only the private-key field. Keep the base64 value on one line, clear the configuration cache and restart workers.
Why are Chrome UX Report values empty?
Google reports only URLs or origins with enough eligible traffic. Try an established page, confirm that the API is enabled and check the CRUX_API_KEY restriction.
What if the JSON key was exposed?
Disable the compromised key in Google Cloud, create a replacement, update GOOGLE_AUTH, clear the configuration cache and restart workers.