Solved

Event not getting recorded; continously showing Listening

  • 1 November 2021
  • 2 replies
  • 222 views

I am using standard node.js sdk to log an event with the following code:

// ES5 Syntax
const Amplitude = require('@amplitude/node');
// ES6 Syntax
import * as Amplitude from '@amplitude/node';

var client = Amplitude.init(<AMPLITUDE_API_KEY>);
client.logEvent({
event_type: 'Node.js Event',
user_id: 'datamonster@gmail.com',
location_lat: 37.77,
location_lng: -122.39,
ip: '127.0.0.1',
event_properties: {
keyString: 'valueString',
keyInt: 11,
keyBool: true
}
});

// Send any events that are currently queued for sending.
// Will automatically happen on the next event loop.
client.flush();

but though my code is already executed, it still showing listening. can some body help me out with this.

icon

Best answer by Saish Redkar 2 November 2021, 05:01

View original

2 replies

Userlevel 7
Badge +10

I think @Denis Holmes might help you on this one.

 

Userlevel 4
Badge +3

Hi @avijit_blotout! My understanding is that you’re trying to send your first event to your new Amplitude project but are not seeing the events appear.

To cover some bases, could you confirm that you’ve replaced <AMPLITUDE_API_KEY> with your project’s API key? 

Additionally, when sending the event to Amplitude, are you getting a 200 response?

Thanks!

Reply