Skip to main content
Solved

While JS SDK contains user properties, when I send an event to the same user from http api, user properties do not appear in that event 

  • September 4, 2023
  • 3 replies
  • 319 views

While JS SDK contains user properties, when I send an event to the same user from http api, user properties do not appear in that event 

For example:
Country: null
City:null
DeviceType: null 
so no properties of the user are visible

Best answer by Saish Redkar

Hi @Furkan Kocatürk 

If you’re sending data via HTTP API instead of using an SDK, Amplitude cannot track these user properties automatically. You must instead set these properties explicitly in the HTTP API post request.

For Country and City properties, these are resolved from the IP address. If the IP address field is null, then they won’t be resolved.

You can read more on that here.

Hope this helps.

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

3 replies

Saish Redkar
Expert
Forum|alt.badge.img+10
  • Expert
  • 1382 replies
  • Answer
  • September 4, 2023

Hi @Furkan Kocatürk 

If you’re sending data via HTTP API instead of using an SDK, Amplitude cannot track these user properties automatically. You must instead set these properties explicitly in the HTTP API post request.

For Country and City properties, these are resolved from the IP address. If the IP address field is null, then they won’t be resolved.

You can read more on that here.

Hope this helps.


@Saish Redkar Thank you for your help, but why don't these other features show up? Why a deviceType user property set with JS SDK may not appear in the event sent from the backend to the same user later?


Saish Redkar
Expert
Forum|alt.badge.img+10

If the JS SDK has set the deviceType property on the user properties once, then that value should persist across all events unless explicitly changed. Can you verify if your HTTP API calls are overwriting the previously set value for device type?


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