Skip to main content
Question

Update subscriber attribute's IP address


Forum|alt.badge.img+4

Hi! We’re trying to get the subscriber’s IP Address & Country Code more frequently from the rev cat webhook and had a few questions around that. Looking at the docs (https://www.revenuecat.com/docs/customers/customer-attributes), it looks like we can update either `$ipAddress` or an `$ip` property.

  1. Which one of these properties would actually show up in the subscriber attributes section of a webhook request?
  2. Does it accept IPv6 or does it only accept IPv4 formats?
  3. I read in another doc that country code is automatically pulled from the IP. Which one of those properties is looked at when calculating the country code?

Thanks for the help!

Best,
Kevin

This post has been closed for comments

3 replies

jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 139 replies
  • May 1, 2024

Hi @Kevin Bunarjo! I’d recommend depending on the $ip property. I dug in, and $ipAddress was previously known as $lastSeenIP, and we are still setting $ipAddress with the $lastSeenIp. Similarly, country code is first taken from the store/device’s settings, and only uses the IP when the country was not initially set.

You’re good to go with IPv6 addresses! Let me know if I can help with anything else.


Forum|alt.badge.img+4

Thanks for the answer @jeffrey_bunn ! Could you clarify which property you’d recommend updating? Is it the `$ip` property? Or do you recommend updating both?


jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 139 replies
  • May 2, 2024

Happy to help, @Kevin Bunarjo! Generally we recommend setting $ip, though it’s important to note that once this is set, it can't be changed in order to keep these identifiers associated with the original installation. You can grab this (as well as your other customer attributes) from the `subscriber_attributes` map in webhooks.


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