amplitude / Amplitude-Node

Server-side Node.js SDK for Amplitude
MIT License
67 stars 20 forks source link

How to track revenue? #181

Closed alexblack closed 2 years ago

alexblack commented 2 years ago

I'm looking to track revenue to Amplitude, so that it shows up in reports of type Revenue LTV. I read here: https://help.amplitude.com/hc/en-us/articles/115003116888-Track-revenue

Do we simply need to specify these properties in logEvent? like this:

amplitude.logEvent({ 
  user_id,
  revenue: 100,
});

When I do this I do see the $revenue property on the event in amplitude, but i see $0 revenue in the Revenue LTV report

yuhao900914 commented 2 years ago

Hi @alexblack, The event_types is required in the logEvent. And the event_type for revenue is ``. Can you try

amplitude.logEvent({ 
 event_type:  "revenue_amount"
  user_id,
  revenue: 100,
});
alexblack commented 2 years ago

Thanks for the response. It turns out it was working fine, I just had the wrong expectations about how/when it'd show up in Amplitude.

(I was setting event_type, I had left it out of the code snippet)

On Wed, Oct 19, 2022 at 1:19 PM, Alyssa Yu @.***> wrote:

Hi @alexblack https://github.com/alexblack, The event_types is required in the logEvent. And the event_type for revenue is ``. Can you try

amplitude.logEvent({ event_type: "revenue_amount" user_id, revenue: 100, });

— Reply to this email directly, view it on GitHub https://github.com/amplitude/Amplitude-Node/issues/181#issuecomment-1284526696, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABELQRDKSF2IDNV5QGMDE3WEBJTRANCNFSM6AAAAAAQ65LV6A . You are receiving this because you were mentioned.Message ID: @.***>

yuhao900914 commented 2 years ago

Closing this issue since it works fine. Feel free to re-open or create another issue if you need other help. Thanks.