Configure Google Search Console

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.

Get a Chrome UX Report key

  1. Open the Google Cloud Console and select the project for this site.
  2. Enable the Chrome UX Report API.
  3. Create an API key under APIs & Services > Credentials.
  4. Restrict the key to the Chrome UX Report API and, when practical, to your server.
  5. Copy it to your deployment secret store.
Google Cloud "Select a project" dialog displaying a recent project named "Aimeos". Google Cloud console with navigation menu open, displaying project ID "aimeos-376718" and a prompt to "Try Gemini Cloud Assist chat". A notification indicates "Now viewing project 'Aimeos' in organization 'No organization'". The Google Cloud API Library displays the search result for "Chrome UX Report API", a Google API providing real user experience data. Google Cloud's Chrome UX Report API details and overview. Google Cloud Platform API & Services Credentials management page, displaying API keys, an OAuth consent screen configuration reminder, and no OAuth 2.0 client IDs. Google Cloud API credentials management. Google Cloud console showing API key management with a "Create API key" dialog open, pre-filled with the name "PagibleAI CrUX", and initial application restriction set to "None".

Create a Search Console service account

  1. Enable the Google Search Console API in the same project.
  2. Open IAM & Admin > Service Accounts and create an account for PagibleAI.
  3. Open its Keys tab and create a JSON key.
  4. 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.

Google Cloud "Select a project" dialog with "Aimeos" project listed. Google Cloud console with an open navigation menu, showing project details and a Gemini Cloud Assist chat prompt, along with a notification about the currently viewed project "Aimeos" within "No organization". Google Cloud API Library showing one result for "google search console api". Google Search Console API details on Google Cloud. Google Cloud console showing the Search Console API page with an enabled status, a navigation menu for IAM & Admin features, and additional API details like type, last update, and category. Google Cloud Platform's "Service accounts" page for the project "Aimeos," showing one enabled service account named "PagibleAI website" with its email, status, name, description, and key ID. Google Cloud service account creation details. Google Cloud Platform displaying details of the 'PagibleAI SearchConsole' service account, confirmed as enabled and recently created. Google Cloud console displaying the "Keys" tab for a service account, with warnings about key security risks and options to add new keys. Google Cloud dialog for creating a service account private key (JSON or P12), with a secure storage warning.

Give the service account read access

  1. Copy the service account email address from Google Cloud.
  2. Open Google Search Console and select the property that serves your PagibleAI URLs.
  3. Open Settings > Users and permissions.
  4. Add the service account as a Restricted user.

Match the protocol and hostname used by the page URLs in PagibleAI.

Google Search Console overview for pagible.com, displaying search performance data including 3 total web search clicks. Google Search Console settings for pagible.com, showing ownership verification, user permissions, data export options, and robots.txt status. Google Search Console user permissions for pagible.com. Google Search Console user addition dialog.

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.