Setting Up Webhooks
Webhooks allow Alpha Insights to send real-time profit data to other apps and services like Zapier, Make (Integromat), Slack, or custom applications. This guide covers webhook setup and configuration.
What Are Webhooks?
Webhooks are automated messages sent from Alpha Insights when events occur, like:
- New order with profit calculation complete
- Daily profit summary calculated
- Low profit alert triggered
- Campaign ROAS threshold reached
These messages can trigger actions in other apps automatically.
Webhook Use Cases
Slack Notifications
Get instant Slack messages when:
- Daily profit exceeds target
- Order with negative profit occurs
- Campaign ROAS drops below threshold
Zapier Automation
- Add high-value customers to CRM
- Create Google Sheets row for each order with profit data
- Send SMS for low-profit alerts
- Add to Airtable database
Make (Integromat) Workflows
- Complex multi-step automations
- Data transformation and routing
- Conditional logic based on profit thresholds
Custom Applications
- Send data to your own app or dashboard
- Integrate with internal tools
- Build custom reporting systems
Creating a Webhook
Step 1: Access Webhook Settings
- Go to Alpha Insights → Settings
- Click the Webhooks tab
- Click Add New Webhook
Step 2: Configure Webhook
Webhook Name: Descriptive name (e.g., “Slack Daily Profit Alert”)
Webhook URL: The endpoint that will receive the data
- From Zapier: Copy the webhook URL from your Zapier trigger
- From Make: Copy webhook URL from HTTP module
- From Slack: Create incoming webhook in Slack settings
- Custom: Your API endpoint URL
Events to Trigger: Select when webhook fires
- Order Created (with profit data)
- Daily Summary Complete
- Weekly Summary Complete
- Low Profit Alert
- Goal Achievement
- Campaign ROAS Alert
Data Format:
- JSON (recommended)
- Form Data
- XML
Step 3: Authentication (Optional)
If your endpoint requires authentication:
- Basic Auth: Username and password
- Bearer Token: API key or token
- Custom Headers: Add custom authentication headers
Step 4: Test Webhook
- Click Test Webhook
- Sample payload is sent to your URL
- Check that data is received correctly
- View response code (200 = success)
Step 5: Save Webhook
- Click Save Webhook
- Webhook is now active
Webhook Payload Structure
Order Created Event
{ "event": "order_created", "timestamp": "2024-01-15T14:30:00Z", "order": { "id": 12345, "date": "2024-01-15", "total": 125.00, "cost": 65.50, "profit": 59.50, "margin": 47.6, "customer": { "name": "John Smith", "email": "john@example.com" }, "items": [ { "name": "Blue T-Shirt", "quantity": 2, "price": 25.00, "cost": 12.00, "profit": 13.00 } ], "traffic_source": "facebook", "campaign": "spring_sale" } }
Daily Summary Event
{ "event": "daily_summary", "date": "2024-01-15", "metrics": { "revenue": 2450.00, "profit": 892.00, "margin": 36.4, "orders": 23, "ad_spend": 350.00, "roas": 7.0 }, "comparison": { "revenue_change": 15.2, "profit_change": 12.8 } }
Popular Integrations
Zapier Integration
Setup:
- In Zapier, create new Zap
- Choose “Webhooks by Zapier” as trigger
- Select “Catch Hook”
- Copy the webhook URL
- In Alpha Insights, create webhook with this URL
- Test to send sample data
- In Zapier, continue building your workflow
Example Zaps:
- New Order → Add row to Google Sheets
- Low Profit Alert → Send email notification
- Daily Summary → Post to Slack channel
Make (Integromat)
- Create new scenario in Make
- Add “Webhooks” module as trigger
- Select “Custom webhook”
- Copy webhook URL
- Add to Alpha Insights webhooks
- Build your automation workflow
Slack
- Go to Slack → Apps → Incoming Webhooks
- Create new webhook, select channel
- Copy webhook URL
- In Alpha Insights, add webhook with Slack URL
- Format: Select “Slack” from templates
Webhook Security
Verifying Webhook Source
Alpha Insights includes signature in headers:
X-AlphaInsights-Signature: sha256=abc123...
Use this to verify webhook came from Alpha Insights, not malicious source
Best Practices
- Use HTTPS URLs only (not HTTP)
- Enable authentication when possible
- Validate signature in your endpoint
- Rate limit your endpoint to prevent abuse
- Store webhook secrets securely
Troubleshooting
Webhook Not Firing
Check:
- Webhook is enabled (not paused)
- Event has actually occurred
- View webhook logs for error messages
Data Not Received
Check:
- URL is correct (no typos)
- Your endpoint is publicly accessible
- No firewall blocking Alpha Insights’ IP
- Endpoint returns 200 status code
Webhook Timing Out
Issue: Endpoint takes >30 seconds to respond
Solution: Make endpoint respond quickly (within 5 seconds)