I am trying to inject a UTM parameter into our contact form. The contact form we are using is powered by FreshSales CRM and allows user to add hidden fields which should allow this to work.
The Parameters I want to pass are "Source, Medium and Campaign" and the UTM would look as follows:
?utm_source=google&utm_medium=cpc&utm_campaign=Conversion
I found the below code in a resource, does this need to be defined for each parameter or will this pull the entire UTM?
beforeSubmit: function()
{
console.log("Before submit hook triggered.");
WebForm.$('<input>').attr({
type: 'hidden',
name: 'lead[custom_field][cf_utm_param]',
value: getQueryVariable('utm_param')
}).appendTo('.fs-webform-container form');
}
Any help would be very much appreciated. Thanks!