DEV Community

Zex
Zex

Posted on • Edited on

1

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

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay