Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 41 additions & 17 deletions contents/docs/cdp/transformations/drop-events.mdx
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
---
title: Drop Events
showTitle: true
title: Drop events
templateId:
- template-drop-events
---
import { CalloutBox } from 'components/Docs/CalloutBox'

PostHog's drop events transformation allows you to selectively discard events from being ingested based on specific criteria.
## Overview
import FeedbackQuestions from "../_snippets/feedback-questions.mdx"
import PostHogMaintained from "../_snippets/posthog-maintained.mdx"
import { CalloutBox } from 'components/Docs/CalloutBox'

The drop events transformation permanently removes events from your data pipeline, preventing them from being stored or processed by PostHog.
Selectively discard events from being ingested based on specific criteria. Dropped events are permanently removed from your data pipeline, preventing them from being stored or processed by PostHog.

<CalloutBox icon="IconPiggyBank" title="Impact on usage & billing" type="info">

Events that are dropped using a transformation **do not count towards your usage/billing**.
Events that are dropped using a transformation **do not count towards your usage/billing**.

While we encourage you to [instrument custom events](/docs/getting-started/send-events#2-capture-custom-events) and [configure autocapture](/docs/product-analytics/autocapture) to only capture the events you need long term, a **Drop Events** transformation can serve as a temporary solution to reduce usage immediately (vs. waiting for your next deployment cycle to modify custom events or configuration).
While we encourage you to [instrument custom events](/docs/getting-started/send-events#2-capture-custom-events) and [configure autocapture](/docs/product-analytics/autocapture) to only capture the events you need long term, a **Drop Events** transformation can serve as a temporary solution to reduce usage immediately (vs. waiting for your next deployment cycle to modify custom events or configuration).

It can also be useful when you want more granular control over _bundled_ autocapture events such as excluding a [specific app lifecycle events](/docs/product-analytics/autocapture#react-native-navigation-and-lifecycle-autocapture) and only capturing the ones you need.

</CalloutBox>

## Installation

1. In PostHog, click the [Data pipeline](https://us.posthog.com/pipeline/overview) tab in the left sidebar.
2. Click the [Transformations](https://us.posthog.com/pipeline/transformations) tab.
3. Search for **Drop events** and click **+ Create**.
4. Configure your filters to target the events you want to drop.
5. Press **Create & Enable** to start dropping matching events.

<HideOnCDPIndex>

## Configuration

<TemplateParameters />

The drop events transformation uses filters to target specific events for removal.

### Filtering options

1. **Event matching**: Target specific event types by name (e.g., `$pageview`, `user_signed_up`)
3. **Property filters**: Further refine your filters with property conditions:
2. **Property filters**: Further refine your filters with property conditions:
- Match on any event property
- Supports operators like equals, contains, greater than, etc.
- Apply property filters globally across all events or specifically to individual event types

#### How to use the filters
### How to use the filters

The drop events transformation uses two types of filters that work together:

Expand All @@ -43,7 +56,7 @@ The drop events transformation uses two types of filters that work together:
2. **Property filters**: These filters use AND logic and are applied after the event matching. ALL property conditions must be met for an event to be dropped. For example, if you set:
- `browser is set`
- `Country Name is set`

Only events that have BOTH properties matching these conditions will be dropped.

![Drop events based on property filters](https://res.cloudinary.com/dmukukwp6/image/upload/Property_Filter_And_2dc645185c.png)
Expand All @@ -53,7 +66,7 @@ The drop events transformation uses two types of filters that work together:
- If you select "All events" and add a property filter "browser is set", it will drop ALL events that have the browser property set
- If you also add specific event matches like `$pageview` and `$pageleave`, it will drop:
- All `$pageview` events
- All `$pageleave` events
- All `$pageleave` events
- Any other events that have the browser property set

![Drop events based on combined filters](https://res.cloudinary.com/dmukukwp6/image/upload/Both_Event_Filter_And_Property_Filter_9b5360cdd4.png)
Expand Down Expand Up @@ -86,11 +99,22 @@ Before enabling your drop events transformation in production, use the built-in
3. Run the test to see if the event would be dropped
4. Iterate on your filters until you're satisfied with the results

## Important considerations
## FAQ

### Is the source code for this transformation available?

PostHog is open-source and so are all the transformations on the platform. The [source code](https://github.com/PostHog/posthog/blob/master/posthog/cdp/templates/drop_events/template_drop_events.py) is available on GitHub.

### What happens to dropped events?

Dropped events are permanently deleted and cannot be recovered. They are removed before ingestion, so they won't appear in any analytics, cohorts, or exports.

### How do I monitor what's being dropped?

Check the metrics and logs tabs regularly to ensure the transformation is working as expected. The metrics tab shows how many events have been processed and dropped.

- **Permanence**: Dropped events are permanently deleted and cannot be recovered
- **Monitoring**: Check the metrics and logs tabs regularly to ensure the transformation is working as expected
<PostHogMaintained />

## Learn more
<FeedbackQuestions />

- [PostHog filtering documentation](/docs/product-analytics/trends/filters)
</HideOnCDPIndex>