我正在使用带有联系表单7 插件的Wordpress。每当用户提交表单时,该人员将被重定向到感谢页面,该页面是包含联盟会员跟踪代码(javascript)的静态页面。由于跟踪代码始终相同,我无法跟踪用户。每当有人提交表单时,我想知道如何在静态感谢页面中更改跟踪代码。
这是代码(你可以看到每次我想成为随机数的“电视”)。我们试图从URL捕获变量但我们总是得到的是联盟工具中的“远程”(Btw.tele是用户已经提交的电话号码。它可以是任何唯一的号码)。
<!-- GOAFF TRANSACTION TRACKING -->
<script type="text/javascript">
function getUrlVars() {
var vars = [],
hash;
var hashes = window.location.href
.slice(window.location.href.indexOf("?") + 1)
.split("&");
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split("=");
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
var tele = getUrlVars()["tel-nr"];
if (tele == null) {
tele = "error";
}
document.write(
unescape(
"%3Cscript id=%27pap_x2s6df8d%27 src=%27" +
("https:" == document.location.protocol ? "https://" : "http://") +
"my.goaff.com/scripts/salejs.php%27 type=%27text/javascript%27%3E%3C/script%3E"
)
);
document.write(
unescape(
"%3Cscript id=%27pap_x2s6df8d%27 src=%27" +
("https:" == document.location.protocol ? "https://" : "http://") +
"my.goaff.com/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"
)
);
var action = PostAffTracker.createAction("fix_lead"); // do not change
PostAffTracker.setAccountId("089025de"); // do not change
action.setOrderID(tele); // 45234 is actual ID number of transaction
PostAffTracker.register();
PostAffTracker.setAccountId("089025de"); // do not change
var sale = PostAffTracker.createSale(); // do not change
sale.setOrderID(tele); // 45234 is actual ID number of transaction
PostAffTracker.register();
</script>