Update subscriber attribute's IP address

  • 29 April 2024
  • 3 replies

Badge +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 (, 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!


This post has been closed for comments

3 replies

Userlevel 1
Badge +3

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.

Badge +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?

Userlevel 1
Badge +3

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.