Skip to main content
Solved

logEvent is undefined


Forum|alt.badge.img

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

Best answer by Amplitude Admin

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

 

Amplitude.getInstance().setUserId("test_user_id"); 

 

Link to dev docs here:

https://developers.amplitude.com/docs/react-native-setup#set-custom-user-id

 

Please let me know if this helped.

View original
Did this topic help you find an answer to your question?

Amplitude Admin
Community Manager
Forum|alt.badge.img+9

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

 

Amplitude.getInstance().setUserId("test_user_id"); 

 

Link to dev docs here:

https://developers.amplitude.com/docs/react-native-setup#set-custom-user-id

 

Please let me know if this helped.


Forum|alt.badge.img

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?


Jeremie Gluckman
Team Member
Forum|alt.badge.img+9

Hi @hvskrishnakanth I hope all is well. I wanted to circle back. Were you able to make progress? Were here to help if you have any additional questions. 😃


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings