2

何百ものクライアント サイトで Google アナリティクスを使用しています。各サイトには独自のアカウントがあり、集計データ用のアカウントもあります。次のコードを使用して、両方のアカウントのページビューを追跡しています。

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);  //obviously fake UA numbers
_gaq.push(['_trackPageview']);
_gaq.push(
['aggregate._setAccount', 'UA-87654321-1'],
['aggregate._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>

これは、訪問と行動の追跡にはうまく機能していますが、e コマース トラッキング コードに同じタイプの二重追跡を実装する方法がわかりません。通常の _addTrans、_addItem、および _trackTrans セットアップを使用しています。

両方のアカウントにレポートするように e コマース トラッキングを調整するにはどうすればよいですか?

4

1 に答える 1

1

In your code, the aggregate. in the _gaq.push calls like aggregate._setAccount is used to create an additional named tracker.

Just copy the ecommerce _gaq.push code lines, and add aggregate. in front of the _addTrans, _addItem and _trackTrans calls.

For example,

 _gaq.push(['_addTrans', ...parameters...]);
 _gaq.push(['aggregate._addTrans', ...parameters...]);
于 2013-01-24T19:13:37.890 に答える