logEvent is undefined


I am trying to log an event using userID, but unfortunately it was throwing an error saying that logEvent was undefined. Below is the code I am using


amplitude.getInstance().setUserId(email).logEvent('Event Clicked',{
'App Name' : app_name
Note: Doing this in React JS

2 replies

Userlevel 4
Badge +3

hi @hvskrishnakanth  to set a user ID you would need to do the following: 




Link to dev docs here:


Please let me know if this helped.


Thanks for your reply @daniel.balan.

I want to send userid dynamically(the user email id). And if I use the syntax Amplitude.getInstance().setUserId("test_user_id"); how can I pass the event properties?