AnsweredAssumed Answered

Capturing UTM Data With Cookies Through JavaScript, need help editing code

Question asked by 35309 on Jul 19, 2013
Latest reply on Jul 23, 2013 by ac0c216149a8ba6fc529f422b1687a004946de0d

I"m a little confused, if we are trying to capture the following:

utm_campaign
utm_source
utm_content
utm_medium
utm_term


We want to edit the following code:

// Get the values from the cookies and put them into the hidden fields
  $jQ(searchStringField).attr("value",$jQ.cookie('mktoSearchString'));
  $jQ(searchEngineField).attr("value",$jQ.cookie('mktoSearchEngine'));
  $jQ(payPerClickKeywordField).attr("value",$jQ.cookie('mktoPPCKeyword'));


But what should we change this to? What the field values are and then do this for each form field we want to capture like this?

// Get the values from the cookies and put them into the hidden fields
  $jQ(sourceField).attr("value",$jQ.cookie('utm_source_c'));
 
and then repeat this for each of the form fields? or just edit the fields specified in the code (ppc keyword, search engine string and search engine)? And what if we are not capturing Search Engine String or Search Engine should we still keep the code as is?

Thank you very much!!!

Outcomes