{"id":20831824,"url":"https://github.com/courtsite/mailgun-to-posthog","last_synced_at":"2025-12-24T15:56:35.450Z","repository":{"id":118551396,"uuid":"350492468","full_name":"Courtsite/mailgun-to-posthog","owner":"Courtsite","description":"[Unmaintained] 📬 A simple Google Cloud Function in Go to capture Mailgun webhook events as PostHog custom events.","archived":false,"fork":false,"pushed_at":"2021-03-22T21:30:24.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-17T17:19:51.530Z","etag":null,"topics":["analytics","autocapture","google-cloud","google-cloud-functions","mailgun","mailgun-api","mailgun-webhooks","posthog","product-analytics"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Courtsite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-22T21:18:47.000Z","updated_at":"2024-06-19T12:30:11.593Z","dependencies_parsed_at":null,"dependency_job_id":"5f08760c-90a1-479b-94b3-c64a59a45de3","html_url":"https://github.com/Courtsite/mailgun-to-posthog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Courtsite%2Fmailgun-to-posthog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Courtsite%2Fmailgun-to-posthog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Courtsite%2Fmailgun-to-posthog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Courtsite%2Fmailgun-to-posthog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Courtsite","download_url":"https://codeload.github.com/Courtsite/mailgun-to-posthog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243182197,"owners_count":20249585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","autocapture","google-cloud","google-cloud-functions","mailgun","mailgun-api","mailgun-webhooks","posthog","product-analytics"],"created_at":"2024-11-18T00:09:15.972Z","updated_at":"2025-12-24T15:56:35.441Z","avatar_url":"https://github.com/Courtsite.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mailgun-to-posthog\n\n📬 A simple Google Cloud Function in Go to capture [Mailgun](https://mailgun.com/) webhook events as [PostHog](https://posthog.com/) custom events.\n\n_This project is still under development, and it does not handle many cases. It has been tested with the Go 1.13 runtime._\n\n![Event in PostHog](screenshot.png \"Event in PostHog\")\n\n---\n\n**Why is this needed?**\n\nThis project helps you feed Mailgun events into PostHog, providing a consolidated view of your product analytics, and allowing you to understand your customers' end-to-end journey better.\n\nFor example, you may want to know the % of your customers engaging with a specific e-mail you send after an action(s). You may also be curious to know what cohort of your customers are more likely to engage versus others or what sort of events precedes the engagement.\n\nIt is extra useful for your product / engineering / design team if they do not have access to Mailgun.\n\n**What properties are captured?**\n\nAs much as Mailgun provides. Varies depending on the event (e.g. the URL for \"Clicked\" event).\n\nIt can also capture additional \"User Variables\" specified when sending the message, see `.env.sample.yaml`.\n\n**How does it correlate the user?**\n\nA message is correlated with a PostHog user through a custom user ID defined in the \"User Variables\". You need to include this when sending the message. In Mailgun's Go SDK, you can attach the user ID like so:\n\n```go\nmessage.AddVariable(\"user_id\", \"user-id-123\")\n```\n\nYou can configure the user ID key (`user_id` by default) used, see `.env.sample.yaml`.\n\n**What events are currently supported?**\n\n- Delivered\n- Opened\n- Clicked\n\n\n## Getting Started\n\n### Prerequisites\n\n- Ensure you have `gcloud` installed:\n    - MacOS: `brew cask install google-cloud-sdk`\n    - Others: https://cloud.google.com/sdk/gcloud\n- Ensure you have authenticated with Google Cloud: `gcloud init`\n- (Optional) Set your current working project: `gcloud config set project \u003cproject\u003e`\n\n### Deployment\n\n1. Clone / download a copy of this repository\n2. Copy `.env.sample.yaml` to `.env.yaml`, and modify the environment variables declared in the file\n3. Run `./deploy.sh`\n4. Ensure you have tracking set-up, and enabled in Mailgun, `https://app.mailgun.com/app/sending/domains/\u003cyour domain\u003e/settings`\n5. Configure Mailgun webhooks in `https://app.mailgun.com/app/sending/domains/\u003cyour domain\u003e/webhooks`\n\n![Mailgun Tracking Settings](installation_1.png \"Mailgun Tracking Settings\")\n\n![Mailgun New Webhook Page](installation_2.png \"Mailgun New Webhook Page\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcourtsite%2Fmailgun-to-posthog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcourtsite%2Fmailgun-to-posthog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcourtsite%2Fmailgun-to-posthog/lists"}