PageSourceSearch

https://www.classonlive.com/js_common/own/gtmManage.js?v1

js classonlive.com collected 2026-10-03 21:18:43 UTC 5,882 bytes, 211 lines download raw bytes

1//@ sourceURL=gtmManage.js
2var full = window.location.host;
3var gtmReady=$.Deferred();
4
5
6// Cloudflare Analytics puede cargarse sin consentimiento
7if (window.location.host != "localhost:8443") {
8    insertCloudflareAnalytics();
9}
10
11
12function activateOwnTracking() {
13
14    if (window.ownTrackingDidInit) {
15        return;
16    }
17
18    window.ownTrackingDidInit = true;
19
20    initGTM();
21    activateGTM();
22    
23    activatePosthog();
24
25    gtmReady.resolve();
26
27    setTimeout(function () {
28
29        activateFirstPromoter();
30
31        if (
32            logInfo == undefined ||
33            logInfo == null ||
34            logInfo.userType.userType == "Teacher"
35        ) {
36            initIntercom();
37        }
38
39    }, 3000);
40}
41
42function gtag(){
43          dataLayer.push(arguments);
44}
45
46function initGTM() {
47    if (window.gtmDidInit) {
48        return false;
49    }
50    window.gtmDidInit = true; // flag to ensure script does not get added to DOM more than once.
51    const script = document.createElement('script');
52    script.type = 'text/javascript';
53    script.async = true;
54    // ensure PageViews is always tracked (on script load)
55    script.onload = () => {
56        dataLayer.push({ event: 'gtm.js', 'gtm.start': new Date().getTime(), 'gtm.uniqueEventId': 0 });
57        gtag('js', new Date());
58        gtag('config', 'G-150PK3N92H', { 'allow_enhanced_conversions': true });
59        ////gtag('config', 'UA-46203064-1',{'allow_enhanced_conversions':true});
60        gtag('config', 'AW-981162706', { 'allow_enhanced_conversions': true });
61    };
62    script.src = 'https://www.googletagmanager.com/gtag/js?id=G-150PK3N92H';
63    document.head.appendChild(script);
64}
65
66function activateGTM() {
67
68    if (window.gtmContainerDidInit) {
69        return;
70    }
71
72    window.gtmContainerDidInit = true;
73
74    var gtmId = "GTM-TNJP2Q9";
75
76    (function (w, d, s, l, i) {
77
78        w[l] = w[l] || [];
79
80        w[l].push({
81            'gtm.start': new Date().getTime(),
82            event: 'gtm.js'
83        });
84
85        var f = d.getElementsByTagName(s)[0],
86            j = d.createElement(s),
87            dl = l != 'dataLayer'
88                ? '&l=' + l
89                : '';
90
91        j.async = true;
92
93        j.src =
94            'https://www.googletagmanager.com/gtm.js?id='
95            + i
96            + dl;
97
98        f.parentNode.insertBefore(j, f);
99
100    })(window, document, 'script', 'dataLayer', gtmId);
101}
102
103
104function activatePosthog() {
105
106    if (window.posthogDidInit) {
107        return;
108    }
109
110    window.posthogDidInit = true;
111
112    var script = document.createElement('script');
113
114    script.src = '/js/posthog.js';
115
116    script.async = true;
117
118    script.onload = function () {
119        console.log('posthog.js cargado correctamente');
120    };
121
122    script.onerror = function () {
123        console.error('Error al cargar posthog.js');
124    };
125
126    document.head.appendChild(script);
127}
128
129function activateClarity() {
130
131    if (window.clarityDidInit) {
132        return;
133    }
134
135    window.clarityDidInit = true;
136
137    const script = document.createElement('script');
138
139    script.src = '/private/panel/common/js/clarity.js';
140    script.async = true;
141
142    script.onload = function () {
143
144        console.log('clarity.js cargado correctamente');
145
146        if (
147            typeof clarity !== 'undefined' &&
148            typeof logInfo !== 'undefined' &&
149            logInfo
150        ) {
151
152            clarity(
153                "identify",
154                "usr_" + logInfo.userId
155            );
156
157            if (
158                logInfo.loginAttempts &&
159                logInfo.loginAttempts == 1
160            ) {
161                clarity(
162                    "set",
163                    "user_stage",
164                    "first_login"
165                );
166            }
167        }
168    };
169
170    script.onerror = function () {
171        console.error('Error al cargar clarity.js');
172    };
173
174    document.head.appendChild(script);
175}
176
177function insertCloudflareAnalytics() {
178    if (window.cloudflareDidInit) {
179
180        return false;
181    }
182    window.cloudflareDidInit = true;
183    const script = document.createElement("script");
184    script.defer = true;
185    script.src = "https://static.cloudflareinsights.com/beacon.min.js";
186    script.setAttribute("data-cf-beacon", '{"token": "6ff2387954fc464e800025ea1a44d408"}');
187    document.body.appendChild(script);
188
189}
190
191function activateFirstPromoter() {
192    (function () {
193        var t = document.createElement("script");
194        t.type = "text/javascript", t.async = !0, t.src = 'https://cdn.firstpromoter.com/fprom.js', t.onload = t
195            .onreadystatechange = function () {
196                var t = this.readyState;
197                if (!t || "complete" == t || "loaded" == t) try {
198                    $FPROM.init("1xjjyfiw", "classonlive.com")
199                } catch (t) { }
200            };
201        var e = document.getElementsByTagName("script")[0];
202        e.parentNode.insertBefore(t, e)
203    })();
204}
205
206function initIntercom() {
207    window.intercomSettings = {
208        app_id: "lwmhd6cy"
209    };
210    (function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/lwmhd6cy'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
211}

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.