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โ
- Go to analytics.google.com.
- Click Admin (gear icon, bottom left).
- In the Account column, click Create Account (or select an existing account).
- In the Property column, click Create Property.
- Enter your journal name, select your timezone and currency.
- Select Web as the platform.
- Enter your journal URL and stream name.
- Click Create stream.
- Copy your Measurement ID โ it looks like
G-XXXXXXXXXX.
Step 2 โ Install the Google Analytics Pluginโ
- Log in as Site Administrator.
- Go to Administration โ Plugin Gallery.
- Search for Google Analytics.
- Click Install.
Or download from github.com/pkp/googleAnalytics and upload to /plugins/generic/googleAnalytics/.
Step 3 โ Enable and Configure the Pluginโ
- Go to Settings โ Website โ Plugins โ Installed Plugins.
- Find Google Analytics and toggle to Enabled.
- Click the Settings icon.
- Enter your Google Analytics Tracking ID:
- For GA4: enter your Measurement ID โ
G-XXXXXXXXXX
- For GA4: enter your Measurement ID โ
- Click Save.
Step 4 โ Verify Tracking is Workingโ
- Open your journal website in a browser.
- In Google Analytics, go to Reports โ Realtime.
- 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:
| Report | Location | What It Shows |
|---|---|---|
| Traffic overview | Reports โ Acquisition โ Overview | Total users, sessions, and traffic sources |
| Most visited pages | Reports โ Engagement โ Pages and screens | Which article pages get the most views |
| Geographic data | Reports โ Demographics โ Overview | Where your readers are located |
| Referral traffic | Reports โ Acquisition โ Traffic acquisition | Which sites are linking to your journal |
| Realtime | Reports โ Realtime | Current 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โ
| Problem | Solution |
|---|---|
| Tracking ID not accepted | Ensure you are using the GA4 Measurement ID (G-XXXXXXXX), not the old UA tracking ID |
| No data in GA4 dashboard | Verify plugin is enabled; check with an ad blocker disabled |
| Data appears delayed | GA4 standard reports have a 24โ48 hour delay; use Realtime for immediate verification |
| Plugin not found | Install manually from GitHub |
Next Stepsโ
- Google Search Console Setup โ monitor search indexing alongside analytics
- ASEO & Discoverability โ improve how your journal is found in academic searches
- Webmaster Tools โ overview of all analytics and monitoring tools