Solved

User IP and country is inconsistent

  • 13 December 2021
  • 5 replies
  • 428 views

Userlevel 1
Badge +2

Hi, guys!
This question is for amplitude integration.
 

We made the following changes at same time:
1.Change Amplitude SDK to Segment SDK
2.Change Amplitude(Actions) to Amplitude cloud-mode

 

Found the following problems;
Inconsistent userip before and after. This is by no means a single event, Nearly half of the user ip changed.This leads to a change in the user’s country information.

 

For example:(Changes started on November 5)

ip:   before is “115.164.42.244” / after is ”10.85.199.68”

country: before is “Malaysia” / after is “United Kingdom”

 

I want to know the following answer:

1.Is the country different due to ip?

2.How to get ip(Amplitude SDK / Segment SDK)?

3.Is this caused by the SDK?

4.Do i have a way to solve this problem?

 

 

 

 

icon

Best answer by Denis Holmes 14 December 2021, 12:21

View original

5 replies

Userlevel 1
Badge +2

@belinda.chiu 

Hi, Belinda !

I see that you are a senior expert in this field, can you help me solve this problem?

Thank you very much

Userlevel 6
Badge +8

Hi @xiaomeng.zhang ,

 

Thanks for writing in! Taking over this ticket as Belinda is in a different timezone :)

 

We made the following changes at same time:
1.Change Amplitude SDK to Segment SDK
2.Change Amplitude(Actions) to Amplitude cloud-mode

Found the following problems;
Inconsistent userip before and after. This is by no means a single event, Nearly half of the user ip changed.This leads to a change in the user’s country information.

 

So what I believe has happened is when you switched to the Segment SDK and the Amplitude cloud-mode, the IP Address being used from the Amplitude SDK was changed, probably due to the Segment SDK getting a different IP Address to the Amplitude one, hence a change of location as well as Amplitude uses MaxMInd’s GeoIP Service to get the location. Have you spoke with Segment about this and how they are getting the IP Address for their SDK? I do not believe switching to cloud-mode would make much of a difference unless Segment require you to send certain variables in the payload. 

I want to know the following answer:

1.Is the country different due to ip?

Yes, the country would be from a different IP Address, presumably from the Segment SDK. This might also help!

2.How to get ip(Amplitude SDK / Segment SDK)?

The IP Address is tracked automatically by Amplitude through the JS SDK 

3.Is this caused by the SDK?

I believe Segments SDK is getting a different IP Address and sending it to us, which we then look up in MaxMind and get the corresponding country. 

4.Do i have a way to solve this problem

You could switch back to the Amplitude SDK or alternatively, I would reach out to Segment and see if there’s a way to stop using the new IP Addresses or if you can include something in their data payload manually so that it will not change country.

 

I hope this helps! Let me know if you need any more assistance from Amplitude’s side!

 

Userlevel 1
Badge +2

Hi, @Denis Holmes 

Thank you, you are such a enthusiastic friend.

I will go back to contact the segment, if there is progress, I will let you know !

Userlevel 6
Badge +8

Hahah my pleasure @xiaomeng.zhang ! :) When you do reach out to Segment and if there is anything you need help with, you can tag me here or PM me and I will jump right in to help! 

In the meantime, have a great week and best of luck with Segment :) Here if you need us! 

This reply might be late but we had the same issue and after testing many things, we discovered that the region of the segment source was set to Sydney, once we changed that to Oregon, the ip addressed started to come up correctly in amplitude. I hope this helps.
Perhaps segment has different versions of the api depending on the region.

Reply