Created
August 9, 2012 05:53
-
-
Save firedfox/3301451 to your computer and use it in GitHub Desktop.
analytics code for tieba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _hmt = _hmt || []; | |
$(function () { | |
$.getJSON("/f/user/json_userinfo?_=" + new Date().getTime(), function (response) { | |
var userInfo = response.data; | |
if (userInfo.is_login) { | |
console.log("login") | |
_hmt.push(['_setCustomVar', 1, 'login', 1]); | |
} else { | |
console.log("not_login"); | |
_hmt.push(['_setCustomVar', 1, 'login', 0]); | |
} | |
var hm = document.createElement("script"); | |
hm.src = ("https:" == document.location.protocol ? "https:" : "http:") + "//hm.baidu.com/h.js?dfc44cb6724d4d64aff0189edd0b4d95"; | |
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment