Skip to main content
Solved

Why Platform and Country values not appear when using NodeJS SDK (NextJS)?

  • February 21, 2023
  • 5 replies
  • 456 views

Forum|alt.badge.img

Previously when I tested using Browser SDK the Platform and Country values are appear automatically. But when I try to implement using NodeJS SDK (I’m using Node Ampli Wrapper) the values was not appear. This also happens with Amplitude Event Explorer (Chrome Extension), it doesn’t work when using NodeJS SDK while using Browser SDK is works.

 

 

Best answer by Saish Redkar

Okay, looks like the NodeJS SDK won’t have the IP, platform options since it’s a server side SDK.

https://www.docs.developers.amplitude.com/data/sources/client-side-vs-server-side/#client-side-sources

 

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

5 replies

Saish Redkar
Expert
Forum|alt.badge.img+10
  • Expert
  • 1377 replies
  • February 21, 2023

Hi @tech-melaka 

Are you capturing the IP address on the events via the SDK? Country property won’t be resolved until there is a valid IP address.

You might want to check your trackingOptions in both the SDK initialization steps to see where’s the issue

https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/?h=setoptout#optional-tracking


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • February 21, 2023

I think that is setup for Browser SDK, and If I’m not mistaken setup for NodeJS SDK it was different as I saw in this references:
https://github.com/amplitude/ampli-examples/blob/main/node/nextjs/ampli-app/lib/init-ampli.ts


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • February 22, 2023
Saish Redkar wrote:

Hi @tech-melaka 

Are you capturing the IP address on the events via the SDK? Country property won’t be resolved until there is a valid IP address.

You might want to check your trackingOptions in both the SDK initialization steps to see where’s the issue

https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/?h=setoptout#optional-tracking

Thanks for the answer, in my case I’m using NodeJS Ampli Wrapper for NextJS. Currently due to the NodeJS implementation, there is no browser optional tracking properties. Do I need Browser SDK as well to get the default value?


Saish Redkar
Expert
Forum|alt.badge.img+10
  • Expert
  • 1377 replies
  • Answer
  • February 22, 2023

Okay, looks like the NodeJS SDK won’t have the IP, platform options since it’s a server side SDK.

https://www.docs.developers.amplitude.com/data/sources/client-side-vs-server-side/#client-side-sources

 


Forum|alt.badge.img
  • Author
  • Novice
  • 4 replies
  • February 23, 2023

Resolved. If others come across the same issue, you can use Ampli Wrapper but using Browser SDK. I already try and it works https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/ampli/


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