English 中文(简体)
• 如何在 go角分析中使用 Custom?
原标题:How do i properly use CustomVars in google analytics?

• 如何在 go角分析中适当使用习俗var? 我使用了以下守则,这里指的是通知内容。

  1. i only seen one being in the get request
  2. After 24 hours only one showed up
  3. After commenting out one and changing the 2 vars to use slotIndex-1 i notice NO vars going through GA

什么是错了?

var _gaq = _gaq || [];
_gaq.push([ _setAccount ,  UA-12345678-1 ]);

if (cond) {
    _gaq.push([ _setCustomVar ,1,  one , d1,1]); 
    _gaq.push([ _setCustomVar ,2,  name two , "sz",1]); 
    _gaq.push([ _setCustomVar ,3,  name3 , boolVal,1]); 
}
_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);
})();
最佳回答

法典看重的是罚款,尽管你可能希望确保你们的变量存在,并改写。

if (cond) {
    if (typeof d1 !== "undefined") {
        _gaq.push([ _setCustomVar , 1,  one , d1.toString(), 1]);
    }
    _gaq.push([ _setCustomVar , 2,  name two , "sz", 1]);
    if (typeof boolVal !== "undefined") {
        _gaq.push([ _setCustomVar , 3,  name3 , boolVal.toString(), 1]);
    }
}

此外,海关可变因素可能滞后——总分类表所示。 (资料来源:)

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签