百度统计图标不显示不显示,什么原因

求助!百度统计数据不显示问题_百度统计吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0可签7级以上的吧50个
本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:19,817贴子:
求助!百度统计数据不显示问题
1楼图,图一是我在百度推广后台的百度统计当中的截图,只有账户当中的展现,点击和消费是正常显示的,后面的访问量等访客信息都没有,图二是安装测试截图,显示代码安装正确了,图三是我在图二的查看报告当中点进去查看的,显示网址的访客信息是有的,但是为什么没在图一当中显示出来呢
求高手指点什么地方做的不对吗?顺便@百度统计,是不是后台出问题了?
贴吧热议榜
使用签名档&&
保存至快速回贴百度统计不显示,什么原因?_百度知道
百度统计不显示,什么原因?
我有更好的答案
  首先确认代码安装正确,那么百度推广报告中没有数据或者数据显示不全,可能有以下原因:1、您的查看时间为添加代码的当天,此时百度推广数据尚未生成,要等次日查看;2、您的推广跟踪设置为“否”;
具体请参考:什么是百度推广跟踪3、如果是某个特定的计划、单元或关键词没有数据,请检查:(1)您是否在全部的百度推广URL中安装了代码?
请确保在全部的百度推广URL都安装了代码,且不能重复安装;(2)您的百度推广URL是否存在重定向?
如是,请将跳转后的页面设为推广URL,并确保在该页面上正确添加代码;
具体可参考:网页重定向对推广点击跟踪有影响吗(3)您的百度推广URL是不是都能正常打开?
如果某个URL无法打开,百度统计就无法记录到该页面的浏览数据。
采纳率:87%
来自团队:
百度统计显示没检测到代码?还是没有统计出流量?
我把下载的代码写入html中了,还没有套程序。静态页预览不显示。
你网页直接查看源代码。看看有没有在里头。估计你是弄在模板中,然后还没生成静态页,所以统计代码没显示在页面中
来自:求助得到的回答
本回答被提问者采纳
报告没有数据,一般是由于查看的时间段不当或代码安装不正确有关。 1、是否开启报告服务? 2、您是否在正确的时间段进行查看? (1)统计数据可能尚未生成。
代码添加后1-2小时,百度统计才能提供数据;其中,百度推广数据需要次日才能查看。 (2)您选择了安装代码之前的时间段
例如,您在1月2日安装了代码,则1月1日或更早的日期范围就没有数据。3、您是否已经正确安装了统计代码? 如果报告服务已开启,查看的时间段正确,代码检查也没有问题,仍然看不到数据,那可能是因为百度统计的js代码没有运行() 更多问题,请到推广客户端帮助频道查询:
系统原因?刷新
新版本的百度统计是默认不显示图标的。系统管理设置---统计图标设置--显示图标-设置查看密码等。新版访问分析代码(异步加载),对于网站提升打开加载速度有帮助。
有一个问题就是,那段监控代码你加了没有,是不是放错位置。
其他3条回答
为您推荐:
其他类似问题
您可能关注的内容
百度统计的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
这段代码是来自sf的百度统计,图片来自百度统计的后台。
从图片所知,百度可以获取到基本的设备信息、访客类型、访问频次、访问来源、上次访问时间、入口页面、最后停留页面、每次打开页面的时间、停留时长、页面地址。
从代码得知,记录了设备信息、设置了访客标识码的cookies,读取了浏览器标识等。运用了localStorage、sessionStorage。
猜测的原理:通过cookies设置的访客标识码判断访客类型(新老访客),访问频次也好理解(通过多条记录读取某时间段有多少条记录),访问来源(从搜索引擎跳转过来的还是直接输入网址),上次访问时间(读取最近的一条记录的时间),入口页面(第一条记录的url),最后停留页面(最后一条记录的url),每次页面停留时长(不会是两条记录的时间差吧),
那么问题来了:
上述的猜测原理对不对,不对的请说明、解释一下。
百度也有记录地域和IP地址,但是在js里面貌似没有记录
这个js大部分没看懂,它是怎么把数据提交上去的?
提交数据,安全怎么防,怎么防止别人随意提交?
另外百度有提交一张1x1像素的图片,不知道干嘛用的。
大家回答的能具体点就具体点吧,谢谢各位了。
(function () {
var h = {}, mt = {}, c = {
id: "eaa573c0ccb16b52665ac26",
dm: ["segmentfault.com"],
js: "tongji.baidu.com/hm-web/js/",
etrk: [{id: "sfLogin", eventType: "onclick"}],
ctrk: true,
vdur: 1800000,
var p = !0, q = null, r = !1;
// 检测设备信息,{Ba: false, cookieEnabled: true, javaEnabled: true, language: "zh-CN", Ea: ""…}
mt.i = {};
mt.i.Ba = /msie (\d+\.\d+)/i.test(navigator.userAgent);
mt.i.cookieEnabled = navigator.cookieE
mt.i.javaEnabled = navigator.javaEnabled();
mt.i.language = navigator.language || navigator.browserLanguage || navigator.systemLanguage || navigator.userLanguage || "";
mt.i.Ea = (window.screen.width || 0) + "x" + (window.screen.height || 0);
mt.i.colorDepth = window.screen.colorDepth || 0;
// 设置、获取cookie
mt.cookie = {};
mt.cookie.set = function (a, b, e) {
e.F && (d = new Date, d.setTime(d.getTime() + e.F));
document.cookie = a + "=" + b + (e.domain ? "; domain=" + e.domain : "") + (e.path ? "; path=" + e.path : "") + (d ? "; expires=" + d.toGMTString() : "") + (e.Oa ? "; secure" : "")
mt.cookie.get = function (a) {
return (a = RegExp("(^| )" + a + "=([^;]*)(;|$)").exec(document.cookie)) ? a[2] : q
//console.log(mt.cookie.set(''));
mt.n = {};
mt.n.P = function (a) {
return document.getElementById(a)
mt.n.oa = function (a) {
for (b = "A"; (a = a.parentNode) && 1 == a.nodeT)if (a.tagName == b)
(mt.n.Ca = function () {
function a() {
if (!a.w) {
for (var b = 0, g = d. b & b++)d[b]()
function b() {
document.documentElement.doScroll("left")
} catch (d) {
setTimeout(b, 1);
var e = r, d = [],
document.addEventListener ? g = function () {
document.removeEventListener("DOMContentLoaded", g, r);
} : document.attachEvent && (g = function () {
"complete" === document.readyState && (document.detachEvent("onreadystatechange", g), a())
(function () {
if (!e)if (e = p, "complete" === document.readyState)a.w = else if (document.addEventListener)document.addEventListener("DOMContentLoaded",
g, r), window.addEventListener("load", a, r); else if (document.attachEvent) {
document.attachEvent("onreadystatechange", g);
window.attachEvent("onload", a);
d = window.frameElement == q
} catch (l) {
document.documentElement.doScroll && d && b()
return function (b) {
a.w ? b() : d.push(b)
mt.event = {};
mt.event.c = function (a, b, e) {
a.attachEvent ? a.attachEvent("on" + b, function (d) {
e.call(a, d)
}) : a.addEventListener && a.addEventListener(b, e, r)
mt.event.preventDefault = function (a) {
a.preventDefault ? a.preventDefault() : a.returnValue = r
mt.q = {};
mt.q.parse = function () {
return (new Function('return (" + source + ")'))()
mt.q.stringify = function () {
function a(d) {
/["\\\x00-\x1f]/.test(d) && (d = d.replace(/["\\\x00-\x1f]/g, function (d) {
var a = e[d];
a = d.charCodeAt();
return "\\u00" + Math.floor(a / 16).toString(16) + (a % 16).toString(16)
return '"' + d + '"'
function b(d) {
return 10 & d ? "0" + d : d
var e = {"\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\"};
return function (d) {
switch (typeof d) {
case "undefined":
return "undefined";
case "number":
return isFinite(d) ? String(d) : "null";
case "string":
return a(d);
case "boolean":
return String(d);
if (d === q)return "null";
if (d instanceof Array) {
var g = ["["], e = d.length, l, f,
for (f = 0; f & f++)switch (k = d[f], typeof k) {
case "undefined":
case "function":
case "unknown":
l && g.push(","), g.push(mt.q.stringify(k)), l = 1
g.push("]");
return g.join("")
if (d instanceof Date)return '"' + d.getFullYear() + "-" + b(d.getMonth() + 1) + "-" + b(d.getDate()) + "T" + b(d.getHours()) + ":" + b(d.getMinutes()) + ":" + b(d.getSeconds()) + '"';
l = ["{"];
for (e in d)if (Object.prototype.hasOwnProperty.call(d, e))switch (k =
d[e], typeof k) {
case "undefined":
case "unknown":
case "function":
g && l.push(","), g = 1, l.push(f(e) + ":" + f(k))
l.push("}");
return l.join("")
mt.lang = {};
mt.lang.e = function (a, b) {
return "[object " + b + "]" === {}.toString.call(a)
mt.lang.La = function (a) {
return mt.lang.e(a, "Number") && isFinite(a)
mt.lang.Na = function (a) {
return mt.lang.e(a, "String")
mt.localStorage = {};
mt.localStorage.C = function () {
if (!mt.localStorage.f)try {
mt.localStorage.f = document.createElement("input"), mt.localStorage.f.type = "hidden", mt.localStorage.f.style.display = "none", mt.localStorage.f.addBehavior("#default#userData"), document.getElementsByTagName("head")[0].appendChild(mt.localStorage.f)
} catch (a) {
mt.localStorage.set = function (a, b, e) {
var d = new D
d.setTime(d.getTime() + e || 31536E6);
window.localStorage ? (b = d.getTime() + "|" + b, window.localStorage.setItem(a, b)) : mt.localStorage.C() && (mt.localStorage.f.expires = d.toUTCString(), mt.localStorage.f.load(document.location.hostname), mt.localStorage.f.setAttribute(a, b), mt.localStorage.f.save(document.location.hostname))
} catch (g) {
mt.localStorage.get = function (a) {
if (window.localStorage) {
if (a = window.localStorage.getItem(a)) {
var b = a.indexOf("|"), e = a.substring(0, b) - 0;
if (e && e & (new Date).getTime())return a.substring(b + 1)
} else if (mt.localStorage.C())try {
return mt.localStorage.f.load(document.location.hostname), mt.localStorage.f.getAttribute(a)
} catch (d) {
mt.localStorage.remove = function (a) {
if (window.localStorage)window.localStorage.removeItem(a); else if (mt.localStorage.C())try {
mt.localStorage.f.load(document.location.hostname), mt.localStorage.f.removeAttribute(a), mt.localStorage.f.save(document.location.hostname)
} catch (b) {
mt.sessionStorage = {};
mt.sessionStorage.set = function (a, b) {
if (window.sessionStorage)try {
window.sessionStorage.setItem(a, b)
} catch (e) {
mt.sessionStorage.get = function (a) {
return window.sessionStorage ? window.sessionStorage.getItem(a) : q
mt.sessionStorage.remove = function (a) {
window.sessionStorage && window.sessionStorage.removeItem(a)
mt.M = {};
mt.M.log = function (a, b) {
var e = new Image, d = "mini_tangram_log_" + Math.floor( * Math.random()).toString(36);
window[d] =
e.onload = e.onerror = e.onabort = function () {
e.onload = e.onerror = e.onabort =
e = window[d] =
mt.B = {};
mt.B.ua = function () {
var a = "";
if (navigator.plugins && navigator.mimeTypes.length) {
var b = navigator.plugins["Shockwave Flash"];
b && b.description && (a = b.description.replace(/^.*\s+(\S+)\s+\S+$/, "$1"))
} else if (window.ActiveXObject)try {
if (b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))(a = b.GetVariable("$version")) && (a = a.replace(/^.*\s+(\d+),(\d+).*$/, "$1.$2"))
} catch (e) {
//&object classid="clsid:d27cdb6e-ae6d-11cf-96b8-" id="undefined" width="undefined" height="undefined"&&param name="movie" value="undefined" /&&param name="flashvars" value="" /&&param name="allowscriptaccess" value="always" /&&embed type="application/x-shockwave-flash" name="undefined" width="undefined" height="undefined" src="undefined" flashvars="" allowscriptaccess="always" /&&/object&
mt.B.ha = function (a, b, e, d, g) {
return '&object classid="clsid:d27cdb6e-ae6d-11cf-96b8-" id="' + a + '" width="' + e + '" height="' + d + '"&&param name="movie" value="' + b + '" /&&param name="flashvars" value="' + (g || "") + '" /&&param name="allowscriptaccess" value="always" /&&embed type="application/x-shockwave-flash" name="' + a + '" width="' + e + '" height="' + d + '" src="' + b + '" flashvars="' + (g || "") + '" allowscriptaccess="always" /&&/object&'
mt.url = {};
mt.url.o = function (a, b) {
var e = a.match(RegExp("(^|&|\\?|#)(" + b + ")=([^&#]*)(&|$|#)", ""));
return e ? e[3] : q
mt.url.Ka = function (a) {
return (a = a.match(/^(https?:)\/\//)) ? a[1] : q
mt.url.ra = function (a) {
return (a = a.match(/^(https?:\/\/)?([^\/\?#]*)/)) ? a[2].replace(/.*@/, "") : q
mt.url.R = function (a) {
return (a = mt.url.ra(a)) ? a.replace(/:\d+$/, "") : a
mt.url.Ja = function (a) {
return (a = a.match(/^(https?:\/\/)?[^\/]*(.*)/)) ? a[2].replace(/[\?#].*/, "").replace(/^$/, "/") : q
Aa: "http://tongji.baidu.com/hm-web/welcome/ico",
K: "hm.baidu.com/hm.gif",
aa: "baidu.com",
xa: "hmmd",
ya: "hmpl",
wa: "hmkw",
va: "hmci",
za: "hmsr",
j: Math.round(+new Date / 1E3),
protocol: "https:" == document.location.protocol ? "https:" : "http:",
X: "cc cf ci ck cl cm cp cw ds ep et fl ja ln lo lt nv rnd si st su v cv lv api tt u".split(" ")
(function () {
m: {}, c: function (a, e) {
this.m[a] = this.m[a] || [];
this.m[a].push(e)
}, s: function (a, e) {
this.m[a] = this.m[a] || [];
for (var d = this.m[a].length, g = 0; g & g++)this.m[a][g](e)
return h.k = a
(function () {
function a(a, d) {
var g = document.createElement("script");
g.charset = "utf-8";
b.e(d, "Function") && (g.readyState ? g.onreadystatechange = function () {
if ("loaded" === g.readyState || "complete" === g.readyState)g.onreadystatechange = q, d()
} : g.onload = function () {
var n = document.getElementsByTagName("script")[0];
n.parentNode.insertBefore(g, n);
var b = mt.
return h.load = a
(function () {
function a() {
var a = "";
h.b.a.nv ? (a = encodeURIComponent(document.referrer), window.sessionStorage ? e.set("Hm_from_" + c.id, a) : b.set("Hm_from_" + c.id, a, 864E5)) : a = (window.sessionStorage ? e.get("Hm_from_" + c.id) : b.get("Hm_from_" + c.id)) || "";
var b = mt.localStorage, e = mt.sessionS
return h.O = a
(function () {
var a = h.g, b = mt.B, e = {
init: function () {
if ("" !== c.icon) {
d = c.icon.split("|");
var g = a.Aa + "?s=" + c.id, e = ("http:" == a.protocol ? "http://eiv" : "https://bs") + ".baidu.com" + d[0] + "." + d[1];
switch (d[1]) {
case "swf":
d = b.ha("HolmesIcon" + a.j, e, d[2], d[3], "s=" + g);
case "gif":
d = '&a href="' + g + '" target="_blank"&&img border="0" src="' + e + '" width="' + d[2] + '" height="' + d[3] + '"&&/a&';
d = '&a href="' + g + '" target="_blank"&' + d[0] + "&/a&"
document.write(d)
h.k.c("pv-b", e.init);
(function () {
var a = mt.n, b = mt.event, e = {
Z: function () {
b.c(document, "click", e.ia());
for (var d = c.etrk.length, g = 0; g & g++) {
var n = c.etrk[g], l = a.P(decodeURIComponent(n.id));
l && b.c(l, n.eventType, e.ka())
}, ka: function () {
return function (a) {
(a.target || a.srcElement).setAttribute("HM_fix", a.clientX + ":" + a.clientY);
h.b.a.et = 1;
h.b.a.ep = "{id:" + this.id + ",eventType:" + a.type + "}";
}, ia: function () {
return function (a) {
var b = a.target || a.srcE
var e = b.getAttribute("HM_fix"), l = a.clientX + ":" + a.clientY;
e == l)b.removeAttribute("HM_fix"); else if (e = c.etrk.length, 0 & e) {
for (l = {}; b && b != document.)b.id && (l[b.id] = ""), b = b.parentN
for (b = 0; b & b++) {
var f = decodeURIComponent(c.etrk[b].id);
l.hasOwnProperty(f) && (h.b.a.et = 1, h.b.a.ep = "{id:" + f + ",eventType:" + a.type + "}", h.b.h())
h.k.c("pv-b", e.Z);
(function () {
var a = mt.n, b = mt.event, e = mt.i, d = h.g, g = [], n = {
Y: function () {
c.ctrk && (b.c(document, "mouseup", n.da()), b.c(window, "unload", function () {
}), setInterval(function () {
}, da: function () {
return function (a) {
a = n.pa(a);
if ("" !== a) {
var b = (d.protocol + "//" + d.K + "?" + h.b.W().replace(/ep=[^&]*/, "ep=" + encodeURIComponent("[" + a + "]"))).
b + (d.l + "").length & d.N || (b + encodeURIComponent(g.join(",") + (g.length ? "," : "")).length + (d.l + "").length & d.N && n.z(), g.push(a), (g.length &= d.ga || /t:a/.test(a)) && n.z())
pa: function (b) {
if (0 === d.ea) {
var f = b.target || b.srcElement, k = f.tagName.toLowerCase();
if ("embed" == k || "object" == k)return ""
e.Ba ? (f = Math.max(document.documentElement.scrollTop, document.body.scrollTop), k = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft), k = b.clientX + k, f = b.clientY + f) : (k = b.pageX, f = b.pageY);
var m = window.innerWidth || document.documentElement.clientWidth || document.body.offsetW
switch (c.align) {
k -= m / 2;
k = "{x:" + k + ",y:" + f + ",";
f = b.target || b.srcE
return k = (b = "a" == f.tagName.toLowerCase() ? f : a.oa(f)) ? k + ("t:a,u:" + encodeURIComponent(b.href) + "}") : k + "t:b}"
}, z: function () {
0 !== g.length && (h.b.a.et = 2, h.b.a.ep = "[" + g.join(",") + "]", h.b.h(), g = [])
h.k.c("pv-b", n.Y);
(function () {
var a = mt.n, b = h.g, e = h.load, d = h.O;
h.k.c("pv-b", function () {
c.rec && a.Ca(function () {
for (var g = 0, n = c.rp. g & g++) {
var l = c.rp[g][0], f = c.rp[g][1], k = a.P("hm_t_" + l);
if (f && !(2 == f && !k || k && "" !== k.innerHTML))k = "", k = Math.round(Math.random() * b.l), k = 4 == f ? "http://crs.baidu.com/hl.js?" + ["siteId=" + c.id, "planId=" + l, "rnd=" + k].join("&") : "http://crs.baidu.com/t.js?" + ["siteId=" + c.id, "planId=" + l, "from=" + d(), "referer=" + encodeURIComponent(document.referrer), "title=" + encodeURIComponent(document.title), "rnd=" +
k].join("&"), e(k)
(function () {
var a = h.g, b = h.load, e = h.O;
h.k.c("pv-b", function () {
if (c.trust && c.vcard) {
var d = a.protocol + "//trust.baidu.com/vcard/v.js?" + ["siteid=" + c.vcard, "url=" + encodeURIComponent(document.location.href), "source=" + e(), "rnd=" + Math.round(Math.random() * a.l)].join("&");
(function () {
function a() {
return function () {
h.b.a.nv = 0;
h.b.a.st = 4;
h.b.a.et = 3;
h.b.a.ep = h.D.sa() + "," + h.D.qa();
function b() {
clearTimeout(A);
y && (a = "visible" == document[y]);
B && (a = !document[B]);
f = "undefined" == typeof a ? p :
if ((!l || !k) && f && m)u = p, s = +new D else if (l && k && (!f || !m))u = r, t += +new Date -
A = setTimeout(b, 100)
function e(a) {
var k = document, b = "";
if (a in k)b = else for (var d = ["webkit", "ms", "moz", "o"], s = 0; s & d. s++) {
var e = d[s] + a.charAt(0).toUpperCase() + a.slice(1);
if (e in k) {
function d(a) {
if (!("focus" == a.type || "blur" == a.type) || !(a.target && a.target != window))m = "focus" == a.type || "focusin" == a.type ? p : r, b()
var g = mt.event, n = h.k, l = p, f = p, k = p, m = p, v = +new Date, s = v, t = 0, u = p, y = e("visibilityState"), B = e("hidden"), A;
(function () {
var a = y.replace(/[vV]isibilityState/, "visibilitychange");
g.c(document, a, b);
g.c(window, "pageshow", b);
g.c(window, "pagehide", b);
"object" == typeof document.onfocusin ? (g.c(document, "focusin", d), g.c(document, "focusout", d)) : (g.c(window, "focus", d),
g.c(window, "blur", d))
sa: function () {
return +new Date - v
}, qa: function () {
return u ? +new Date - s + t : t
n.c("pv-b", function () {
g.c(window, "unload", a())
return h.D
(function () {
function a(k) {
for (var b in k)if ({}.hasOwnProperty.call(k, b)) {
var e = k[b];
d.e(e, "Object") || d.e(e, "Array") ? a(e) : k[b] = String(e)
function b(a) {
return a.replace ? a.replace(/'/g, "'0").replace(/\*/g, "'1").replace(/!/g, "'2") : a
var e = mt.M, d = mt.lang, g = mt.q, n = h.g, l = h.k, f = {
S: q, r: [], A: 0, T: r, init: function () {
push: function () {
f.J.apply(f, arguments)
l.c("pv-b", function () {
l.c("pv-d", f.na);
l.c("stag-b", function () {
h.b.a.api = f.d || f.A ? f.d + "_" + f.A : ""
l.c("stag-d", function () {
h.b.a.api =
}, la: function () {
var a = window._
if (a && a.length)for (var b = 0; b & a. b++) {
var d = a[b];
switch (d[0]) {
case "_setAccount":
1 & d.length && /^[0-9a-z]{32}$/.test(d[1]) && (f.d |= 1, window._bdhm_account = d[1]);
case "_setAutoPageview":
if (1 & d.length && (d = d[1], r === d || p === d))f.d |= 2, window._bdhm_autoPageview = d
}, ma: function () {
if ("undefined" === typeof window._bdhm_account || window._bdhm_account === c.id) {
window._bdhm_account = c.
var a = window._
if (a && a.length)for (var b = 0, e = a. b & b++)d.e(a[b],
"Array") && "_trackEvent" !== a[b][0] && "_trackRTEvent" !== a[b][0] ? f.J(a[b]) : f.r.push(a[b]);
window._hmt = f.S
}, na: function () {
if (0 & f.r.length)for (var a = 0, b = f.r. a & a++)f.J(f.r[a]);
}, J: function (a) {
if (d.e(a, "Array")) {
var b = a[0];
if (f.hasOwnProperty(b) && d.e(f[b], "Function"))f[b](a)
}, _trackPageview: function (a) {
if (1 & a.length && a[1].charAt && "/" == a[1].charAt(0)) {
h.b.a.et = 0;
h.b.a.ep = "";
h.b.H ? (h.b.a.nv = 0, h.b.a.st = 4) : h.b.H =
var b = h.b.a.u, d = h.b.a.
h.b.a.u = n.protocol + "//" + document.location.host +
f.T || (h.b.a.su = document.location.href);
h.b.a.su = d
}, _trackEvent: function (a) {
2 & a.length && (f.d |= 8, h.b.a.nv = 0, h.b.a.st = 4, h.b.a.et = 4, h.b.a.ep = b(a[1]) + "*" + b(a[2]) + (a[3] ? "*" + b(a[3]) : "") + (a[4] ? "*" + b(a[4]) : ""), h.b.h())
}, _setCustomVar: function (a) {
if (!(4 & a.length)) {
var d = a[1], e = a[4] || 3;
if (0 & d && 6 & d && 0 & e && 4 & e) {
for (var s = (h.b.a.cv || "*").split("!"), t = s. t & d - 1; t++)s.push("*");
s[d - 1] = e + "*" + b(a[2]) + "*" + b(a[3]);
h.b.a.cv = s.join("!");
a = h.b.a.cv.replace(/[^1](\*[^!]*){2}/g, "*").replace(/((^|!)\*)+$/g,
"" !== a ? h.b.setData("Hm_cv_" + c.id, encodeURIComponent(a), c.age) : h.b.Da("Hm_cv_" + c.id)
}, _setReferrerOverride: function (a) {
1 & a.length && (h.b.a.su = a[1].charAt && "/" == a[1].charAt(0) ? n.protocol + "//" + window.location.host + a[1] : a[1], f.T = p)
}, _trackOrder: function (b) {
d.e(b, "Object") && (a(b), f.d |= 16, h.b.a.nv = 0, h.b.a.st = 4, h.b.a.et = 94, h.b.a.ep = g.stringify(b), h.b.h())
}, _trackMobConv: function (a) {
callback: 5,
}[a[1]])f.d |= 32, h.b.a.et = 93, h.b.a.ep = a, h.b.h()
}, _trackRTPageview: function (b) {
d.e(b, "Object") && (a(b), b = g.stringify(b), 512 &= encodeURIComponent(b).length && (f.d |= 64, h.b.a.rt = b))
}, _trackRTEvent: function (b) {
if (d.e(b, "Object")) {
b = encodeURIComponent(g.stringify(b));
var e = function (a) {
var b = h.b.a.
f.d |= 128;
h.b.a.et = 90;
h.b.a.rt =
h.b.a.rt = b
if (900 &= l)e.call(this, b); else for (var l = Math.ceil(l / 900), s = "block|" + Math.round(Math.random() * n.l).toString(16) + "|" + l + "|", t = [], u = 0; u & u++)t.push(u), t.push(b.substring(900 * u, 900 * u + 900)), e.call(this, s + t.join("|")),
}, _setUserId: function (a) {
if (d.e(a, "String") || d.e(a, "Number")) {
var b = h.b.G(), g = "hm-" + h.b.a.v;
f.V = f.V || Math.round(Math.random() * n.l);
e.log("//datax.baidu.com/x.gif?si=" + c.id + "&dm=" + encodeURIComponent(b) + "&ac=" + encodeURIComponent(a) + "&v=" + g + "&li=" + f.V + "&rnd=" + Math.round(Math.random() * n.l))
return h.ba
(function () {
function a() {
"undefined" == typeof window["_bdhm_loaded_" + c.id] && (window["_bdhm_loaded_" + c.id] = p, this.a = {}, this.H = r, this.init())
var b = mt.url, e = mt.M, d = mt.B, g = mt.lang, n = mt.cookie, l = mt.i, f = mt.localStorage, k = mt.sessionStorage, m = h.g, v = h.k;
a.prototype = {
I: function (a, b) {
a = "." + a.replace(/:\d+/, "");
b = "." + b.replace(/:\d+/, "");
var d = a.indexOf(b);
return -1 & d && d + b.length == a.length
}, U: function (a, b) {
a = a.replace(/^https?:\/\//, "");
return 0 === a.indexOf(b)
}, t: function (a) {
for (var d = 0; d & c.dm. d++)if (-1 &
c.dm[d].indexOf("/")) {
if (this.U(a, c.dm[d]))return p
var e = b.R(a);
if (e && this.I(e, c.dm[d]))return p
}, G: function () {
for (var a = document.location.hostname, b = 0, d = c.dm. b & b++)if (this.I(a, c.dm[b]))return c.dm[b].replace(/(:\d+)?[\/\?#].*/, "");
}, Q: function () {
for (var a = 0, b = c.dm. a & a++) {
var d = c.dm[a];
if (-1 & d.indexOf("/") && this.U(document.location.href, d))return d.replace(/^[^\/]+(\/.*)/, "$1") + "/"
return "/"
}, ta: function () {
if (!document.referrer)return m.j - m.p & c.vdur ? 1 : 4;
this.t(document.referrer) && this.t(document.location.href) ? a = p : (a = b.R(document.referrer), a = this.I(a || "", document.location.hostname));
return a ? m.j - m.p & c.vdur ? 1 : 4 : 3
}, getData: function (a) {
return n.get(a) || k.get(a) || f.get(a)
} catch (b) {
}, setData: function (a, b, d) {
n.set(a, b, {domain: this.G(), path: this.Q(), F: d}), d ? f.set(a, b, d) : k.set(a, b)
} catch (e) {
}, Da: function (a) {
n.set(a, "", {domain: this.G(), path: this.Q(), F: -1}), k.remove(a), f.remove(a)
} catch (b) {
}, Ha: function () {
var a, b, d, e,
m.p = this.getData("Hm_lpvt_" +
c.id) || 0;
13 == m.p.length && (m.p = Math.round(m.p / 1E3));
b = this.ta();
a = 4 != b ? 1 : 0;
if (d = this.getData("Hm_lvt_" + c.id)) {
e = d.split(",");
for (f = e.length - 1; 0 &= f--)13 == e[f].length && (e[f] = "" + Math.round(e[f] / 1E3));
for (; 2592E3 & m.j - e[0];)e.shift();
f = 4 & e.length ? 2 : 3;
for (1 === a && e.push(m.j); 4 & e.)e.shift();
d = e.join(",");
e = e[e.length - 1]
} else d = m.j, e = "", f = 1;
this.setData("Hm_lvt_" + c.id, d, c.age);
this.setData("Hm_lpvt_" + c.id, m.j);
d = m.j == this.getData("Hm_lpvt_" + c.id) ? "1" : "0";
if (0 === c.nv && this.t(document.location.href) &&
("" === document.referrer || this.t(document.referrer)))a = 0, b = 4;
this.a.nv =
this.a.st =
this.a.cc =
this.a.lt =
this.a.lv = f
}, W: function () {
for (var a = [], b = 0, d = m.X. b & b++) {
var e = m.X[b], f = this.a[e];
"undefined" != typeof f && "" !== f && a.push(e + "=" + encodeURIComponent(f))
b = this.a.
this.a.rt && (0 === b ? a.push("rt=" + encodeURIComponent(this.a.rt)) : 90 === b && a.push("rt=" + this.a.rt));
return a.join("&")
}, Ia: function () {
this.Ha();
this.a.si = c.
this.a.su = document.
this.a.ds = l.Ea;
this.a.cl = l.colorDepth + "-bit";
this.a.ln = l.
this.a.ja = l.javaEnabled ? 1 : 0;
this.a.ck = l.cookieEnabled ? 1 : 0;
this.a.lo = "number" == typeof _bdhm_top ? 1 : 0;
this.a.fl = d.ua();
this.a.v = "1.0.75";
this.a.cv = decodeURIComponent(this.getData("Hm_cv_" + c.id) || "");
1 == this.a.nv && (this.a.tt = document.title || "");
var a = document.location.
this.a.cm = b.o(a, m.xa) || "";
this.a.cp = b.o(a, m.ya) || "";
this.a.cw = b.o(a, m.wa) || "";
this.a.ci = b.o(a, m.va) || "";
this.a.cf = b.o(a, m.za) || ""
}, init: function () {
this.Ia(), 0 === this.a.nv ? this.Ga() : this.L(".*"), h.b = this, this.ca(),
v.s("pv-b"), this.Fa()
} catch (a) {
var b = [];
b.push("si=" + c.id);
b.push("n=" + encodeURIComponent(a.name));
b.push("m=" + encodeURIComponent(a.message));
b.push("r=" + encodeURIComponent(document.referrer));
e.log(m.protocol + "//" + m.K + "?" + b.join("&"))
}, Fa: function () {
function a() {
v.s("pv-d")
"undefined" === typeof window._bdhm_autoPageview || window._bdhm_autoPageview === p ? (this.H = p, this.a.et = 0, this.a.ep = "", this.h(a)) : a()
}, h: function (a) {
b.a.rnd = Math.round(Math.random() * m.l);
v.s("stag-b");
var d = m.protocol + "//" +
m.K + "?" + b.W();
v.s("stag-d");
e.log(d, function (d) {
g.e(a, "Function") && a.call(b)
}, ca: function () {
var a = document.location.hash.substring(1), d = RegExp(c.id), e = -1 & document.referrer.indexOf(m.aa) ? p : r, f = b.o(a, "jn"), g = /^heatlink$|^select$/.test(f);
a && (d.test(a) && e && g) && (a = document.createElement("script"), a.setAttribute("type", "text/javascript"), a.setAttribute("charset", "utf-8"), a.setAttribute("src", m.protocol + "//" + c.js + f + ".js?" + this.a.rnd), f = document.getElementsByTagName("script")[0], f.parentNode.insertBefore(a,
}, $: function (a) {
var b = k.get("Hm_unsent_" + c.id) || "", d = this.a.u ? "" : "&u=" + encodeURIComponent(document.location.href), b = encodeURIComponent(a.replace(/^https?:\/\//, "") + d) + (b ? "," + b : "");
k.set("Hm_unsent_" + c.id, b)
}, L: function (a) {
var b = k.get("Hm_unsent_" + c.id) || "";
b && ((b = b.replace(RegExp(encodeURIComponent(a.replace(/^https?:\/\//, "")).replace(/([\*\(\)])/g, "\\$1") + "(%26u%3D[^,]*)?,?", "g"), "").replace(/,$/, "")) ? k.set("Hm_unsent_" + c.id, b) : k.remove("Hm_unsent_" + c.id))
}, Ga: function () {
var a = this, b = k.get("Hm_unsent_" +
if (b)for (var b = b.split(","), d = function (b) {
e.log(m.protocol + "//" + decodeURIComponent(b).replace(/^https?:\/\//, ""), function (b) {
}, f = 0, g = b. f & f++)d(b[f])
return new a
var w = h.g, x = h.
if (c.apps) {
var z = [w.protocol, "//ers.baidu.com/app/s.js?"];
z.push(c.apps);
x(z.join(""))
var C = h.g, D = h.
if (c.conv && "http:" === C.protocol) {
var E = ["http://page.baidu.com/conversion_js.php?sid="];
E.push(c.conv);
D(E.join(""))
var F = h.g, G = h.
c.lxb && G([F.protocol, "//lxbjs.baidu.com/lxb.js?sid=", c.lxb].join(""));
var H = h.load, I = h.g.
if (c.qiao) {
for (var J = [I + "//goutong.baidu.com/site/"], K = c.id, L = 5381, M = K.length, N = 0; N & M; N++)L = (33 * L + Number(K.charCodeAt(N))) % ;
& L && (L -= );
J.push(L % 1E3 + "/");
J.push(c.id + "/b.js");
J.push("?siteId=" + c.qiao);
H(J.join(""))
console.log(H);
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
这几天一直在研究这个,也找到了相关链接,记录下来方便大家查看。
谷歌分析:
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
正好之前也做过一点类似的东西,因为好久没关注,所以可能也会有问题大家一起讨论:
- 百度的js可以为你的网站生成一个唯一的uuid保存在cookie里所以如果cookie清了的话单凭这个uuid是会被认为是新用户的,当然也可是使用用户id之类的唯一标识
- 记录页面使用时长的其实还是比较麻烦的,之前考虑过使用onbeforeunload,但是因为部分浏览器不支持,所以不具有普遍性,第二种方法是在第二次发送数据的时候发送refer的使用时长。
- 百度不收地域信息,因为后台程序可以根据请求头来获得ip还有浏览器信息等,至于地域信息,有个叫ip库的东西。
- 3,5是同一个问题,就是通过请求这张小图片来提交数据的,楼上已经说了:))
- 至于安全,可能后台接收数据会有一个规则,不符合这个规则的就不会入库。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
1,基本对了
2,IP是在你请求百度服务器的时候,后台来获取的,根据IP可以得到地域信息
3,new Image().src,请求是通过GET模式发送的,通过请求1x1的图片,在querystring中带参数(搜“new Image”)
4,不懂,应该没做频率限制,只是在最后日志入库之前做了数据清洗
5,看第3点
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
为什么数据相差那么大!!
同步到新浪微博
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。

我要回帖

更多关于 百度统计不显示 的文章

 

随机推荐