Whether we want to plug directly into a third party (like Plausible) or build our own analytics solution (using open-source DBs and API frameworks), we need some pipeline to wrangle the events from the frontend to a format acceptable to the service.
Description
In the interest of avoiding vendor lock-in, we can put a thin layer between the frontend and the analytics service, which will receive events from the frontend and will appropriately wrangle and forward them to the right service.
This can be any of the following:
a separate microservice
an API endpoint
a Nuxt server middleware
a Nuxt server route
Alternatives
Building a decoupled backend sounds great but in reality, choosing a platform early on makes the most sense as it avoids us having to build our middle layer and we can use native SDKs from the platform to directly ship data to the service.
Problem
Whether we want to plug directly into a third party (like Plausible) or build our own analytics solution (using open-source DBs and API frameworks), we need some pipeline to wrangle the events from the frontend to a format acceptable to the service.
Description
In the interest of avoiding vendor lock-in, we can put a thin layer between the frontend and the analytics service, which will receive events from the frontend and will appropriately wrangle and forward them to the right service.
This can be any of the following:
Alternatives
Building a decoupled backend sounds great but in reality, choosing a platform early on makes the most sense as it avoids us having to build our middle layer and we can use native SDKs from the platform to directly ship data to the service.
Additional context
RFC: https://github.com/WordPress/openverse/blob/3fa9f03937d2af356535f158f7f80b20a6bd79d2/rfcs/analytics/20221006-implementation_plan_frontend.md