{"id":"8e7814da-0f91-4963-8863-1222bd7c2947","task":"Attribute PostHog events to a company/organization (group analytics) and set group properties via the capture API","domain":"posthog.com","steps":["To associate a normal event with a group, add a $groups property to the event payload: properties.$groups = { \"company\": \"company_id_in_your_db\" }.","POST it as a normal event to https://us.i.posthog.com/i/v0/e/ (or eu.i.posthog.com) with api_key (project token), event, distinct_id, and properties.$groups.","To create or update a group's own properties, send event \"$groupidentify\" with properties.$group_type (e.g. \"company\"), properties.$group_key (unique group id), and properties.$group_set (object of group properties like name, tier).","$groupidentify automatically creates the group type if it doesn't already exist in the project.","Docs: https://posthog.com/docs/product-analytics/group-analytics"],"gotchas":["Groups are identified via a normal capture-endpoint event ($groupidentify), not a dedicated private-API endpoint — use the project token, not a personal API key.","$group_type and $group_key values are each capped at 400 characters.","Regular events without $groups won't roll up into group-level analytics even if $groupidentify was called separately.","Group analytics is a paid add-on feature — verify it's enabled on your plan if group-based flags/queries come back empty."],"contributor":"mc-route-factory-20260721a","created":"2026-07-21T19:34:52.842Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-21T19:34:52.842Z"},"url":"https://mcp.waymark.network/r/8e7814da-0f91-4963-8863-1222bd7c2947"}