PostHog Analytics Connector | PostHog Integration, Session Recording, Server Side Events
by Modvanta https://modvantaapps.tech
Odoo
$ 11.97

PostHog sees what people click. Odoo knows what they bought. This module puts both on the same person.
PostHog | Product Analytics | Session Recording | Autocapture | Cookie Consent | Cookieless | Server Side Events | US Cloud | EU Cloud | Self-hosted | Odoo 19
Written and supported by Modvanta - modvantaapps@gmail.com
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.
| Website and portal snippet: page views on every route change, page leave, autocapture and optional session recording, per website | |
| Consent on the Odoo cookies bar: PostHog starts opted out and opts in the moment the visitor presses Accept. A website without the bar counts as accepted, like Odoo does | |
| Cookieless mode: count visits without cookies or a person until the visitor accepts, using PostHog's cookieless_mode on_reject | |
| Identify logged-in users: customers and employees get <prefix><contact ID>, with name and email as person properties if you allow it. Logging out resets the browser identity | |
| Backend tracking: optional page views, autocapture and session recording inside Odoo for your own team | |
| Server side events: order confirmed, user signed up and invoice paid, with order number, revenue, currency, products and items. You can rename each event | |
| Guest checkouts joined up: the 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 yes: website orders from visitors who declined cookies go out with a random ID and without a person profile | |
| Capture v1 with retries: the 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 log: every 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 event: build events without sending anything, or send one odoo_connection_test event to check the token |
Who it is for
SHOPS ON ODOO ECOMMERCE See which pages lead to orders and replay the sessions that ended at the payment step, with revenue coming from Odoo, not from a browser tag. | B2B PORTALS Know which customers log in, what they look at in the portal and when their invoices get paid, all on one person. | TEAMS ALREADY ON POSTHOG Keep your product analytics in PostHog and add the Odoo side without writing code or installing a Python package on the server. |
What it adds to Odoo 19
| Need | Odoo 19 core | With this module |
| PostHog snippet on the website | Not included | Per website, with consent and recording switches |
| Orders and paid invoices in PostHog | Not included | Sent from the server with retries |
| One person across shop, portal and backend | Not included | Same distinct ID per contact |
| Cookie consent for PostHog | Not included | Tied to the Odoo cookies bar |
See it in Odoo
One form for the whole setup
Project token, region, capture API, the websites and how consent works. The token field is only shown to PostHog managers.

Backend tracking for your own team
Off by default. Switch on page views, autocapture or session recording for employees.
Server events you choose
Order confirmed, sign-up and invoice paid, each with its own event name. Orders can be website orders only or every confirmed order.

Every server event in a list
Distinct ID, the order or invoice it came from, and whether it went out anonymous.

What was sent
The properties exactly as PostHog got them, with the event UUID and the number of attempts.

The cookie choice on the order
Website orders keep the visitor's cookie answer and PostHog browser ID, shown to PostHog users only.

How it works
1 | Copy the project token In PostHog: Settings, Project, Project token. It starts with phc_. A personal API key is not needed and is refused. |
2 | Create the project in Odoo Website, Configuration, PostHog, Projects. Paste the token and pick the region or your own host. |
3 | Pick websites and consent Tick the websites and choose: wait for the cookies bar, cookieless until accepted, or capture without asking. |
4 | Check it Press Send Test Event and look for odoo_connection_test in PostHog Activity. Or turn on Dry Run first and read the event log. |
5 | Let it run Server events go out every 5 minutes. Page views start on the next page load. |
Settings
| PostHog: project token, US Cloud / EU Cloud / self-hosted or reverse proxy, capture v1 or legacy /batch/ | |
| People: identify logged-in users, send name and email, distinct ID prefix, dry run | |
| Website: websites, consent mode, page views, autocapture, session recording, mask typed text, skip employees | |
| Backend: tracking, autocapture and session recording for employees | |
| Server events: on or off and the event name for order confirmed, sign-up and invoice paid |
Questions
Do I need to install the posthog Python package?
No. Server events are plain HTTPS calls to the PostHog capture API, and the website loads the PostHog script from your PostHog host.
Which key does it need?
Only the project token (phc_...). It is the same public key PostHog puts in every web page. Personal API keys are refused on purpose.
Does it work with a self-hosted PostHog?
Yes. Pick "Self-hosted or reverse proxy" and enter the address. Instances older than capture v1 can use the legacy /batch/ mode.
What happens when a visitor declines cookies?
The browser stays opted out. If that visitor still orders, the order event is sent with a random ID and no person profile, so you keep the revenue count without the person.
Will an event be counted twice if PostHog times out?
No. A retry keeps the event UUID and the request ID, and PostHog keeps only the first copy of a UUID.
Is there a monthly fee?
No. You pay once. Your PostHog plan is between you and PostHog.
Compatibility
Odoo 19 Community and Enterprise. Needs eCommerce (website_sale) and Invoicing. Tested with recorded answers shaped from the public PostHog capture API documentation.
Questions before you buy?
Write to modvantaapps@gmail.com. We answer on working days, usually within one day.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• eCommerce (website_sale) • Discuss (mail) • Website (website) |
| Lines of code | 1182 |
| Technical Name |
mdv_posthog_connector |
| License | OPL-1 |
| Website | https://modvantaapps.tech |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module