Google Analytics (PRO Feature)

The Google Analytics page is a PRO-exclusive feature that integrates Google Analytics 4 (GA4) directly into WordPress, enabling you to monitor website traffic, user behavior, and performance metrics without leaving the dashboard. FREE users do not have access to this module.

Accessing the Analytics Page

Navigate to: All DashAI WP → Analytics
This menu item is only visible to PRO users.

Authentication

OAuth Only (Required)

Google Analytics integration uses OAuth 2.0 exclusively. There is no manual token option.

  • OAuth provides secure, automatic token refresh
  • Tokens are stored securely and refreshed without user interaction
  • The analytics.readonly scope is used to access analytics data
How to Connect:

  1. Go to Settings → All DashAI Settings → Analytics
  1. Click Connect with Google Analytics
  1. Authorize access to your Google Analytics account
  1. Enter your GA4 Property ID (format: 123456789)

Data Available

The Analytics page displays comprehensive metrics organized into two tabs:

Overview Tab

  • KPI Cards: Active Users, New Users, Average Engagement Time, Event Count (with delta comparison)
  • Trend Chart: Sessions, Users, and Page Views over time
  • Traffic Sources: Channels by sessions
  • User Sources: First user source by active users
  • New vs Returning Users: Daily breakdown
  • Top Countries: Sessions by country (with interactive map)
Pages Tab

  • WordPress Pages List: All published pages and posts
  • Page Metrics: Views, Users, Engaged Sessions, Engagement Rate, Bounce Rate, Average Session Duration
  • Search and Filter: Search by title, filter by post type
  • Pagination: 10 pages per page

Features

FeatureDescription
Custom Date RangesSelect any period: 7, 14, 30, 60, 90 days, week/month to date, or custom calendar selection
AI Traffic Insights“Reveal Traffic Insights” button generates AI-powered summary with patterns, recommendations, and risk signals
AI SEO AnalysisPer-page SEO analysis with title, meta, heading structure, and content recommendations
AI Page InsightsPer-page performance analysis with engagement metrics and optimization suggestions
PDF ExportExport analytics reports as PDF with white label branding

Caching

To reduce API calls and improve performance, the plugin applies caching:

Data TypeCache Duration
All Analytics Data30 minutes
Clearing the Cache:
  1. Go to Settings → All DashAI Settings → Analytics
  1. Click the Clear Cache link
  1. Return to the Analytics page to fetch fresh data
Alternatively, selecting a different date range will fetch new data for that period.

Error Handling

The Analytics page displays clear error messages for:

  • OAuth Not Connected: Prompts to connect Google Analytics via OAuth
  • Property ID Not Configured: Prompts to enter GA4 Property ID
  • Authentication Errors: Suggests reconnecting OAuth
  • Permission Errors: Indicates access restrictions on the GA4 property
  • Rate Limits: Google Analytics API limits (50,000 requests/day)

Security and Privacy

  • OAuth tokens stored securely with automatic refresh
  • All AJAX requests protected with WordPress nonces
  • Capability checks enforced
  • AI features process only the data visible on screen
  • No analytics data is stored permanently; it is fetched on demand and cached temporarily

Multisite Behavior

In multisite environments:

  • Each site has its own OAuth connection and Property ID
  • Cache is isolated per site
  • Settings are site-specific