dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

Content Analytics: Allow all events to be recorded via the API #30626

Open john-thomas-dotcms opened 5 days ago

john-thomas-dotcms commented 5 days ago

Parent Issue

No response

User Story

As a headless app developer, I want to be able to record the same analytics events that dotCMS records natively, but send them from my headless app.

Right now, dotCMS automatically records certain types of events from within dotCMS. This includes events such as page URL hits, file URL hits, and URL Map hits. Future Content Analytics functionality, including reports and back-end displays, will be built to query for these specific, pre-defined events.

So, future queries to be able to report on headless app activity, headless apps need to be able to record the same events that the native dotCMS code records. We need an API which allows external apps to trigger recording of these pre-defined events.

Acceptance Criteria

  1. The new endpoint may be hit to record any existing analytics event.
    • This includes Page hits, File hits, URL Map hits, and Vanity URL hits.
  2. The new endpoint may be hit to record arbitrary event types.
    • So, for example, users may create their own user-defined event types, and record them via the endpoint.
  3. Events recorded via the new endpoint are distinguished from native events via a new analytics event property: Event Source.
    • For events recorded from native dotCMS code, this value should automatically be set to the class name of the analytics collector.
    • For events recorded via the new endpoint, this value should automatically be set to the API path (e.g. /api/v1/analytics/endpointName).

Proposed Objective

Technical User Experience

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

bryanboza commented 3 days ago

Ideally, we need to find a way to generate Postman tests for those endpoints, ensuring we provide a structured instance to run the tests.