In the Form Designer, you can add a URL Parameter type Single Input field to pull URL Parameters into your Form. This can enable various functionality, such as: contextually redirecting to different URLs, adding parameters to redirect URLs, parameter-based Form logic and validation expressions, dynamically setting the Form Title, dynamic image visibility, and more.
General Setup
Add one or more URL Parameter type Single Input fields to your Form:
The new URL Parameter fields will have field names beginning with "clk_". You can modify the field name, but the "clk_" prefix is required and cannot be removed.
URL Parameter fields are hidden and will not be visible on the Form.
Now that the URL Parameter field is in your Form, it can be populated by specifying the value within the URL or embed code. For example:
- Specify the URL Parameter field values in the direct Form URL:
https://youraccount.clickdimensions.com/clickdimensionscom-akpfs/pages/gltzkydjefgrdncopzupsg.html?PageId=[PageID]&clk_single_input1=customUrlParameterValue
In the example above, note that the URL Parameter's field name is highlighted in yellow, and the custom parameter value is in green. Opening the Form using the URL above will populate the URL Parameter field with Field Name "clk_single_input1" with the value "customURLParameterValue".
- Specify the URL Parameter field values in the iFrame embed code's src URL:
<iframe src="https://youraccount.clickdimensions.com/clickdimensionscom-akpfs/pages/gltzkydjefgrdncopzupsg.html?clk_single_input1=customURLParameterValue" allowtransparency="true" width="100%" height="500px" type="text/html" frameborder="0" style="border:0"></iframe>
In the example above, note that the URL Parameter's field name is highlighted in yellow, and the custom parameter value is in green. Opening a web page containing Form iFrame embed code configured in this way will populate the URL Parameter field with Field Name "clk_single_input1" with the value "customURLParameterValue".
- Specify the URL Parameter field values in the widget embed code. This one takes a bit more modification than the iFrame and URL approaches. Your original, unmodified widget embed code will look something like this:
<script type="text/javascript">var loc = "https://yourAccount.clickdimensions.com/clickdimensionscom-akpfs/pages/";var cdSurveyCdn = "https://cdn-preprod.clickdimensions.com/web/newformeditor/";</script>
<script type="text/javascript" src="https://cdn-preprod.clickdimensions.com/web/newformeditor/CDWidget.js"></script>
<div pageID="gltzkydjefgrdncopzupsg"></div>
To specify the URL Parameter field values in the widget embed code, you must modify it by adding an additional script (blue), and modifying it with the Page ID from your original widget embed script (pink) and with URL Parameter field names (yellow) and values (green), as shown below:
<script type="text/javascript">var loc = "https://webanalyticspreprod.clickdimensions.com/clickdimensionscom-akpfs/pages/";var cdSurveyCdn = "https://cdn-preprod.clickdimensions.com/web/newformeditor/";</script>
<script type="text/javascript" src="https://cdn-preprod.clickdimensions.com/web/newformeditor/CDWidget.js"></script>
<div pageID="gltzkydjefgrdncopzupsg"></div>
<script type="application/json" data-cd-widget-config>
{
"pageId": "gltzkydjefgrdncopzupsg",
"urlParams": {
"clk_single_input1": "customURLParameterValue",
"clk_single_input2":"customURLParameterValue2"
}
}
</script>
Opening a web page containing the a widget script that has been expanded as shown above will populate the URL Parameter fields with field names "clk_single_input1" and "clk_single_input2" with the values "customURLParameterValue" and "customURLParameterValue2" respectively.
Use Cases
Once the value is populated in your Form, it can used for various purposes to suit your specific needs:
- Contextually redirect a single Form to different URLs
- Populate a redirect URL with contextually-dependent URL parameters
- Form logic utilizing URL Parameter values
- Validation expressions utilizing URL Parameter values
- Dynamic Form Titles and Text
- Dynamic image visibility
- And more: get creative!