GitHub
GitHub analytics integration guide
Overview
GitHub analytics are collected through GitHub’s REST API v3. This integration allows you to track repository metrics, traffic data, and release download statistics for your GitHub repositories and releases.
Available Metrics
✅ Repository Stars - Number of users who starred your repository
✅ Repository Forks - Number of times your repository has been forked
✅ Watchers - Number of users watching your repository
✅ Subscribers - Number of users subscribed to notifications
✅ Open Issues - Current number of open issues
✅ Repository Views - Traffic views (requires repo access)
✅ Repository Clones - Git clone operations (requires repo access)
✅ Unique Views/Clones - Unique visitors/cloners (requires repo access)
✅ Release Downloads - Download counts for release assets
✅ Commits (Last Year) - Commit activity over the past year
Traffic Data Requirements
⚠️ Important: Repository traffic data (views and clones) requires push access or higher to the repository. This means:
- For your own repositories: Full access with
repo
scope - For organization repositories: You need to be a collaborator with push access
- Public repository stars/forks: Available with
public_repo
scope
Authentication
GitHub requires a Personal Access Token (PAT) for API access. Two types are available:
Fine-grained Personal Access Token (Recommended)
- More granular permissions available
- Can be limited to specific repositories
- Repository permissions needed: Contents (read), Metadata (read)
- For traffic data: Repository permissions need to include administration or push access
Personal Access Token (Classic)
- Scope for public repositories:
public_repo
- Scope for private repositories or traffic data:
repo
(full repository access) - Scope for releases only:
public_repo
(if releases are public)
Supported URL Formats
The GitHub adapter recognizes these URL patterns:
https://github.com/owner/repository
- Repository analyticshttps://github.com/owner/repository/releases
- Latest release analyticshttps://github.com/owner/repository/releases/tag/v1.0.0
- Specific tagged releasehttps://github.com/owner/repository/releases/123456
- Release by ID
The integration automatically handles rate limiting with appropriate retry mechanisms.
Setting Up GitHub Analytics
Step 1: Create a Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click “Fine-grained tokens” → “Generate new token”
- Give it a descriptive name like “ContentCompass Analytics”
- Set an appropriate expiration date (90 days recommended)
- Select repository access based on your needs:
- Permissions - GitHub require administative permission to provide access to the metrics ContentCompass collects. Make the permissions Read Only
- Click “Generate token”
- Important: Copy the token immediately - you won’t see it again!
Step 2: Add Credentials in ContentCompass
- Navigate to Credentials in ContentCompass
- Click “New Credential”
- Select “GitHub” as the platform
- Authentication type will auto-select to “API Key”
- Paste your Personal Access Token in the “Personal Access Token” field
- Give your credential a memorable name
- Optionally share with your team if working collaboratively
- Click “Create Credential”
Step 3: Add GitHub URLs to Your Ideas
- When editing an idea, add your GitHub repository or release URL to the “Published Link” field
- ContentCompass will automatically detect it’s a GitHub URL and begin collecting analytics
- Analytics collection happens in the background and may take a few minutes
Missing traffic data
- Traffic data requires push access or higher to the repository
- Only repositories you own or collaborate on will show view/clone data
- Public repositories will still show stars, forks, and other public metrics
Rate limiting
- GitHub enforces rate limits on API requests
- ContentCompass automatically retries after rate limit periods
Best Practices
- Use descriptive token names to track which tokens are used where errors
- Keep tokens secure - never share them or commit them to code repositories
Privacy and Security
- Tokens are only used to fetch analytics data, never to modify repositories
- Consider using fine-grained tokens limited to specific repositories for additional security
- Regularly rotate tokens as part of good security hygiene
Future Updates
This integration will be updated as GitHub releases new API endpoints or metrics. Current integration uses GitHub REST API v3.
Ready to put this into practice?
Start your free 14-day trial and experience ContentCompass for yourself.