How to capture a visitor's country in a form?


I’m curious. How to capture a visitor’s country in a form (when the visitor fills a form)? Thanks.


Hey Adrien!

You can use geotargeting to display a visitors location a page using one of our Tips and Scripts here. Let me know if that helps you achieve that functionality!


Custom drop down?


Thanks @Jess. I’ve added a comment over there.


@Alex_Scovell, hi. I wanted a script behind the scene so I do not have to ask the visitor for the information.


@Adrien very slow reply!

This one passes IP address into a hidden form field called ‘IPadd’

<script type="text/javascript">
  $.get("", function(response) {
}, "jsonp");


And i just found this:

$.get(“”, function(response) {
}, “jsonp”);

I think if you try something like this (combining the two):

<script type="text/javascript">
      $.get("", function(response) {
    }, "jsonp");


(i just swapped country in in the place of IP)

It will probably work - you need to add a hidden form field called IPadd - or call it what you like and change this bit: $("#IPadd")