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 

  • 4 September 2023
  • 3 replies
  • 118 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

icon

Best answer by Saish Redkar 4 September 2023, 11:22

View original

3 replies

Userlevel 7
Badge +10

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?

Userlevel 7
Badge +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