SharpSpring allows you to pass the URL of the submission page a SharpSpring form into a custom field. This is helpful when you have a single SharpSpring form that is embedded on multiple pages of your website. The URL can be used to trigger specific actions, add leads to lists, assign a campaign, and more. This article will detail how to capture page URLs with form submissions.
|
Available with: | ||||
Marketing Automation | ✓ | ||||
CRM Ultimate | ✓ | ||||
CRM PRO | ✓ | ||||
CRM Free | ✓ | ||||
Toolbar: | |||||
![]() ![]() |
|||||
Users: | |||||
Administrators | ✓ | ||||
Company Managers | ✓ | ||||
Marketing Managers | ✓ | ||||
Sales Managers | |||||
Salespersons | |||||
Jr. Salespersons | |||||
Obtaining Custom Field IDs
Forms will need custom field IDs to be able to capture. To obtain custom field IDs for form capture, do the following:
|
Configuring Forms
Your forms can be set to capture page URLs. To create and configure a form to capture page URLs, do the following:
When the form is submitted, you will see the URL of the page within the custom field in SharpSpring. |
||
Note: SharpSpring offers Professional Services to assist with custom coding.
|
||
Note: The
var url code declares a variable that stores the page URL. The ss_form code sends that variable into a custom field in SharpSpring. |
||
Code Examples
The following is an example of form embed code prior to edits:
<!-- SharpSpring Form for URL -->
<script type="text/javascript">
var ss_form = {'account': 'WzVzIKNeEPMzGiG', 'formID': 'CiLvIO12Z3MEGGLDWpIKcb33l3mBiESLiwbHDeiHKW8i3eiS'};
ss_form.width = '100%';
ss_form.domain = 'app-xx11xx11xx.marketingautomation.services';
</script>
<script type="text/javascript" src="https://koi-3QKH0X1U88.marketingautomation.services/client/form.js?ver=1.1.1"></script>
The following is an example of form embed code after edits:
<!-- SharpSpring Form for URL -->
<script type="text/javascript">
var url = document.location.href; <!-- Line 1 -->
var ss_form = {'account': 'WzVzIKNeEPMzGiG', 'formID': 'CiLvIO12Z3MEGGLDWpIKcb33l3mBiESLiwbHDeiHKW8i3eiS'};
ss_form.width = '100%';
ss_form.domain = 'app-xx11xx11xx.marketingautomation.services';
ss_form.hidden = {'field_xXxXxXxXxX': url}; <!-- Line 2 -->
</script>
<script type="text/javascript" src="https://koi-3QKH0X1U88.marketingautomation.services/client/form.js?ver=1.1.1"></script>