Cutting product analytics costs

Last updated:

|Edit this page

We aim to be significantly cheaper than our competitors. In addition to our ridiculously cheap pricing, below are tips to reduce your product analytics costs:

Use anonymous events

PostHog captures two types of events: anonymous and identified. Under our current pricing, anonymous events can be up to 4x cheaper than identified ones (due to the cost of processing them), so it's recommended you only capture identified events when needed.

See our docs on anonymous vs identified events for more information on the differences between them and how to capture them.

Configure autocapture

Autocapture is a powerful feature that captures many events automatically. It can also capture more than you need. To reduce which events are captured, you can set an allow or ignore list.

Alternatively, you can disable autocapture completely.

Only call identify() once per session

It's only necessary to identify a user once per session. To prevent sending unnecessary events, check posthog._isIdentified() before calling identify():

JavaScript
if (!posthog._isIdentified()) {
posthog.identify('distinct_id') // Replace 'distinct_id' with your user's unique identifier
}

Only call group() once per session

In client-side SDKs, it's only necessary to call group() once per session. Prevent calling it multiple times to send fewer events and reduce costs.

Disable pageview or pageleave events

PostHog automatically captures pageviews and pageleaves. This is great for analytics, but it may capture more events than you need. An alternative is disabling these events and capturing them manually for the pages you need instead.

To disable automatically capturing these events, set capture_pageviews and capture_pageleave to false in the configuration options when initializing PostHog:

JavaScript
posthog.init('<ph_project_api_key>',
{
api_host: 'https://us.i.posthog.com',
capture_pageviews: false,
capture_pageleave: false,
}
)

To manually capture these events, call posthog.capture('$pageview') and posthog.capture('$pageleave').

Note: Disabling pageview and pageleave events may prevent other PostHog features from working, like bounce rate.

Questions?

Was this page useful?

Next article

Trends

Trends insights enable you to plot data from people, events, and properties however you want. They're useful for finding patterns in your data, as well as monitoring your product to ensure everything is running smoothly. Trends is the default insight type in PostHog. What can you learn from trends? Using trends, you can analyze: How your most important metrics change over time. Long-term patterns, or cycles in your usage. How a specific change affects usage. The usage of different features side…

Read next article