Implement posthog_events submodule to track user actions

Created on 15 October 2024, 7 months ago

Problem/Motivation

See https://posthog.com/docs/libraries/php#capturing-events and https://posthog.com/docs/product-analytics/capture-events?tab=PHP to understand what we'd like to do.

The posthog_events submodule should subscribe (where possible, in other cases we'll probably need good old hooks...) to typical Drupal user actions.

For now:

  • Registration
  • Login
  • Logout

Maybe we should even put this into a further posthog_events_user submodule?
Because there might also be other cases to track. for example page access, which could similarly go into posthog_events_request

Late we could have posthog_events_webform and others...

Basically the module should track user actions server-side.

Another important thing the base module should offer is to also provide the Javscript-Part of Event tracking and connecting the backend session with the frontend session seamlessly so that Posthog knows it's the same user and other Drupal developers can simply use JS or PHP SDK without having to mess around with the identity themselves.

See https://posthog.com/docs/product-analytics/identify

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024