Google analytics 试图链接http://www.example.com 到我的购物车上https://secure.example.com

Google analytics 试图链接http://www.example.com 到我的购物车上https://secure.example.com,google-analytics,Google Analytics,下面是我的故事-我正试图在上链接到我的购物车,但它似乎没有正确链接 这是我的密码: <!--Google Analytics --> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJ

下面是我的故事-我正试图在上链接到我的购物车,但它似乎没有正确链接

这是我的密码:

<!--Google Analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-125xxxxx-1");
//start cart link
pageTracker._setDomainName(".example.com");
pageTracker._setAllowHash(false);
//end cart link
pageTracker._trackPageview();
} catch(err) {}</script>
<!--Google Analytics -->
我添加了第一行以便在站点和购物车之间共享cookie,并添加了setAllowash以确保它使用cookie中的utm值,并且在我输入时没有“重新创建”它们

使用firecookie,它确实在站点和购物车之间共享相同的cookie,cookie域是“example.com”

我很确定,如果它工作正常,我所有的utmz、utma值都应该复制过来,保持不变,但它们正在改变。我已经复制了所有发送到google analytics并粘贴到下面的参数。它显示了从我的主页到我的产品页面,再到我的购物车,一直到订购前的页面发生了什么。(如果不买一些东西,我自己实际上无法测试最后一页,因此如果需要的话,我将在稍后的确认页上发布代码。)

下面是:

===============================================================
HOMEPAGE - http://www.example.com
----------------------------------------------------------------------------------------
utmac UA-125xxxxx-1
utmcc __utma=1.1920057171.1269446996.1269446996.1269446996.1;+__utmz=1.1269446996.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
utmcs UTF-8
utmdt GSM Cell Phone Rental from example
utmfl 10.0 r45
utmhid 69978133
utmhn www.example.com
utmje 1
utmn 1806413990
utmp /
utmr -
utmsc 24-bit
utmsr 1280x800
utmul en-gb
utmwv 4.6.5

PRODUCT PAGE - http://www.example.com/products/international-cell-phone-purchase/
----------------------------------------------------------------
utmac UA-125xxxxx-1
utmcc __utma=1.1920057171.1269446996.1269446996.1269446996.1;+__utmz=1.1269446996.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
utmcs UTF-8
utmdt example | International Cell Phones
utmfl 10.0 r45
utmhid 276151647
utmhn www.example.com
utmje 1
utmn 155808433
utmp /products/international-cell-phone-purchase/
utmr 0
utmsc 24-bit
utmsr 1280x800
utmul en-gb
utmwv 4.6.5

CART STAGE 1 - https://secure.example.com/checkout/viewbasket.php
------------------------------------------------
utmac UA-125xxxxx-1
utmcc __utma=60286578.994269564.1269447144.1269447144.1269447144.1;+__utmz=60286578.1269447144.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/products/international-cell-phone-purchase/;
utmcn 1
utmcs UTF-8
utmdt Your Cart
utmfl 10.0 r45
utmhid 1802074903
utmhn secure.example.com
utmje 1
utmn 1621444199
utmp 1-reviewcart
utmr http://www.example.com/products/international-cell-phone-purchase/
utmsc 24-bit
utmsr 1280x800
utmul en-gb
utmwv 4.6.5

CART STAGE 2 - https://secure.example.com/checkout/docheckout.php
------------------------------------------------
utmac UA-125xxxxx-1
utmcc __utma=60286578.994269564.1269447144.1269447144.1269447144.1;+__utmz=60286578.1269447144.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/products/international-cell-phone-purchase/;
utmcs UTF-8
utmdt Checkout
utmfl 10.0 r45
utmhid 871670520
utmhn secure.example.com
utmje 1
utmn 1153927228
utmp 2-checkout
utmr 0
utmsc 24-bit
utmsr 1280x800
utmul en-gb
utmwv 4.6.5

CART STAGE 3 - https://secure.example.com/checkout/doreview.php
----------------------------------------------
utmac UA-125xxxxx-1
utmcc __utma=60286578.994269564.1269447144.1269447144.1269447144.1;+__utmz=60286578.1269447144.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/products/international-cell-phone-purchase/;
utmcs UTF-8
utmdt Checkout
utmfl 10.0 r45
utmhid 1731598159
utmhn secure.example.com
utmje 1
utmn 1442257710
utmp 3-checkoutreview
utmr 0
utmsc 24-bit
utmsr 1280x800
utmul en-gb
utmwv 4.6.5
===============================================================
如您所见,utma值未被保留,因此看起来像是配置问题。我已经研究过帮助,但没有一个案例适合我

我希望有人能在这方面提供帮助,这是我一段时间以来一直存在的问题,如果能最终建立可靠可靠的分析,那将是一件好事。

(我假设您已经通过配置文件设置启用了电子商务报告。)

我相信你遗漏了一些样板(稍后会有更多的内容)。此外,您在问题文本中提到的两行(介于“开始购物车链接”和“结束购物车链接”之间)是不必要的

调用_trackPageview后,需要另外三行,其中两行分别更新保存事务和存储项目数据的数组,最后一行调用_trackTrans()。这就是将信息发送到GA服务器所需的调用:

因此,在调用_trackPageview之后,插入以下三行:

pageTracker._addTrans();        // initializes a trans obj; stores trans data     
pageTracker._addItem();         // array holding data for each item in the cart
pageTracker._trackTrans();      // confirms purchase, finalizes transaction 

调用_trackTrans时没有传递任何内容,但您将传入上述两个函数调用的参数。请记住,这两个函数的参数列表都是按位置匹配的,因此最好对不使用的参数使用占位符。下面是一个显示参数列表的页面。

看起来您缺少以下内容将JS中的行从购物车子域中删除:

pageTracker._setDomainName(".example.com");
pageTracker._setAllowHash(false);
setDomainName设置cookie域,SetAllowAsh(false)将utma cookie开始处的域哈希值改为“1”,而不是域名的数字哈希值-在这种情况下,实际上并不需要这样做,因为购物车与主站点位于同一个基本域上,但是如果您更改它,您以前的所有用户cookie将不匹配


不要对cookie值太过兴奋(如果你解决了问题,你会看到新旧cookie),使用Firebug Net面板进行测试,看看到底什么回到了GA。

我现在已经通过以下方法让它工作了:

<!--Google Analytics Asynchronous Code -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(
    ['_setAccount', 'UA-xxxxxxxx-1'],
    ['_setDomainName', '.domain.com'],
    ['_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>
<!--Google Analytics Asynchronous Code END-->

var _gaq=_gaq | |[];
_推(
[“设置账户”,“UA-xxxxxxxx-1”],
[''u setDomainName','.domain.com'],
[“轨迹页面视图”]
);
(功能(){
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);
})();

hi,您能从您的采购收据页面发布GA代码(修改后的GATC)吗(即,您初始化交易对象的页面?如果只是差异,那么就可以了。这是一个粘贴箱,它已经包含了电子商务内容。在分析中,它似乎登录正常,只是站点“链接”。谢谢,但为什么这两行不必要?我如何才能将我的站点和购物车视为一个实体?
<!--Google Analytics Asynchronous Code -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(
    ['_setAccount', 'UA-xxxxxxxx-1'],
    ['_setDomainName', '.domain.com'],
    ['_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>
<!--Google Analytics Asynchronous Code END-->