Look-up for a User based on IP address through the API

  • 22 December 2021
  • 4 replies
  • 681 views

Badge

Hello everyone!

I'm currently trying to merge an identified user (e.g. User ID: 123) with an anonymous one, tracked through different applications and domains. If I know the User ID of the identified one and the Device ID of the anonymous one, we have a way to merge these two through the Identification API

However, the most reliable information I have is the IP address from the anonymous user. Is there an endpoint where I can lookup for all users that have the given IP address?

I know we can do that through the UI, but couldn't find any endpoint via API REST
___

Additional Context

We're currently working in an application that integrates with Shopify. We're using Amplitude to track the journeys the customers of our brands have on their websites, from adding products to cart until they finish the checkout process

However, given we can't control the steps that go through Shopify, we added most of the identification steps through the browser. But at specific moments, the customers close the connection to the page before our script is loaded

We want to have a robust system that fallbacks to the Shopify information instead, so that's why we want the additional step of identifying customers in the background


4 replies

Userlevel 5
Badge +5

Hi @Lucas P Bordignon,

This is Yuanyuan from the Amplitude Support team - thank you for writing this post and apologies for the late reply!

I do not believe we have a particular endpoint where you can lookup for all users that have the given IP address. 

Theoretically, if an identified user (e.g. User ID: 123) and an anonymous user share the the same Device ID, they will be merged by Amplitude. Also, Amplitude does not merge users based on the IP addresses. Are you trying to merge users outside of Amplitude based on their IP addresses?  Why do you believe the most reliable information is the IP address from the anonymous user? If the IP address is collected for the anonymous users by Amplitude, then the Device ID must be also collected during the process. 

Would you mind expanding on what you mean by the ‘endpoint’ and elaborating a little further on what you want to do with the IP addresses?

Looking forward to hearing back from you!
Best,

 

Badge

Hey  @Yuanyuan Zhang!

Thank you for the reply and happy new year!

The plan of using IP addresses as the main identification point was given as we don't have the customer's Device ID when sending events via our servers.

So we generate events through the client-side, where we have the customer's Device ID, IP address, etc. and also generates events through the server-side, where we don't have the Device information, but we know the IP address from that customer (sent via Shopify) and the User ID we'll use to identify the user.

The idea is to use that IP address to find the known Device ID and match both client-side and server-side events for the same customer.

Oh, and by endpoint I mean an action from one of Amplitude's APIs that we could use to programatically make that search.

Best,
Lucas

Userlevel 5
Badge +5

Hey @Lucas P Bordignon

Thanks for the detailed explanation. 

I understand you main goal now is to export IP addresses along with the Device IDs from Amplitude, and then use this data to do user matching/merging outside of Amplitude, correct? 

Have you tried to group by the events by ‘IP address’ in the event segmentation chart and then use our Dashboard REST API for exporting data?

Regards,

Userlevel 6
Badge +9

Hi @Lucas P Bordignon I hope all is well. I noticed that there are still some open questions here and I wanted to check in. Were you able to make progress? Keep us posted if you need anything. 😀

Reply