Video Walkthrough

Watch the full setup process from start to finish before diving into the steps below.

1

Create a Google Cloud Project

Every Google API integration needs a Cloud project. This is a container for your credentials, API access, and billing (Analytics API is free).

  1. Go to console.cloud.google.com and sign in
  2. Click the project selector dropdown at the top-left (next to the Google Cloud logo)
  3. Click "New Project" in the top-right of the dialog
  4. Enter Project name (e.g. WP Analytix) — leave Organization as "No organization"
  5. Click "Create" and wait a few seconds
  6. Select your new project from the dropdown to make it active
Google Cloud Console — Creating a new project
The project name is only visible to you — users of your site will never see it. Choose any name that helps you remember its purpose.
2

Enable the Required APIs

You need to enable two APIs. Both are free to use for standard analytics reporting.

Google Analytics Data API Required

  1. In your Cloud Console, go to APIs & Services → Library
  2. Search for "Google Analytics Data API"
  3. Click the result titled Google Analytics Data API
  4. Click "Enable"
Enable Google Analytics Data API
Enabling Google Analytics Data API

Google Analytics Admin API Required

  1. Go back to APIs & Services → Library
  2. Search for "Google Analytics Admin API"
  3. Click the result and click "Enable"
Enable Google Analytics Admin API
Enabling Google Analytics Admin API

Google Search Console API Required

  1. Go back to APIs & Services → Library
  2. Search for "Google Search Console API"
  3. Click the result and click "Enable"
Enable Google Search Console API
Enabling Google Search Console API
All 3 APIs must be enabled. The Data API fetches report data. The Admin API lists your properties and data streams. Search Console API provides access to Search Console data. The plugin will not work if any of them is missing.
3

Configure the OAuth Consent Screen

Before creating credentials, Google requires you to set up an OAuth consent screen. This is what users see when they grant your app permission.

  1. Go to APIs & Services → OAuth consent screen
  2. Select "External" as the user type, then click "Create"
  3. Fill in the App name (e.g. WP Analytix) and your User support email
  4. Scroll down and fill in your email under Developer contact information
  5. Click "Save and Continue"
  6. On the Scopes screen, click "Save and Continue" (no changes needed)
  7. On the Test users screen, click "+ Add Users"
  8. Add the email address of the Google account connected to your Analytics property
  9. Click "Save and Continue", then "Back to Dashboard"
OAuth Consent Screen setup
Filling in the OAuth consent screen details
Adding test users
Adding your Google account as a test user
While the app is in "Testing" mode, only email addresses you add as test users can authenticate. This is perfectly fine for personal or agency use. You do not need to publish the app.
4

Create OAuth 2.0 Credentials

These credentials allow WP Analytix to securely authenticate with Google on your behalf.

  1. Go to APIs & Services → Credentials
  2. Click "+ Create Credentials" at the top
  3. Select "OAuth client ID"
  4. For Application type, choose "Web application"
  5. Give it a name, e.g. WP Analytix OAuth Client
  6. Under Authorized redirect URIs, click "+ Add URI"
  7. Paste your WordPress redirect URL (see below)
  8. Click "Create"
  9. A dialog appears — copy your Client ID and Client Secret
Create OAuth Client ID form
Creating an OAuth 2.0 Client ID — Web application type

Your redirect URI should be the URL of your WP Analytix settings page:

Live site https://yourdomain.com/wp-admin/admin.php?page=agwp-analytix-settings
Local development (XAMPP / LocalWP) http://localhost/wp/wp-admin/admin.php?page=agwp-analytix-settings
The redirect URI must match exactly — including http vs https and any trailing slashes. If they don't match, you will get a "redirect_uri_mismatch" error when signing in.
5

Enter Credentials in WP Analytix

Now paste the credentials you generated into the WP Analytix settings page.

  1. In your WordPress admin, go to WP Analytix → Settings
  2. Click the "Authentication" tab
  3. Paste your Client ID into the Google Console Client ID field
  4. Paste your Client Secret into the Google Console Client Secret field
  5. Click "Save Changes"
  6. Click "Sign in with Google Account"
  7. A Google sign-in page opens — sign in with the account that has access to your GA4 property
  8. Click "Allow" to grant the permissions
  9. You will be redirected back to WordPress — you are now connected!
WP Analytix Settings — Authentication tab
Entering your Client ID and Client Secret in the plugin settings
WP Analytix Settings — Authentication tab
Click Continue while APP is in Test Mode
Google OAuth permission screen
Granting access on the Google sign-in screen
Google OAuth permission screen
Granting access on the Google sign-in screen
6

Select Your Analytics Property

After connecting, choose which GA4 property's data to display in your dashboard.

  1. Go to WP Analytix → Settings → Profiles
  2. Under Dashboard Profile, click the dropdown and select your GA4 property
  3. Click "Save Changes"
  4. Go to WP Analytix → Dashboard to see your analytics data
WP Admin → WP Analytix → Settings → Profiles
Selecting a GA4 property
Selecting your GA4 property in the Profiles tab

Search Console Integration

WP Analytix includes a built-in Google Search Console integration that shows SEO performance data — keywords, clicks, impressions, CTR, and ranking positions — directly inside your WordPress dashboard.

No extra authentication needed. Search Console uses the same Google OAuth connection as Analytics. As long as you completed Step 5 (Sign in with Google), you are already authenticated — the webmasters scope is included automatically.

The only requirements are:

  • Your site is verified in Google Search Console
  • The Google account you authenticated with has access to that Search Console property
  • Search Console is enabled in WP Analytix settings
A

Search Console Plugin Settings

Once your site is verified in Google Search Console, configure the integration inside WP Analytix.

  1. Go to WP Analytix → Settings
  2. Click the "Search Console" tab
  3. Check "Enable Search Console" to turn on the integration
  4. Enter your Site URL exactly as it appears in Google Search Console (see formats below)
  5. Choose which sections to display using the Display Options checkboxes
  6. Click "Save Settings"
Search Console settings tab
Search Console settings — enable, site URL, and display options

Site URL format

The URL must match exactly what is shown in Google Search Console — including the prefix type:

URL-prefix property (http or https) https://yourdomain.com
Domain property sc-domain:yourdomain.com
A mismatch in the Site URL will result in no data being displayed. Open Google Search Console and copy the property URL exactly — do not add or remove slashes.

Display Options

All four sections are enabled by default. Uncheck any you don't need:

OptionWhat it shows
Show Top Keywords Table of search queries with clicks, impressions, CTR, and average position
Show Top Pages Table of your best-performing pages in search results
Show Position Performance Chart Bar chart grouping keywords by ranking position ranges (1–3, 4–10, 11–20, 21–50, 50+)
Show Traffic Source Breakdown Pie chart breaking down traffic by source (Organic, Direct, Referral, Social, Paid)
You're all set! Your analytics reports will now appear in the WP Analytix dashboard. Data may take a few minutes to load on the first visit.

?

Troubleshooting

Error 400: redirect_uri_mismatch
The redirect URI in Google Cloud Console does not exactly match your WordPress settings page URL. Open the OAuth client, click Edit, and make sure the URI matches character-for-character — including http vs https.
Access blocked: This app's request is invalid
Your OAuth consent screen is not configured correctly, or you haven't added yourself as a test user. Go back to Step 3, make sure your email is added under "Test users".
Error 403: access_denied
You are trying to sign in with a Google account that is not in your test users list. Add that account email in APIs & Services → OAuth consent screen → Test users.
The caller does not have permission
The Google account you authenticated with does not have access to the selected GA4 property. Log into analytics.google.com and confirm that account has at least "Viewer" access to the property.
No properties appear in the dropdown
Make sure both APIs (Data API and Admin API) are enabled in Step 2. Also verify the authenticated account has access to at least one GA4 property.
Credentials not saving
Click "Save Changes" before clicking "Sign in with Google". If the fields are empty after saving, check that your WordPress database user has write permissions.

🔒

Security Recommendations

  • Restrict your API key to only the Google Analytics Data API — prevents misuse if the key is accidentally exposed
  • Never share your Client Secret or commit it to version control (e.g. GitHub). Treat it like a password
  • Keep the OAuth app in "Testing" mode if only you or your agency will use it — this limits authentication to your approved email addresses only
  • Regularly review which apps have access to your Google account at "myaccount.google.com/permissions"
  • Use HTTPS on your WordPress site — OAuth tokens should never be sent over plain HTTP in production

Quick Reference

Credentials summary

Credential Where to find it Plugin field
Client ID Credentials → OAuth 2.0 Client IDs → your client Google Console Client ID
Client Secret Same as above (click Edit to reveal) Google Console Client Secret
Redirect URI Your WP Admin URL + ?page=agwp-analytix-settings Add to OAuth client in Google Console

APIs to enable

API Name Purpose
Google Analytics Data API Fetch sessions, users, events, and all report data
Google Analytics Admin API List properties, data streams, and account info
Google Search Console API Keywords, clicks, impressions, CTR, and position data