Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you track the IP Address? #672

Closed
valgen opened this issue Feb 29, 2024 · 3 comments
Closed

How do you track the IP Address? #672

valgen opened this issue Feb 29, 2024 · 3 comments
Labels
question Further information is requested

Comments

@valgen
Copy link

valgen commented Feb 29, 2024

Hi there,

Do you actually take into account X-Forwarded-For when trackingOptions ipAddress is set to true?

amplitude.init(AMPLITUDE_API_KEY, { trackingOptions: { ipAddress: true } });

If not, please can you tell me how to do so using the JS SDK?
https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking

@valgen valgen added the question Further information is requested label Feb 29, 2024
@izaaz
Copy link
Contributor

izaaz commented Mar 1, 2024

@valgen - yes, we get the source ip address on the server side. When the ipAddress tracking option is set to false, we discard the ip address on the server side and don't convert it to city/country properties.

@valgen
Copy link
Author

valgen commented Mar 1, 2024

@izaaz Can you be more specific and tell me if you actually use X-Forwarded-For to make your best-effort attempt to discover the originating IP?

@izaaz
Copy link
Contributor

izaaz commented Mar 1, 2024

Yes @valgen - yes, that header gets used to determine the origin ip.

@izaaz izaaz closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants