ClickDimensions POST ForwardingPro
Freeform's POST Forwarding feature allows you to integrate your forms with ClickDimensions for Microsoft Dynamics.
This guide assumes you are familiar with ClickDimensions. We cannot provide any assistance with setting this up, aside from the basics.
Setup Instructions
1
- Go into your form inside the Freeform form builder interface, and under the Form Settings tab, scroll to the very bottom.
- In the POST Forwarding setting, add your custom action URL there. Freeform will make an extra POST submit to that URL once it has successfully validated the form submission, etc.
- In the POST Forwarding Error Trigger setting, enter a value like
error
(assuming the error page contains that word, and success wouldn't). When Freeform detects that word (or phrase) in the success/error page from the custom ClickDimensions POST URL, it'll assume it's an error and then log the error(s) to the Freeform error log.
2
Add the ClickDimensions script, and then add this AFTER it:
var match = document.cookie.match(new RegExp('(^| )cuvid=([^;]+)'));
if (match) {
var cuvid = match[2];
document.querySelector('input[name=cd_visitorkey]').value = cuvid;
}
Include any additional fields as hidden fields inside Freeform, such as:
- A field with handle
cd_visitorkey
and the key as the value. - A field with handle
form_friendly_id
and an applicable value, e.g.ContactUs
.
3
Be sure to name/rename all Freeform field handles to match the ClickDimensions field names, e.g. txtFirstName
, etc.
Finished!