PageSourceSearch

https://www.zerich.com/themes/zericheu/js/zerich/components/getutm.js

js zerich.com collected 2026-10-02 19:12:04 UTC 1,864 bytes, 56 lines download raw bytes

1function getUrlVars() {
2    var vars = [], hash;
3    var get_url = window.location.href.split("?");
4    if (get_url[2] != undefined) {
5        var hashes = get_url[2].split('&');
6        for (var i = 0; i < hashes.length; i++) {
7            hash = hashes[i].split('=');
8            vars.push(hash[0]);
9            vars[hash[0]] = hash[1];
10        }
11        console.log('get_url[2]');
12        console.log(vars);
13        return vars;
14    } else if (get_url[1] != undefined) {
15        var hashes = get_url[1].split('&');
16        for (var i = 0; i < hashes.length; i++) {
17            hash = hashes[i].split('=');
18            vars.push(hash[0]);
19            vars[hash[0]] = hash[1];
20        }
21        console.log('get_url[1]');
22        console.log(vars);
23        return vars;
24
25    } else {
26        return false;
27    }
28}
29var get_utm = getUrlVars();
30if (get_utm != false) {
31    var new_utm = {};
32    new_utm.term = get_utm['utm_term'];
33    new_utm.source = get_utm['utm_source'];
34    new_utm.content = get_utm['utm_content'];
35    new_utm.campaign = get_utm['utm_campaign'];
36    new_utm.medium = get_utm['utm_medium'];
37    if (get_utm) {
38        var get_cookie = Cookies.get('utm');
39        if (get_cookie != undefined) {
40            var parse_cookie = JSON.parse(get_cookie);
41            if (get_utm['utm_term'] != parse_cookie) {
42                Cookies.set('utm', new_utm, {expires: 180});
43            }
44        } else {
45            Cookies.set('utm', new_utm, {expires: 180});
46            if (get_utm['utm_source'] === 'actionpay') {
47                Cookies.set('utm_actionpay', {
48                    actionpay: get_utm['actionpay'],
49                    utm_source: get_utm['utm_source'],
50                    utm_medium: get_utm['utm_medium'],
51                    utm_campaign: get_utm['utm_campaign']
52                }, {expires: 180})
53            }
54        }
55    }
56}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.