Are You An Options Trader?

Learn how to

  • Reduce Risk

  • Create Monthly Income from Option Trading

  • Get Access to Free webinars and training

  • Just enter your information below and click "Get Updates!"

Get Tom's updates and a free account at Capital Discussions.

December 15, 2015

How to Capture IP Address in an Infusionsoft Hosted Web Form

Infusionsoft is an amazing platform, but it has occasional roadblocks to doing certain things. One of these little things is capturing a visitor’s IP address on an Infusionsoft hosted web form.

I think this should be baked into the application. However, we have the ability to work around it using Javascript. Thanks to a service at http://l2.io/ this procedure is pretty straightforward.

Step 1: Create a custom field to hold the IP address

Go to Admin > Settings

Admin > Settings Image

Click on the “Go” button to modify the Contact custom fields

Custom Fields Contact Image


Now add the custom field

Add Custom Field Image

  1. Click the “Add” button for a field
  2. Type in “IPaddress”
  3. Set the field type to “Text”
  4. Click the “Save this Field” button
 

Step 2: Edit the Web Form in Campaign Builder

Double Click on the Web Form Icon to edit the form
Open Web Form Image

 

Add a “Hidden” Field Snippet to your form
Drag hidden field snippet to form image

 

Select the “IPaddress” field and click the “Save” button
2015-12-15_11-08-02

 

Step 3: Lookup the Form Field ID and edit the code to work with your form

Look on the “Code” tab and load the hosted web form. We need to find the form field id to target it with Javascript.
Open Hosted Web Form Image

 

Right click and select “View Page Source” (Chrome)
View Page Source Image

 

Search for “IPaddress” to find the form field’s id.
– Save this id value.
– Note the underscore in front of it.
  – The id is case sensitive!

Form id for ipaddress field image

Add your IPaddress form field id to this code. 

<script type=”text/javascript”>var userip;</script>
<script type=”text/javascript” src=”https://l2.io/ip.js?var=userip”></script>
<script type=”text/javascript”>
document.getElementById(‘***YOUR-FORM-FIELD-ID-GOES-HERE***‘).value = userip;
</script>

For example:

<script type=”text/javascript”>var userip;</script>
<script type=”text/javascript” src=”https://l2.io/ip.js?var=userip”></script>
<script type=”text/javascript”>
document.getElementById(‘_IPaddress‘).value = userip;
</script>

NOTE: This is case sensitive and you MUST include the leading underscore!!

 

Step 4: Insert your code in the Web Form


Go back to your Infusionsoft Web Form and add an HTML Snippet to your form

HTML snippet Image

 

After you release your mouse, paste the code with your form ID
Paste your code in image

 

Step 5: Publish the form and test that it works

Publish your campaign, then reload the form, submit it and check that the contact record has the IP address field populated
IP address recorded in contact record image

 

That’s it!

I used this same idea to capture IP address data in a clickfunnels form that submits to Infusionsoft.

After you have the contact’s IP address, you can lookup the location at http://whatismyipaddress.com/

I still wish Infusionsoft had a built in way to add IP address to a form field, but until they do, we have a workaround.

Join our Free Option Trading Community

Tom Nunamaker

Click Here to Leave a Comment Below

Leave a Reply: