Knowledge Base
How to Add Google Analytics to WordPress
Tracking Website Visitors
Google Analytics shows you who visits your site and what they do.
Step 1: Create Google Analytics Account
- Go to analytics.google.com
- Sign in with Google account
- Click "Start measuring"
- Create account and property
- Get your Measurement ID (G-XXXXXXX)
Step 2: Add to WordPress
Method A: Using Plugin (Recommended)
- Install "Site Kit by Google" plugin
- Connect your Google account
- Follow setup wizard
Method B: Manual (Header)
- Copy the GA4 tracking code
- Go to Appearance → Theme Editor
- Edit header.php
- Paste code before </head>
Method C: Using Insert Headers Plugin
- Install "Insert Headers and Footers" plugin
- Go to Settings → Insert Headers and Footers
- Paste tracking code in header section
- Save
Verifying Installation
- Go to Google Analytics
- Check Real-Time reports
- Visit your site
- Your visit should appear
Key Metrics to Track
- Users and sessions
- Page views
- Bounce rate
- Traffic sources
- Popular pages