DEV Community

Zex
Zex

Posted on • Updated on

Brainstorm: Some Thoughts About User Behavior Tracking

👉Remain on high level
👉No specific tools/frameworks included

Why it matters👈

  • Understand your users better
  • Narrow the gap between how you expect user to use and how user actually use it
  • Marketing data analytics

How to do it👇

On client side

  • Sync, send and wait
  • Async, send and go
  • Send in business components
  • Send in a separate service
  • Keep a local cache for unsent events for resend later
  • Local cache size limitation
  • API call timeout/failure handling

On server side

  • Log collection, centralize all log from all backend servers
  • Generate an event based on predefined event data structure on request
  • Direct to database
  • Publish over message queue

Employ a third-party service

  • Direct request
  • Integrate SDK
  • Shared database/separate database

Data definition☝️

Event

  • EventType, what happened
  • CreatedAt, when did it happen
  • Source, where did it happen
  • Payload, who/what was involved

Result

  • StatusCode
  • StatusMessage

API🌻

create

Create(Event) Result

Top comments (0)