> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Retention and cohorts – Product Analytics pocket guide Canonical URL: https://posthog.com/learn/product-analytics/pocket-guide/retention-cohorts Chapter 04 # Retention and cohorts – Product Analytics pocket guide On Twig, guests browse stays, save places they like, and book trips. These actions are all recorded in PostHog, along with their account ID once they've logged in. Twig's engineers have used this data to build two insights: a trend showing how many people use filters to find stays and a funnel showing booking completion. Those insights show how guests find stays and finish a booking, but not whether they book another stay later. Twig wants to measure that return. ## Define retention Edgar is one of Twig's visitors. His events in PostHog show that he has used a filter to find a stay, saved a stay, and completed one booking. If he comes back later, he's a returning visitor, but that doesn't mean he's booked again. A [retention insight](https://posthog.com/docs/product-analytics/retention.md) counts people who perform a starting action, then a return action in a later period. Twig's engineers decide to define retention as a visitor who books another stay, after booking their first one – they use the `booking_completed` event for the insight's start and return action. If Edgar signs in with the same account and books again, PostHog can connect the later event to his first booking, even across visits or devices. Reset Twig ![Dark A-frame cabin among autumn trees, with a gravel path leading to the entrance at dusk](https://posthog.com/static/cabin-52b343c8c87096a619df7bf1a904bcea.jpg) ### Adiron-shack Adirondacks, New York 4 guests · 2 bedrooms · 2 baths **$355** / night USD