我正在从另一个尚未完全完成的开发人员那里接手一个项目,我试图弄清楚为什么要记录源和媒体而不是关键字。媒体和来源显示在 url 中并作为表单中的隐藏字段显示,但关键字不是。这是我相信我打算做的代码的一部分。
//parse the cookies
var source = _uGC(z, 'utmcsr=', '|');
var medium = _uGC(z, 'utmcmd=', '|');
var term = _uGC(z, 'utmctr=', '|');
// Populate form fields
$( document ).ready(function() {
$("#Field113").attr("value", source);
$("#Field115").attr("value", medium);
// If there's a "SearchKeyword" URL param, use it for the 'term'
var SearchKeyword = (location.search.split('SearchKeyword=')[1]||'').split('&')[0];
if ( (SearchKeyword && !term) || (SearchKeyword && term == "") ) {
$("#Field126").attr("value", term);
}
});