-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (40 loc) · 1.33 KB
/
Copy pathscript.js
File metadata and controls
43 lines (40 loc) · 1.33 KB
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
/*!
* ABV AdTracking v1.0
* https://github.com/ABVanton200/ABV-AdTracking
*
* Copyright Anton Babakhin
* Released under the MIT license
* https://github.com/ABVanton200/ABV-AdTracking/blob/master/LICENSE.md
*
* Date: 2018-01-02
*/
(function (d, w, p, s, k, v, e) {
var urlVar = w.location.search,
urlAssoc = urlVar.substr(1).split("&"),
index = urlAssoc.indexOf( k + "=" + v ),
r = function(){
this.innerHTML = p;
},
f = function(){
var phones = d.querySelectorAll(s),
i = 0;
for( ; i < phones.length; i++ ){
r.call( phones[i] );
}
},
get = function( name ){
var matches = d.cookie.match(new RegExp(
"(?:^|; )" + name + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
},
set = function(){
var date = new Date(new Date().getTime() + 1296000000);
d.cookie = "_ABV_AdTracking=ad; path=/; expires=" + date.toUTCString();
};
if ( (index != -1 || get("_ABV_AdTracking")) && e == "enable" ){
f();
w.addEventListener( "DOMContentLoaded", f, false );
set();
}
})(document, window, "(812) XXX XX XX", ".ya-phone", "utm_medium", "cpc", "enable");