X / Twitter

X-specific integration guide

Overview

Twitter (now X) analytics are collected through the Twitter API v2. This integration allows you to track engagement metrics for your tweets including impressions, engagements, and various interaction types. Twitter requires authentication for all analytics data access.

Available Metrics

Impressions - Number of times your tweet was viewed
Engagements - Total number of interactions with your tweet
Retweets - Number of times your tweet was retweeted
Quote Tweets - Number of quote tweets referencing your tweet
Likes - Number of likes on your tweet
Replies - Number of replies to your tweet
URL Clicks - Clicks on links in your tweet
Profile Clicks - Clicks to view your profile from the tweet
Hashtag Clicks - Clicks on hashtags in your tweet
Detail Expands - Number of times users clicked to see tweet details

Not Available

Video Analytics - Detailed video view metrics (requires separate endpoint)
Audience Demographics - Age, gender, location breakdown (requires elevated access)
Historical Data - Metrics older than 30 days may be limited

Authentication

Twitter requires OAuth authentication for API access. Two methods are supported:

  • Best for: Read-only analytics access
  • Scope: Tweet read access
  • Setup: Simple, one-token authentication
  • Rate limits: Standard v2 rate limits apply

OAuth 1.0a (Legacy)

  • Required for: User-context endpoints
  • Credentials needed: Consumer key, consumer secret, access token, access token secret
  • More complex: Requires 4 separate credentials
  • Use when: Bearer token access is insufficient

Setting Up Twitter Analytics

Step 1: Create a Twitter Developer Account

  1. Go to Twitter Developer Portal
  2. Sign in with your Twitter account
  3. Click “Sign up” for a developer account
  4. Complete the application process (may require approval)
  5. Once approved, proceed to create an app

Step 2: Create an App and Get Credentials

  1. In the Developer Portal, go to “Projects & Apps”
  2. Create a new App or select an existing one
  3. Go to the “Keys and tokens” tab
  4. Under “Bearer Token”, click “Generate”
  5. Important: Copy the token immediately - you won’t see it again!

For OAuth 1.0a (If needed):

  1. In your App’s “Keys and tokens” tab
  2. Note your API Key (Consumer Key) and API Key Secret (Consumer Secret)
  3. Under “Access Token and Secret”, click “Generate”
  4. Copy the Access Token and Access Token Secret

Step 3: Add Credentials in ContentCompass

  1. Navigate to Credentials in ContentCompass
  2. Click “New Credential”
  3. Select “Twitter” as the platform
  4. Authentication type will auto-select to “OAuth”
  5. For Bearer Token auth:
    • Paste your Bearer Token in the “Bearer Token” field
    • Leave other fields empty
  6. For OAuth 1.0a auth:
    • Fill in all four fields: Consumer Key, Consumer Secret, Access Token, Access Token Secret
  7. Give your credential a memorable name
  8. Optionally share with your team
  9. Click “Create Credential”

Step 4: Add Twitter URLs to Your Ideas

  1. When editing an idea, add your tweet URL to the “Published Link” field
  2. ContentCompass will automatically detect it’s a Twitter URL
  3. Analytics collection happens in the background
  4. Metrics typically appear within a few minutes

API Limitations

Rate Limits

  • Tweet lookup: 300 requests per 15-minute window (App auth)
  • Tweet metrics: Subject to your Twitter API access level
  • Basic access: Limited to recent tweets and basic metrics
  • Elevated access: Higher limits and more detailed analytics

Data Availability

  • Real-time: Metrics update within minutes
  • Historical: Limited to 30 days for most metrics
  • Deleted tweets: Metrics unavailable once tweet is deleted
  • Protected accounts: Metrics only available to account owner

Access Levels

Twitter API v2 has different access tiers:

  • Essential: Basic read access, limited rate limits
  • Elevated: Higher rate limits, more endpoints
  • Academic: Research-focused access (application required)

Best Practices

  1. Monitor Rate Limits
    • ContentCompass automatically handles rate limiting
    • If you see delays, you may be hitting rate limits
    • Consider upgrading your Twitter API access level if needed
  2. Optimize Tweet Timing
    • Track metrics over the first 24-48 hours for best insights
    • Most engagement happens within the first few hours
  3. Use Tweet Analytics Strategically
    • Focus on engagement rate (engagements/impressions)
    • Track which content types drive most interactions
    • Monitor profile clicks as a conversion metric
  4. Handle API Changes
    • Twitter’s API policies change frequently
    • Keep credentials up to date
    • Monitor Twitter Developer announcements

Troubleshooting

No Data Showing

  1. Verify tweet is public: Protected tweets won’t show metrics
  2. Check tweet age: Very new tweets may need a few minutes
  3. Confirm credentials: Test your API access in Twitter’s API playground
  4. Rate limits: You may have hit your API rate limit

Authentication Errors

  1. Bearer token expired: Generate a new token in Developer Portal
  2. OAuth credentials invalid: Regenerate access tokens
  3. App suspended: Check Developer Portal for any violations
  4. Access level: Ensure your app has appropriate permissions

Incomplete Metrics

  1. Access tier limitations: Some metrics require elevated access
  2. Tweet age: Older tweets may have limited metric availability
  3. Deleted content: Metrics unavailable for deleted tweets

Privacy and Security

  • Store credentials securely in ContentCompass
  • Use Bearer tokens for read-only access when possible
  • Regularly rotate tokens as part of security hygiene
  • Monitor your Developer Portal for unauthorized access
  • Be aware of Twitter’s data usage policies

Future Updates

This integration will be updated as Twitter continues to evolve their API. Current integration uses Twitter API v2. Note that Twitter’s API access and pricing model change frequently, so features may vary based on your access level.

Ready to put this into practice?

Start your free 14-day trial and experience ContentCompass for yourself.