Intercom Integration
Intercom tracks product usage, bookings, and support tickets so the success team has context. The wrapper lives in reformer-platform/services/intercom.js and exposes helper functions for common events.
Environment Variables
INTERCOM_ACCESS_TOKEN=...
The token must be an Intercom personal access token with permission to create events.
Event Tracking Helpers
trackPortalVisit(userId, portalData)— logs portal navigation (portal_type,page_visited,session_duration).trackCalBooking(bookingData)— captures Cal.com bookings (booking_type,duration,status).trackSupportTicket(ticketData)— records customer support submissions.trackOnboardingEvent(userId, eventType, eventData)— tracks onboarding milestones (step, completion percentage, time spent).- Each helper calls
sendEvent(event)which POSTs tohttps://api.intercom.io/events.
Usage Patterns
- Automation orchestrator hooks call Intercom helpers after Cal bookings and onboarding steps.
- Support flows (Intercom widget, Crisp integration) trigger
trackSupportTicketwith priority/status metadata. - All helpers log warnings if
INTERCOM_ACCESS_TOKENis missing, so monitor logs to ensure events aren’t being skipped.
Monitoring
- Watch for
Intercom event tracked: …console logs during onboarding/test runs. - Errors surface as
Intercom … tracking failedmessages; resolve by verifying token scopes or payload structure. - Periodically review Intercom event streams to confirm events arrive with expected metadata.
RAGS Integration
The Intercom integration automatically detects URLs in conversation messages and triggers RAGS (Reformer Analysis & Growth Scoring) analysis.
Status (Nov 13, 2025): The webhook endpoint responds correctly, but Intercom is not currently delivering events. Follow the troubleshooting checklist below before relying on Intercom-triggered RAGS runs.
Setup
-
Configure Webhook in Intercom:
- Go to https://app.intercom.com/a/apps/_/settings/webhooks
- Create new webhook:
- Webhook URL:
https://reformer-platform.onrender.com/api/intercom/webhook - Webhook name:
RAGS Analysis - Webhook version:
2.0(or latest)
- Webhook URL:
- Subscribe to events:
- ✅
conversation.user.replied - ✅
conversation.admin.replied
- ✅
- Save webhook
-
Verify Environment Variable:
- Ensure
INTERCOM_ACCESS_TOKENis set in Render environment variables
- Ensure
Usage
Important: Intercom does NOT use slash commands like Slack. It automatically detects URLs in messages.
Simply paste a URL in any Intercom conversation:
Check out https://example.com
The system will automatically:
- Detect the URL in your message
- Start RAGS analysis in the background
- Post results back to the conversation when complete
Troubleshooting
No response after sending URL:
- Check webhook is configured in Intercom dashboard
- Verify webhook URL matches:
https://reformer-platform.onrender.com/api/intercom/webhook - Check events subscribed:
conversation.user.replied,conversation.admin.replied - Verify webhook is enabled/active
- Check server logs in Render dashboard
- Confirm the webhook was re-saved after the most recent Intercom policy updates (November 2025). If needed, delete and recreate it.
URL not detected:
- Make sure URL starts with
http://orhttps:// - Try sending just the URL without extra text
- Check server logs to see what message body was received
Loop Prevention & Filtering
- Admin/bot replies, Slack mirrors, and system URLs now get filtered before analysis to avoid infinite loops between Slack ↔ Intercom.
- Messages are ignored if they only contain previously posted RAGS report links or internal
.reformer.laURLs. - All filter decisions are logged with
Intercom RAGS: skipped because …so you can audit server logs when debugging.
MCP Automation
Intercom MCP tools enable end-to-end configuration directly from Cursor (see reformer-platform/mcp-servers/intercom-mcp/):
list_webhooks— audit current subscriptions.create_webhook— provision/re-provision the RAGS webhook with the correct delivery URL and topics.update_webhook— adjust delivery URL, toggle activation, or replace topics.delete_webhook— retire old or incorrect subscriptions.
Use these commands to keep the webhook aligned with production without leaving Cursor:
# Recreate webhook with default topics
"Create Intercom webhook pointing to https://reformer-platform.onrender.com/api/intercom/webhook"
# Pause a noisy webhook
"Update Intercom webhook <subscription_id> set active false"
Cache Clearing & Anonymous Mode
The dashboard includes a utility function to clear Intercom cache and start fresh conversations without previous history.
Usage
Call clearSession() from the useIntercom hook to:
- Clear all Intercom cookies, localStorage, and sessionStorage
- Clear IndexedDB data
- Remove Intercom DOM elements and scripts
- Boot Intercom in anonymous mode (no user identity)
- Show toast notification for user feedback
- Start a fresh conversation thread
Implementation: dashboard/src/hooks/useIntercom.js
Example:
import { useIntercom } from '../hooks/useIntercom'
function MyComponent() {
const { clearSession } = useIntercom()
const handleClearCache = () => {
clearSession() // Shows toast notification automatically
}
return <button onClick={handleClearCache}>Clear Intercom Cache</button>
}
Anonymous Mode
The useIntercom hook supports anonymous boot mode:
- Checks for
intercom_anonymous_modeflag in sessionStorage - Boots Intercom without
user_id,email, oruser_hash - One-time use - flag is cleared after anonymous boot
- Normal boot resumes on next page refresh
When to Use
- Testing support flows as a new visitor
- Starting fresh conversations without previous context
- Debugging Intercom integration issues
- Resetting Intercom state during development
Note: Uses modern toast notification UX instead of dedicated page route for better user experience.
Future work: expand to user attributes (plan tier, health score) and bi-directional syncing with CRM.***