PostHog
Forward PostHog events to Accoil via data pipeline.
Accoil provides a native PostHog data pipeline destination that forwards events, user data, and account data into Accoil.
Use the Correct Destination
PostHog lists two Accoil-related destinations. Use the one labeled "Accoil", not "Accoil Analytics". The "Accoil Analytics" destination was created without direct consultation with our team and does not align with the Accoil API. The Accoil data pipeline was developed by us and works as expected.
Setup
- In PostHog, go to Data Pipelines > Destinations > New Destination.
- Search for and select Accoil, then click Create.
- Enter your Accoil API key (found in Accoil under Settings > General > Account Settings).
- Click Create & enable.
Your PostHog events are now flowing into Accoil.
Event Filtering
Accoil only accepts a defined set of PostHog events. All other internal system events are ignored unless they appear in the allowed list.
Allowed PostHog events:
$identify$set$pageview$screen$groupidentify- Any custom event that does not start with
$
Event Type Mapping
Incoming PostHog events are mapped to Accoil event types:
| PostHog Event | Accoil Type | Notes |
|---|---|---|
$identify, $set | identify | User identification and traits |
$groupidentify | group | Group/account identification and traits |
$pageview | page | Must include a name; treated as a track event in Accoil |
$screen | screen | Must include a name; treated as a track event in Accoil |
| Custom events | track | Generic event tracking |
Trait Handling
General Rules
- identify events: Accept user traits.
- group events: Accept group/account traits.
- track, page, and screen events: Do not accept traits. Only the event name (or page/screen name) is captured.
User Traits
By default, Accoil sends a minimal set of user traits (only if available):
userIdemailnamecreatedAt
No additional traits are included unless explicitly configured.
Including Additional User Traits
You can send more traits from PostHog into Accoil using two methods:
- Include all properties from an object -- Sends all traits from a given object (e.g.,
event.properties.user). This can result in sending a large volume of data, so use with caution. - Add entry manually -- Define individual traits by setting a key (the trait name as it will appear in Accoil) and a value (the PostHog reference, e.g.,
{event.properties.role}). This gives you granular control over which traits are forwarded.
Group Traits
By default, only a small set of group traits are sent:
groupIdgroup_namegroup_createdAtgroup_statusgroup_plangroup_mrr
You can configure additional group traits using the same two methods as user traits: include properties from an entire object, or add specific key-value pairs where the key is the trait name in Accoil and the value is the group property reference (e.g., {event.properties.$group_set.industry}).
Blocked Traits
Regardless of how traits are configured, Accoil automatically blocks any trait keys containing:
geoipipcurrent_url
This ensures user privacy and data hygiene.
Filtering Test and Internal Users
To keep engagement scores and analytics accurate, filter out internal and test data using one of the following approaches.
Option 1: Filter in PostHog
These approaches prevent test data from reaching Accoil:
- Internal/test users: Use PostHog's Data Pipeline filters to exclude users based on internal email domains, test flags, or environment-specific traits.
- Custom filters: PostHog supports advanced filtering based on traits or event properties.
Option 2: Filter in Accoil
If data has already entered Accoil, you can filter it at the workspace level:
- Domain-based filtering: Exclude users from known test domains (e.g.,
@yourcompany.com). Navigate to Workspace Settings > Engagement Score > Filter Users. - Trait-based filtering: Filter users or accounts using traits passed from PostHog (e.g.,
isTestUser,environment).
These filters prevent test data from influencing engagement scores or segment logic.
Option 3: Sandbox Account
For complete separation of test and production data, you can request a dedicated sandbox account. This option is available for customers on the Scale plan:
- Uses a separate API key.
- Keeps all test data out of your production workspace.
- Ideal if you already use separate environments in PostHog.
Sandbox data is excluded from billing, deleted after 60 days, and not connected to third-party integrations.
Contact us from within Accoil to set up a sandbox environment.