-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing device Id upon initialization #36
Comments
👋 hello @clarencedesmarais! I think this would be a good idea - but I think it might help to not stop at |
Yes, I agree with allowing more parameters within the I think the parameter format for the I would like to be able to pass Our use case is one where we actually don't track users or any device. We just want to send events from a backend to amplitude. I've seen this method too : https://amplitude.github.io/Amplitude-JavaScript/#amplitudeclientsetdeviceid If we don't track our users, would it make sense to name the deviceId simply the name of the backend that sends those events ? Thanks. |
Hi @clarencedesmarais ! Apologies for the late response. To start, What happens if I log an event in Amplitude without a device ID?We'll attach a UUID as the device ID - so there's no worry that there's no device ID
it's not very well documented and a general thing we're tackling right now to improve our docs - you can pass it in in the options actually:
This is specific for the use case for the JS SDK, which is specific to client-side implementations. It's really important for client SDK's to keep track of a user's identity so that they can be connected in user streams within amplitude - for ex. if I started logging at We will likely add this as an option soon of making it easier to add fields/device id in the node SDK! Let me know if I missed anything/should clarify anything above |
Hello @kelvin-lu, sorry for the annoyance. I'm struggling as well with the combination of client.logEvent({
event_type: "Web:Server:Some:Event",
user_id: uid,
event_properties: {
// some properties here
}
}); What will happen in the case How can I update the previous code to ensure Amplitude logs the event, even if the user making the request is unknown? |
Summary
Hey,
We are currently using the node SDK for amplitude in one of our backends. It seems that in order to log an event to amplitude, the device id or user id is required as specified here:
https://developers.amplitude.com/docs/http-api-v2#properties-1
Currently our backend does not track our users. We wanted to pass a variable for the device_id such as :
service_server
which would just be the name of our backend.Motivations
This would allow us to avoid passing the deviceId every time we want to log an event, which is not ideal since it is always the same anyways.
Don't hesitate to let me know if there is a better way of doing this. I'm new to using amplitude :)
The text was updated successfully, but these errors were encountered: