Skip to main content

Tutorial: Google Analytics Setup

Role: Journal Manager / Site Administrator
Time: 15โ€“25 minutes
OJS Version: 3.5+

This tutorial explains how to connect your OJS journal to Google Analytics 4 (GA4) to track page views, user behaviour, traffic sources, and article engagement.


Before You Startโ€‹

  • You have a Google account with access to analytics.google.com.
  • You have Journal Manager or Site Administrator access in OJS.

Step 1 โ€” Create a Google Analytics 4 Propertyโ€‹

  1. Go to analytics.google.com.
  2. Click Admin (gear icon, bottom left).
  3. In the Account column, click Create Account (or select an existing account).
  4. In the Property column, click Create Property.
  5. Enter your journal name, select your timezone and currency.
  6. Select Web as the platform.
  7. Enter your journal URL and stream name.
  8. Click Create stream.
  9. Copy your Measurement ID โ€” it looks like G-XXXXXXXXXX.

Step 2 โ€” Install the Google Analytics Pluginโ€‹

  1. Log in as Site Administrator.
  2. Go to Administration โ†’ Plugin Gallery.
  3. Search for Google Analytics.
  4. Click Install.

Or download from github.com/pkp/googleAnalytics and upload to /plugins/generic/googleAnalytics/.


Step 3 โ€” Enable and Configure the Pluginโ€‹

  1. Go to Settings โ†’ Website โ†’ Plugins โ†’ Installed Plugins.
  2. Find Google Analytics and toggle to Enabled.
  3. Click the Settings icon.
  4. Enter your Google Analytics Tracking ID:
    • For GA4: enter your Measurement ID โ€” G-XXXXXXXXXX
  5. Click Save.

Step 4 โ€” Verify Tracking is Workingโ€‹

  1. Open your journal website in a browser.
  2. In Google Analytics, go to Reports โ†’ Realtime.
  3. You should see your visit recorded within 30 seconds.

If no data appears after a few minutes, check:

  • The plugin is enabled and saved.
  • Your browser is not blocking Google Analytics (disable ad blockers temporarily to test).
  • The Measurement ID is entered correctly.

Step 5 โ€” Key Reports for Journal Managersโ€‹

Once data is collecting, useful GA4 reports include:

ReportLocationWhat It Shows
Traffic overviewReports โ†’ Acquisition โ†’ OverviewTotal users, sessions, and traffic sources
Most visited pagesReports โ†’ Engagement โ†’ Pages and screensWhich article pages get the most views
Geographic dataReports โ†’ Demographics โ†’ OverviewWhere your readers are located
Referral trafficReports โ†’ Acquisition โ†’ Traffic acquisitionWhich sites are linking to your journal
RealtimeReports โ†’ RealtimeCurrent active users on the journal

Privacy and GDPR Considerationsโ€‹

If your journal serves users in the European Union:

  • Add a cookie consent banner before loading Google Analytics (required under GDPR).
  • Consider using Matomo (self-hosted) or Plausible as a privacy-respecting alternative.
  • See the Webmaster Tools reference for analytics alternatives.

Troubleshootingโ€‹

ProblemSolution
Tracking ID not acceptedEnsure you are using the GA4 Measurement ID (G-XXXXXXXX), not the old UA tracking ID
No data in GA4 dashboardVerify plugin is enabled; check with an ad blocker disabled
Data appears delayedGA4 standard reports have a 24โ€“48 hour delay; use Realtime for immediate verification
Plugin not foundInstall manually from GitHub

Next Stepsโ€‹