This project sends weekly Fathom Analytics reports to a Discord channel.
- Data Retrieval: The script uses Fathom Analytics Aggregations API to obtain weekly analytics data.
- Report Generation: It calculates the number of pageviews for the previous week, compares them to the week before, and highlights the top pages.
- Notification: The final report is sent to a Discord channel using a webhook.
- Automation: A GitHub Actions workflow (configured via a YAML file) can run the script on a schedule (every Tuesday at 9 AM UTC) or be triggered manually.
- Clone the repository:
gh repo clone xyflow/fathom-discord-roundup
- Navigate to the project directory:
cd fathom-discord-roundup
- Install dependencies:
Or, if using npm:
pnpm install
npm install
Create a .env
file in the project root directory and add your credentials:
DISCORD_WEBHOOK_URL=your_discord_webhook
FATHOM_API_TOKEN=your_fathom_api_token
FATHOM_SITE_ID=your_fathom_site_id
- Open Discord and navigate to the channel where you want to post the report.
- Click the settings icon (gear) next to the channel name.
- Select Integrations, then click on Webhooks.
- Click New Webhook and give it a name (e.g., "Fathom Report Bot").
- Copy the Webhook URL and paste it into your
.env
file as theDISCORD_WEBHOOK_URL
. - Save the changes.
Run the script manually by executing:
node index.js