Solved

How to track user login?

  • 24 February 2022
  • 1 reply
  • 91 views

Hi!

I want to be able to track when a user logs into the app as an event, but I’m not sure how to go about this?

Would it be best to implement it on the frontend or backend?

Thanks :)

icon

Best answer by tracy.guo 25 February 2022, 23:25

View original

1 reply

Userlevel 4
Badge +3

Hi @eriisu, thanks for your question!

Either option can work! If you’d like to send the Login event via one of our SDKs (e.g. JavaScript SDK), you can install that in your frontend. Here’s some documentation on logging events with JS SDK: https://developers.amplitude.com/docs/javascript#sending-events

If sending from the backend, you can use our HTTP API directly: https://developers.amplitude.com/docs/http-api-v2

Simply trigger the logEvent code or trigger the API call when the user completes the action.

Let us know if you have any questions!

Reply