Monthly away / available activity reporting using Google Apps Script and the Intercom API.
This project generates a fully automated monthly report that calculates Intercom admin active (available) time based on away mode changes. The report is exported to Google Sheets, stored in Google Drive, and emailed automatically.
Intercom does not currently provide a native report for admin active or available time based on away mode history. This script fills that gap.
- Fetches admins and activity logs from the Intercom API
- Filters away and available status change events
- Calculates daily active minutes per admin
- Flags whether the 7.5-hour (450 minute) daily target is met
- Generates a Google Spreadsheet with:
- One sheet per admin (daily breakdown)
- One summary sheet with totals and averages
- Applies formatting and conditional highlighting
- Moves the report to a Google Drive folder if it exists
- Sends a monthly email with the report link
- Runs automatically using a time-driven trigger
No manual exports. No recurring checks. No spreadsheet maintenance.
Intercom records admin status changes.
This script treats the time between an available status and the next away status as active working time.
For each admin:
- Detect when status changes to available
- Measure time until status changes to away
- Sum the duration per calendar day
Per admin:
- Total active minutes
- Total active time (hh:mm)
- Number of active days
- Average minutes per day
- Average active time
- Whether the 7.5-hour target is met (average)
One sheet per admin containing:
- Date
- Active minutes
- Active time (hh:mm)
- 7.5-hour target met (Yes / No)
- Center-aligned tables
- Frozen header rows
- Auto-resized columns
- Conditional formatting
- Green when target is met
- Red when target is not met
- Intercom API access with permission to read admins and activity logs
- Google account with access to:
- Google Apps Script
- Google Sheets
- Google Drive
- Gmail (for email delivery)
- Open https://script.google.com
- Create a new project
- Paste the script into
Code.gs
Edit the following values in the script:
const API_KEY = ‘Bearer YOUR_INTERCOM_API_TOKEN’; const ADMIN_IDS = [‘ADMIN_ID_1’, ‘ADMIN_ID_2’, ‘ADMIN_ID_3’]; const MIN_MINUTES = 450;
- API_KEY must include the
Bearerprefix - ADMIN_IDS must match the Intercom admin IDs to include in the report
- MIN_MINUTES defines the daily target in minutes (default: 7.5 hours)
Run the function once manually:
generateAdminActiveTimeReport();
Approve permissions for:
- External requests (Intercom API)
- Google Sheets
- Google Drive
- Sending email
If a folder named:
Intercom Reports
exists in Google Drive, the generated spreadsheet will be moved there automatically.
If it does not exist, the file remains in the Drive root.
- Open Apps Script and go to Triggers
- Add a new trigger with:
- Function:
generateAdminActiveTimeReport - Event source: Time-driven
- Type: Month timer
- Choose a date and time
- Function:
The script always generates a report for the previous calendar month.
- The report link is emailed automatically
- Sent to the Google account that owns the script
- Additional recipients can be added in the email configuration section
- Only away mode changes are counted
- Admins who never toggle status will show no data
- Open available sessions at month end are not closed automatically
- Dates are grouped using UTC by default
- Valid Intercom API permissions are required
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
You are free to use, modify, and redistribute this project under the same license terms.
This project is community-built and is not affiliated with or endorsed by Intercom.
Use this project in accordance with your organization’s policies.