Extract cookie variables and populate hidden fields

Hello all,

I have looked through the forum and cannot find a thread related to this subject…well atleast I think so. Apologies if there is already.

I would like to know if it’s possible to extract a couple variables form the cookie, such as the source, keyword and campaign and populate those hidden fields within a form so that when the form is submitted it goes into my cms system.

I am not proficient in javascript at all and would like to know if it is possible and how would I go about doing it.

I did however come across this on another forum but I dont understand it completely. Is this the correct thing to do?

Using Async, you can do as follows

_paq.push([‘setCustomVariable’,‘1’,‘TEST’,‘VALUE’]);
_paq.push([ function() {
value = this.getCustomVariable(1);
alert(value);
}]);

Thank you in advance