Passing IP Address & form data to URL


#1

Hi Everyone

I’m submitting data from a form to an external service via a URL. I also need to pass the users IP address through this form. Is this possible? If so how can I do this?


#2

Hi @tommyc325,

The easiest way would be to use the webhook feature of Unbounce. You can map the IP address and pass it along all the other information from the form.

Best,
Hristian


#3

Hey @tommyc325,

I’m trying to do the same thing. Has the WebHook worked for you?


#4

We used this a while back which did the trick (use at your own risk!):

<script type="text/javascript">
  
  $.get("https://ipinfo.io", function(response) {
    $("#IPadd").val(response.ip);
    //alert(response.ip);
}, "jsonp");

</script>

Add a hidden form field called ‘IPadd’ and this populates the IP into the form field (at least it did a year or two ago!).

Set the form to forward parameters in the URL - bingo