我有一个脚本,应该显示在每个页面上,并在本地存储中写入一个散列。
<script>
(function () {
// write something in the local storage
})();
</script>
对于这个标签,我选择“页面视图”作为触发器,因为它应该显示在每个页面上。
第二个脚本是跟踪某个表单之后的感谢页面上的转换。
<script>
(function () {
var data = {};
data.conversionId = 'XXXXXX';
conversion(data);
})();
function conversion(data) {
var iframe = document.createElement('iframe');
iframe.frameBorder = 0;
iframe.width = 1;
iframe.height = 1;
iframe.name = "stlconv";
iframe.scrolling = "no";
iframe.allowtransparency = "true";
iframe.vspace = "0";
iframe.hspace = "0";
iframe.marginwidth = "0";
iframe.marginheight = "0";
iframe.src = url;
document.body.appendChild(iframe);
}
</script>
你在这里选择什么作为触发器?如何以最佳方式管理第二个脚本?
-
页面的所有者应该如何设置“conversionId”,以便我可以在脚本中获取值?
-
如何以最佳方式生成触发器,因此此脚本仅在send中的表单之后触发?