Odoo PostHog Analytics integration

PostHog Analytics Connector

PostHog sees what people click. Odoo knows what they bought. This module puts both on the same person.

PostHogProduct AnalyticsSession RecordingAutocaptureCookie ConsentCookielessServer Side EventsUS Cloud

What it does

Paste your PostHog project token, pick US Cloud, EU Cloud or your own host, and tick the websites. The PostHog snippet then runs on your Odoo website and customer portal: page views, autocapture and, if you want it, session recording with typed text masked. Nothing is captured until the visitor accepts optional cookies on the Odoo cookies bar, unless you choose otherwise. Logged-in customers and employees get one distinct ID per contact, so a visit, a backend session and a paid invoice all land on the same person in PostHog. Orders, sign-ups and paid invoices are sent from the server, so ad blockers and closed tabs do not lose them.

Features

Website and portal snippetpage views on every route change, page leave, autocapture and optional session recording, per website
Consent on the Odoo cookies barPostHog starts opted out and opts in the moment the visitor presses Accept. A website without the bar counts as accepted, like Odoo does
Cookieless modecount visits without cookies or a person until the visitor accepts, using PostHog's cookieless_mode on_reject
Identify logged-in userscustomers and employees get <prefix><contact ID>, with name and email as person properties if you allow it. Logging out resets the browser identity
Backend trackingoptional page views, autocapture and session recording inside Odoo for your own team
Server side eventsorder confirmed, user signed up and invoice paid, with order number, revenue, currency, products and items. You can rename each event
Guest checkouts joined upthe shop stores the visitor's PostHog browser ID on their own cart, so the order event lands on the same anonymous person who browsed
No person without a yeswebsite orders from visitors who declined cookies go out with a random ID and without a person profile
Capture v1 with retriesthe current PostHog capture API: per-event results, the same event UUID and request ID on every retry, attempt count, 8 tries before giving up
Event logevery server event with its properties, status, attempts and the answer from PostHog. Send again, retry all, or open the order or invoice
Dry run and test eventbuild events without sending anything, or send one odoo_connection_test event to check the token