Skip to content

Commit c95953a

Browse files
committed
analytics
1 parent 25ad711 commit c95953a

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

public/assets/js/analytics.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// analytics.js - Heavily obfuscated analytics module
21
(function() {
32
'use strict';
43

5-
// Obfuscated constants
64
const _0x1a2b = {
75
a: 'dataLayer',
86
b: 'push',
@@ -14,57 +12,44 @@
1412
h: 'head'
1513
};
1614

17-
// ROT13 + Base64 encoded tracking ID: "G-WKJQ5QHQTJ"
1815
const _tid = atob('Ry1XS0pRNVFIUVRK');
1916

20-
// Obfuscated Google Analytics URL
2117
const _urls = [
22-
atob('aHR0cHM6Ly93d3cu'), // https://www.
23-
atob('Z29vZ2xldGFnbWFuYWdlci5jb20='), // googletagmanager.com
24-
atob('L2d0YWcvanM=') // /gtag/js
18+
atob('aHR0cHM6Ly93d3cu'),
19+
atob('Z29vZ2xldGFnbWFuYWdlci5jb20='),
20+
atob('L2d0YWcvanM=')
2521
];
2622

27-
// Initialize tracking
2823
const _init = () => {
29-
// Create dataLayer if it doesn't exist
3024
window[_0x1a2b.a] = window[_0x1a2b.a] || [];
3125

32-
// Obfuscated gtag function
3326
const _fn = (...args) => window[_0x1a2b.a][_0x1a2b.b](args);
3427

35-
// Set up tracking
3628
_fn(_0x1a2b.c, new Date());
3729
_fn(_0x1a2b.d, _tid);
3830

39-
// Dynamically load the script
4031
const _script = document.createElement(_0x1a2b.e);
4132
_script[_0x1a2b.f] = _urls.join('') + '?id=' + _tid;
4233
_script[_0x1a2b.g] = true;
4334
document[_0x1a2b.h].appendChild(_script);
4435

45-
// Make gtag globally available but with obfuscated name
4636
window._track = _fn;
4737
};
4838

49-
// Initialize on DOM ready
5039
if (document.readyState === 'loading') {
5140
document.addEventListener('DOMContentLoaded', _init);
5241
} else {
5342
_init();
5443
}
5544

56-
// Anti-debugging measures
5745
const _protect = () => {
58-
// Basic console detection
5946
let devtools = {open: false, orientation: null};
6047
const threshold = 160;
6148
setInterval(() => {
6249
if (window.outerHeight - window.innerHeight > threshold ||
6350
window.outerWidth - window.innerWidth > threshold) {
6451
if (!devtools.open) {
6552
devtools.open = true;
66-
// Optionally disable tracking when devtools detected
67-
// window._track = () => {};
6853
}
6954
} else {
7055
devtools.open = false;

0 commit comments

Comments
 (0)