我在 Drupal 站点中安装了 Google Analytics 模块。这会跟踪任何自然的流量来源(来自谷歌搜索)。但是,我们正在使用第三方电子商务平台来处理预订信息。这会跟踪交易但不跟踪流量来源——如果原始网站有自然或付费流量来源,第三方网站只会认为流量是来自原始网站的引荐。
这是原始网站中的 GA 代码 - callawaygardens.com
var _gaq = _gaq || [];_
gaq.push(["_setAccount", "UA-1162555-1"]);_
gaq.push(["_setDomainName", "none"]);
_gaq.push(["_setAllowLinker", true]);
_gaq.push(['_setDomainName', 'callawaygardens.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(["_trackPageview"]);
(function() {var ga = document.createElement("script");ga.type = "text/javascript";ga.async = true;
ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ga, s);})();
这是第三方预订网站中的代码:var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1162555-1']); _gaq.push(['_setDomainName', '.synxis.com']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview', '确认']); _gaq.push(['_addTrans', '18174SB007366', // 订单 ID - 需要 'Callaway Gardens Resort', // 附属机构或商店名称 '119.00', // 总计 - 需要 '15.47', // 税 '', // shipping 'New York', // 城市 'NY', // 州或省 'US' // country ]);
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
_gaq.push(['_addItem',
'18174SB007366', // order ID - required
'IMND - BA12', // SKU/code - required
'Mountain Creek Inn Double ', // product name
'Best Available Rate', // category or variation
'119.00', // unit price - required
'1' // quantity - required
]);
_gaq.push(['_trackTrans']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();