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.
Step 1: Create a custom field to hold the IP address
Go to Admin > Settings
Click on the “Go” button to modify the Contact custom fields
Now add the custom field
- Click the “Add” button for a field
- Type in “IPaddress”
- Set the field type to “Text”
- 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
Add a “Hidden” Field Snippet to your form
Select the “IPaddress” field and click the “Save” button
Step 3: Lookup the Form Field ID and edit the code to work with your form
Right click and select “View Page Source” (Chrome)
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!
Add your IPaddress form field id to this code.
document.getElementById(‘***YOUR-FORM-FIELD-ID-GOES-HERE***‘).value = userip;
document.getElementById(‘_IPaddress‘).value = userip;
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
After you release your mouse, paste the code with your form ID
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
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.