1. Create a Custom Entity Field:
a. Navigate to Customization > Lists, Records, & Fields > Entity Fields > New.
b. Name the field as Lead IP Address.
c. Set Type to Free-Form Text.
d. Set Store Value to True.
e. At the Applies to tab, check the Customer and the Web Site box.
f. At the Display tab, change the Display type to Normal.
g. Click Save.
2. Add the script to the Web Site Theme:
a. Navigate to Setup > Site Builder > Set Up Web Site > Appearance tab.
b. Take note of the Web Site Theme
c. Navigate to Setup > Site Builder > Themes
d. Edit the applied theme, click the Body tab
e. Add the script in the Footer Template field
f. Click Save.
3. Go to the Web Store and register as a new customer. View the Lead record created and notice that the IP address is tracked under the Custom Tab > Lead IP address entity field.
- In this example custentity10 is the Internal ID of the custom entity field added from Step 1. Please change this with the corresponding Internal ID of the field that you created.
- This workaround will capture the Lead IP address the moment the buyer registers on the Web Store, regardless if they proceeded all the way to checkout and submit an order, or if they abandoned the cart and logged out.