Instagram Performance Analytics Agent Setup Guide
What This Agent Does
This powerful automation agent transforms your Instagram management by automatically analyzing post performance, sentiment, and engagement metrics on a daily basis. It fetches your latest Instagram posts, applies AI-powered sentiment analysis to understand audience reactions, and intelligently routes insights to your team through Slack notifications and comprehensive email reports—all while logging detailed analytics to Google Sheets for historical tracking.
Key benefits and time savings:
-
Eliminates manual daily reporting – Save 2-3 hours per week by automating Instagram analytics collection and analysis
-
Real-time sentiment insights – Understand audience perception instantly with AI-powered analysis
-
Intelligent alert system – Get notified immediately when posts underperform or generate negative sentiment
-
Centralized data logging – Build a historical analytics database automatically for trend analysis and strategy refinement
-
Team alignment – Keep stakeholders informed with automated summaries and detailed performance reports
Target use cases:
- Social media teams managing brand Instagram accounts
- Marketing departments tracking campaign performance
- Content creators monitoring audience engagement
- E-commerce businesses analyzing product post reactions
- Agencies managing multiple client Instagram accounts
Who Is It For
This agent is ideal for marketing professionals, social media managers, content creators, and business owners who want to maintain consistent Instagram performance monitoring without manual effort. Whether you're managing a single brand account or multiple client accounts, this automation scales to your needs and provides actionable insights that drive better content decisions.
Required Integrations
Facebook Graph API (Instagram)
Why it's needed: Instagram is owned by Meta, and the Facebook Graph API is the official way to programmatically access Instagram business account data, including posts, engagement metrics, and audience insights.
Setup steps:
- Navigate to Meta Developers and sign in with your Meta account
- Create a new app or use an existing one by clicking "My Apps" → "Create App"
- Choose "Business" as your app type
- Fill in your app details (name, email, app purpose)
- Add "Instagram Graph API" product to your app
- Go to Settings → Basic to find your App ID and App Secret
- Navigate to Tools → Graph API Explorer
- Select your Instagram Business Account from the dropdown
- Generate a long-lived access token (valid for 60 days)
- Store your Access Token, App ID, and App Secret securely
How to obtain API keys/credentials:
-
App ID & App Secret: Available in your Meta App Dashboard under Settings → Basic
-
Access Token: Generate via Graph API Explorer or through your app's token endpoint
-
Instagram Business Account ID: Found in your Instagram settings or via Graph API
Configuration in TaskAGI:
- In the "Fetch Instagram Posts" node, authenticate with your Facebook Graph credentials
- Enter your Instagram Business Account ID
- Set the fields to retrieve:
id, caption, media_type, timestamp, like_count, comments_count
- Configure the time range to fetch posts from the last 24 hours
OpenAI API
Why it's needed: Powers the AI sentiment analysis that evaluates audience reactions and post performance, transforming raw Instagram data into actionable insights.
Setup steps:
- Visit OpenAI Platform and create an account
- Navigate to API Keys section in your account settings
- Click "Create new secret key"
- Copy and securely store your API key (you won't see it again)
- Set up billing information to enable API usage
- Optionally set usage limits to control costs
How to obtain API keys/credentials:
-
API Key: Generated directly from your OpenAI account dashboard
-
Organization ID: Optional, found in organization settings if using multiple organizations
Configuration in TaskAGI:
- In the "AI Sentiment Analysis" node, paste your OpenAI API key
- Model is pre-configured as
gpt-4o (recommended for accuracy)
- The prompt analyzes Instagram posts for sentiment, engagement quality, and performance indicators
- Temperature is set appropriately for consistent, reliable analysis
Slack
Why it's needed: Delivers real-time notifications to your team about positive post performance and negative sentiment alerts, keeping everyone informed instantly.
Setup steps:
- Go to Slack API and click "Create New App"
- Choose "From scratch" and name your app "Instagram Analytics"
- Select your workspace
- Navigate to "OAuth & Permissions" in the left sidebar
- Under "Scopes," add
chat:write permission
- Scroll to "Bot Token Scopes" and ensure
chat:write is added
- Click "Install to Workspace" and authorize the app
- Copy your Bot User OAuth Token (starts with
xoxb-)
- In your Slack workspace, create channels:
#instagram-positive and #instagram-alerts
- Invite your bot to both channels
How to obtain API keys/credentials:
-
Bot Token: Found under OAuth & Permissions after installation
-
Channel IDs: Right-click channel name → Copy link to get the channel ID
Configuration in TaskAGI:
- Create two Slack message nodes: one for positive summaries, one for negative alerts
- For positive summaries: Configure to send to
#instagram-positive with formatted performance highlights
- For negative alerts: Configure to send to
#instagram-alerts with warning details
- Use message formatting to include post links, metrics, and sentiment scores
Microsoft Outlook
Why it's needed: Sends comprehensive performance reports to stakeholders and team members, providing detailed analysis and historical context in email format.
Setup steps:
- Sign in to your Microsoft account at outlook.live.com
- Go to Settings → Advanced Settings → Connected Apps & services
- Alternatively, use Microsoft Graph API by visiting Azure Portal
- Register a new application in Azure AD
- Create a client secret and note your Tenant ID, Client ID, and Client Secret
- Grant Mail.Send permissions in API permissions
- In TaskAGI, authenticate using your Microsoft credentials or OAuth token
How to obtain API keys/credentials:
-
Email Address: Your Outlook email
-
Client ID & Secret: From Azure App Registration (if using Graph API)
-
Tenant ID: Your organization's Azure tenant identifier
Configuration in TaskAGI:
- In the "Email Performance Report" node, set the recipient email address (currently
null – update with your team email)
- Subject line is pre-configured: "Top Post Performer - Instagram Analytics Report"
- Body template includes performance metrics, sentiment analysis, and recommendations
- Configure to send daily after analysis completes
Google Sheets
Why it's needed: Creates a permanent, searchable database of Instagram analytics for trend analysis, historical comparison, and long-term strategy development.
Setup steps:
- Go to Google Cloud Console
- Create a new project named "Instagram Analytics"
- Enable the Google Sheets API and Google Drive API
- Create a Service Account (Credentials → Create Credentials → Service Account)
- Generate a JSON key file and download it securely
- Create a Google Sheet titled "Instagram Analytics Log"
- Share the sheet with your service account email address
- Copy the sheet URL for configuration
How to obtain API keys/credentials:
-
Service Account JSON: Downloaded from Google Cloud Console
-
Sheet URL: The full URL of your Google Sheet (currently
null – update with your sheet URL)
-
Sheet ID: Extracted from the URL automatically by TaskAGI
Configuration in TaskAGI:
- In the "Log to Google Sheets" node, paste your sheet URL
- Configure columns: Date, Post ID, Caption, Sentiment Score, Engagement Rate, Likes, Comments
- The "Prepare Sheets Data" node formats Instagram data into the correct column structure
- Rows are appended automatically after each analysis cycle
Configuration Steps
Step 1: Initialize Workflow Notes
The first three nodes establish your agent's purpose and scope:
-
Agent Name Options: Document your chosen agent name (e.g., "Daily Instagram Analyzer")
-
Category & Industry: Specify your industry (e.g., "Social Media Marketing," "E-commerce")
-
Workflow Overview: Write a brief description of what this agent accomplishes for your team
Step 2: Configure the Daily Schedule Trigger
- Set frequency to Daily at your preferred time (e.g., 9:00 AM)
- Choose timezone matching your team's location
- This trigger initiates the entire analysis workflow automatically
Step 3: Fetch Instagram Posts
- Connect your Facebook Graph API credentials
- Set the query to retrieve posts from the last 24 hours
- Include metrics: engagement counts, timestamps, captions
-
Example output: Array of post objects with IDs, captions, and engagement data
Step 4: Format Instagram Data
- This function node transforms raw API responses into a standardized format
- Maps Instagram fields to readable labels
- Calculates engagement rates:
(likes + comments) / followers * 100
-
Output: Cleaned, formatted post data ready for analysis
Step 5: AI Sentiment Analysis
- The GPT-4o model analyzes each post's caption and engagement context
- Evaluates sentiment (positive, neutral, negative)
- Scores performance on a scale of 1-10
- Identifies key themes and audience reactions
-
Output: Sentiment scores and performance analysis for each post
Step 6: Sentiment Router (Decision Point)
This switch node intelligently routes data based on sentiment analysis results:
-
Case 0 (Positive Sentiment): Routes to Slack positive summary, email report, and Sheets logging
-
Case 1 (Neutral Sentiment): Routes to email report and Sheets logging
-
Case 2 (Negative Sentiment): Routes to Slack negative alert and Sheets logging
-
Case 3 & Default: Routes to Sheets logging for all other scenarios
Step 7: Slack Positive Summary
- Triggered when posts receive positive sentiment analysis
- Sends formatted message to
#instagram-positive channel
- Includes: post preview, sentiment score, engagement metrics, key highlights
-
Example message: "🎉 Top Performer! Your latest post achieved 8.5/10 sentiment with 2,400 likes and 156 comments!"
Step 8: Email Performance Report
- Sends to your configured team email address
- Includes comprehensive analysis of all analyzed posts
- Contains sentiment breakdowns, top-performing content, and recommendations
-
Update required: Replace
null in the "to" field with your email address
Step 9: Prepare Sheets Data
- Structures sentiment analysis results for Google Sheets
- Creates rows with: timestamp, post ID, caption excerpt, sentiment score, engagement rate
- Formats numbers and dates for consistency
-
Output: Array of row objects ready for Sheets insertion
Step 10: Log to Google Sheets
- Appends formatted data to your analytics spreadsheet
- Creates permanent record for trend analysis
-
Update required: Replace
null sheet_url with your actual Google Sheet URL
- Enables historical comparison and strategy refinement
Step 11: Slack Negative Alert
- Triggered when posts receive negative sentiment analysis
- Sends urgent alert to
#instagram-alerts channel
- Includes: issue description, sentiment score, recommended actions
-
Example alert: "⚠️ Negative Sentiment Detected: Post received 3.2/10 sentiment. Review comments and consider response strategy."
Testing Your Agent
Pre-Launch Checklist
Before running your first automated cycle, verify all configurations:
Test Execution Steps
-
Manual Trigger: Click "Test Run" in TaskAGI to execute the workflow immediately (don't wait for schedule)
-
Monitor Execution: Watch the workflow progress through each node in real-time
-
Check Node Outputs: Verify data at each step:
- Instagram posts successfully fetched
- Data properly formatted
- Sentiment analysis completes without errors
- Router correctly categorizes sentiment
Verification Points
After Instagram Fetch:
- Confirm 5-10 recent posts are retrieved
- Verify engagement metrics are populated
- Check timestamps are recent (last 24 hours)
After Sentiment Analysis:
- Review sentiment scores (should range 1-10)
- Verify sentiment classifications (positive/neutral/negative)
- Check analysis includes specific insights about each post
After Routing:
- Confirm messages appear in correct Slack channels
- Verify email arrives in inbox with complete report
- Check Google Sheets has new rows with analytics data
Expected Results and Success Indicators
✅ Successful execution shows:
- Slack messages in both channels with formatted content
- Email report in inbox with subject "Top Post Performer - Instagram Analytics Report"
- New rows in Google Sheets with today's date and analytics
- No error messages in workflow execution log
- All node execution times are reasonable (under 30 seconds total)
✅ Data quality indicators:
- Sentiment scores vary across posts (not all identical)
- Engagement rates calculated correctly
- Post captions accurately captured
- Timestamps match your Instagram posts
Troubleshooting Common Issues
"Instagram posts not fetching"
- Verify Instagram Business Account ID is correct
- Confirm Facebook Graph API token hasn't expired
- Check account has public posts to analyze
"Sentiment analysis fails"
- Ensure OpenAI API key is valid and has available credits
- Check API usage limits haven't been exceeded
- Verify GPT-4o model is available in your region
"Slack messages not sending"
- Confirm bot token is correct and hasn't been regenerated
- Verify bot is invited to specified channels
- Check channel names match configuration exactly
"Google Sheets not updating"
- Verify sheet URL is correct and accessible
- Confirm service account email has edit permissions
- Check sheet hasn't been moved or renamed
Congratulations! Your Instagram Performance Analytics Agent is now ready to deliver daily insights automatically. Your team will enjoy actionable intelligence without manual effort, enabling smarter content decisions and better audience engagement.