-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalytics.html
125 lines (105 loc) · 5.99 KB
/
analytics.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html>
<!-- Mirrored from digitalvaiven.tumblr.com/analytics.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 23 Mar 2020 22:58:36 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
<title>Tumblr</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="icon" href="http://assets.tumblr.com/images/favicons/favicon.ico?_v=a891a6916b745ae20be499f98db2f875" type="image/gif"/>
<script type="text/javascript">
function log(message) {
if (debug) console.log(message);
}
var user_logged_in = 'No';
var blog_is_nsfw = 'No';
var parent_origin = location.hash.slice(1);
window.parent.postMessage('analytics_iframe_loaded', parent_origin);
var Tumblr = {
Analytics: {
get_cookie: function (name){
return new RegExp(name+"=([^;]+)").test(unescape(document.cookie)) ? RegExp.$1 : null;
},
set_cookie: function(name, value, expire_seconds, opts) {
opts = opts || {};
var ex_date = new Date();
var path = opts.path ? opts.path : '/';
var is_secure = opts.is_secure ? true : false;
var domain = opts.domain ? opts.domain : '';
ex_date.setTime(ex_date.getTime() + (expire_seconds * 1000));
document.cookie = name + "=" + escape(value)
+ ((expire_seconds == null) ? "" : ";expires=" + ex_date.toGMTString())
+ ';path=' + path
+ ((is_secure === false) ? '' : ';secure')
+ ((domain === '') ? '' : ';domain=' + domain);
},
unset_cookie: function(name) {
this.set_cookie(name, '', -1);
},
create_post_message_listener: function() {
// http://davidwalsh.name/window-iframe
// Create IE + others compatible event handler
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
// Listen to message from child window
eventer(messageEvent,function(e) {
var message = (e.data && e.data.split) ? e.data.split(';') : '';
Tumblr.Analytics.handle_post_message(message, e.origin);
}, false);
},
handle_post_message: function(message, origin) {
switch (message[0]) {
case 'openInMobileApp':
var post_id = parseInt(message[1]),
custom_event = ['_trackEvent', 'Mobile', 'Clicked', 'Open in Mobile App', post_id ];
parent.postMessage('openInMobileAppSuccess' + ';' + post_id, message[2]);
break;
case 'enable_comscore':
case 'tick_comscore':
var url = message[1];
log({ c1: "7", c2: 15742520, c4: url });
log({ c1: "2", c2: 15742520, c4: url });
if (typeof(COMSCORE) !== 'undefined') {
COMSCORE.beacon({ c1: '7', c2: '15742520', c4: url });
COMSCORE.beacon({ c1: '2', c2: '15742520', c4: url });
} else {
_comscore.push({ c1: "7", c2: 15742520, c4: url });
_comscore.push({ c1: "2", c2: 15742520, c4: url });
var s = document.createElement("script"),
el = document.getElementsByTagName("script")[0];
s.async = true;
s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/c2/15742520/cs.js";
el.parentNode.insertBefore(s, el);
}
break;
case 'tick_related_post':
// temporary disabled
break;
}
},
get_url_var: function(get_var, url) {
url = url || window.location.href
var vars = {};
url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
if (get_var) {
return vars[get_var];
} else {
return vars;
}
},
}
};
var debug = false
, _comscore = _comscore || [];
Tumblr.Analytics.create_post_message_listener();
</script>
<noscript><img src="https://sb.scorecardresearch.com/p?c1=7&c2=15742520&cv=2.0&cj=1" /></noscript>
<noscript><img src="https://sb.scorecardresearch.com/p?c1=2&c2=15742520&cv=2.0&cj=1" /></noscript>
</head>
<body>
</body>
<!-- Mirrored from digitalvaiven.tumblr.com/analytics.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 23 Mar 2020 22:58:36 GMT -->
</html>