Hey,
I need some help or guidance with the form Im implementing accross the website, I’ve made a custom form and Im populating the fields via ajax.
It seems that all form fields are populated and all works good except, I cant manage to track the users Original Source to see his browser history (Contact Created+Page View).
Im trying to get all field via front end only with jquery!
var form = $(this);
var data = $(this).serializeArray();
var url = form.attr('action');
var hubsptCookie = getNewCookie('hubspotutk');
data.push(
{"hs_context":
{
"hutk": hubsptCookie,"pageUri": window.location.href,"pageName": document.title
}});
console.log(data);
$.ajax({
type: "POST",
url: url,
data: $.param(data), // serializes the form's elements.
success: function(data) {
}
});
Can any one help? Need to know what Im missing or doing wrong!
Im getting: This contact was created from Direct Traffic from Unknown URL
in original source

