PageSourceSearch

https://app.monarch.com/analytics.js

js monarch.com collected 2026-10-03 21:23:28 UTC 2,796 bytes, 78 lines download raw bytes

1!(function () {
2  var i = 'analytics',
3    analytics = (window[i] = window[i] || []);
4  if (!analytics.initialize) {
5    if (analytics.invoked)
6      window.console && console.error && console.error('Segment snippet included twice.');
7    else {
8      analytics.invoked = true;
9      analytics.methods = [
10        'trackSubmit',
11        'trackClick',
12        'trackLink',
13        'trackForm',
14        'pageview',
15        'identify',
16        'reset',
17        'group',
18        'track',
19        'ready',
20        'alias',
21        'debug',
22        'page',
23        'screen',
24        'once',
25        'off',
26        'on',
27        'addSourceMiddleware',
28        'addIntegrationMiddleware',
29        'setAnonymousId',
30        'addDestinationMiddleware',
31        'register',
32      ];
33      analytics.factory = function (e) {
34        return function () {
35          if (window[i].initialized) return window[i][e].apply(window[i], arguments);
36          var n = Array.prototype.slice.call(arguments);
37          if (['track', 'screen', 'alias', 'group', 'page', 'identify'].indexOf(e) > -1) {
38            var c = document.querySelector("link[rel='canonical']");
39            n.push({
40              __t: 'bpc',
41              c: (c && c.getAttribute('href')) || undefined,
42              p: location.pathname,
43              u: location.href,
44              s: location.search,
45              t: document.title,
46              r: document.referrer,
47            });
48          }
49          n.unshift(e);
50          analytics.push(n);
51          return analytics;
52        };
53      };
54      for (var n = 0; n < analytics.methods.length; n++) {
55        var key = analytics.methods[n];
56        analytics[key] = analytics.factory(key);
57      }
58      analytics.load = function (key, n) {
59        var t = document.createElement('script');
60        t.type = 'text/javascript';
61        t.async = true;
62        t.setAttribute('data-global-segment-analytics-key', i);
63        t.src = 'https://events-cdn.monarch.com/v1/' + key + '/events-script';
64        var r = document.getElementsByTagName('script')[0];
65        r.parentNode.insertBefore(t, r);
66        analytics._loadOptions = n;
67        // Route all Segment CDN requests (settings, bundles) through our first-party proxy.
68        // Without this, the SDK's auto-detection regex fails on our obfuscated /events-script
69        // path and falls back to cdn.segment.com for settings + bundle fetches.
70        // This must be set before the SDK script loads (cdnURL in load() options arrives too late).
71        // Safe now that CIO uses globalAnalyticsKey:'cioanalytics' (#8724) so it no longer
72        // shares/overwrites window.analytics._cdn with Segment.
73        analytics._cdn = 'https://events-cdn.monarch.com';
74      };
75      analytics.SNIPPET_VERSION = '5.2.0';
76    }
77  }
78})();

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.