Google Analytics
Track the performance of your generated content with Google Analytics integration.
Overview
The Google Analytics integration allows you to view traffic and engagement data for your generated articles directly within Content Zen. See which articles are performing best and track key metrics like page views, sessions, and engagement time.
Prerequisites
Before setting up the integration, you need:
- A Google Analytics 4 (GA4) property
- A Google Cloud Platform account
- A Service Account with Analytics API access
Setup Guide
Step 1: Enable the Analytics API
- Go to the Google Cloud Console
- Select your project (or create a new one)
- Navigate to APIs & Services → Library
- Search for "Google Analytics Data API" and enable it
Step 2: Create a Service Account
- Go to APIs & Services → Credentials
- Click Create Credentials → Service Account
- Enter a name (e.g., "ContentZen Analytics")
- Click Create and Continue, then Done
Step 3: Generate a JSON Key
- Click on your service account
- Go to the Keys tab
- Click Add Key → Create new key
- Select JSON and click Create
- Save the downloaded file securely
Step 4: Grant Access in Google Analytics
- Copy the service account email address
- Go to Google Analytics
- Navigate to Admin (gear icon)
- Under your property, click Property Access Management
- Click the + button → Add users
- Paste the service account email
- Set role to Viewer (minimum required)
- Click Add
Step 5: Find Your Property ID
- In Google Analytics, go to Admin
- Under your property, click Property Settings
- Copy the Property ID (a number like
123456789)
Step 6: Configure in Content Zen
- In Content Zen, go to Settings → Integrations
- Select the Google tab
- Upload your JSON key file under "Google Analytics File"
- Enter your Property ID
- Enter a Prefix path if your articles are in a subdirectory (e.g.,
/blog/) - Click Update
Viewing Analytics Data
Once configured, you can view your analytics data:
- Go to Google Analytics in the sidebar
- Select a date range to analyze
- View metrics for your generated articles
Available Metrics
Content Zen displays the following metrics from Google Analytics:
- Page Views - Total number of page views
- Sessions - Number of user sessions
- Users - Unique visitors
- Engagement Time - Average time spent on pages
Understanding the Prefix
The prefix field helps Content Zen match your analytics data with generated articles. Set it to the URL path where your articles are published:
- If articles are at
example.com/blog/article-title, use prefix/blog/ - If articles are at the root
example.com/article-title, leave prefix empty
Troubleshooting
No Data Showing
- Verify the service account has Viewer access in GA4
- Check that the Property ID is correct
- Ensure the prefix matches your article URLs
- Data may take 24-48 hours to appear for new articles
Permission Errors
- Re-upload the JSON key file
- Verify the Analytics Data API is enabled in Google Cloud
- Check that the service account email is added to your GA4 property