Google Analyticsを使用してクロスドメイントラッキングを設定しようとしています。基本的には、商品を購入できるショッピングカートに顧客を誘導するウィジェットがあります。ドメイントラッキングでGoogle Analyticsを設定する
クライアントに領収書ページを置くためのコードを提供する必要がありますが、設定に問題があります。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27715734-3']);
_gaq.push(['_setDomainName', 'myDomainA.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);
})();
</script>
</head>
<body>
<p>Direct to techport page <a href ="http://techport.e-talemarketing.co/Payment.html"onclick="_gaq.push(['_link', 'http://techport.e-talemarketing.co/Payment.html']); return false;"><input id="btnTechport" type="button" value="techport" /></a></p>
<p>Direct to forOffice page <a href ="http://foroffice.etailtesting.co.uk/Payment.html"onclick="_gaq.push(['_link', 'http://foroffice.etailtesting.co.uk/Payment.html']); return false;"><input id="btnForOffice" type="button" value="ForOffice" /></a></p>
とダミー領収ページに次のように入れている:私は、次のコードを持っている(開発ウィジェットになります)私たちのメインページで、次のコードを持つ2つのドメインにダミーのプロジェクトを設定しています:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27715734-3']);
_gaq.push(['_setDomainName', 'myDomainA.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
// 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',
'techport222', // order ID - required
'54321', // SKU/code - required
'Shiny jewels', // product name
'', // category or variation
'8', // unit price - required
'3'
]);
_gaq.push(['_trackTrans']); //confirms that a purchase has occurred and submits transaction to the Analytics servers
(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);
})();
</script>
</head>
<body>
<p>
TechPort Payment receipt for item</p>
</body>
</html>
Googleアナリティクスで自分のアカウントを設定すると、デフォルトのURLにメインページのURL(www.MyDomainA.com)が設定されています。
2種類のショッピングバスケットが追加されました。
誰かが間違っているのを誰も見ることができないのですが、どのイベントが追跡されているのを見ることができませんか?
私は、両方のプロファイルで電子商取引のトラッキングをtrueに設定しています。
編集:私は今のイベントを見ることができるように私はせっかちされていた強い可能性があります - 私はちょうどGoogleの分析sのイベントセクションをリアルタイムであることを意図していると考え...持って
私は今日だけを介してそれらを入れてきたし、いくつかのように、私が余分な何かを得るかどうかを確認するためにそれを追加するでしょうaddTrans上のアドバイスをOKのおかげかもしれを通じて来ていますありがとう! – user1244865
うれしい私は助けることができます。 'addTrans'はオプションではありません.Go eコマースが動作するために必要です。 – shanabus
ああ、ありがとう – user1244865