PageSourceSearch

https://aistudio.com.sg/scripts/cna-measurement.js?v=c1d183687d6a

js aistudio.com.sg collected 2026-10-09 22:59:38 UTC 1,686 bytes, 38 lines download raw bytes

1/* Measures press discovery and onward actions; never collects form content or query strings. */
2(function () {
3  'use strict';
4  if (window.aiStudioPressMeasurement) return;
5  window.aiStudioPressMeasurement = true;
6  function emit(action, placement) {
7    if (typeof window.gtag !== 'function') return;
8    try {
9      window.gtag('event', 'press_' + action, {
10        coverage_id: 'cna_2026_08_24',
11        placement: placement,
12        page_path: window.location.pathname,
13        measurement_version: '2026-09-10'
14      });
15    } catch (_) { /* Measurement must never block navigation. */ }
16  }
17  var actions = ['source', 'article', 'portfolio', 'service', 'enquiry'];
18  document.addEventListener('click', function (event) {
19    var anchor = event.target && event.target.closest ? event.target.closest('a[data-press-action]') : null;
20    if (!anchor) return;
21    var action = anchor.getAttribute('data-press-action');
22    if (actions.indexOf(action) === -1) return;
23    emit(action + '_click', anchor.getAttribute('data-press-placement') || 'unspecified');
24  });
25  function observe() {
26    if (!('IntersectionObserver' in window)) return;
27    var observer = new IntersectionObserver(function (entries) {
28      entries.forEach(function (entry) {
29        if (!entry.isIntersecting) return;
30        emit('view', entry.target.getAttribute('data-press-impression'));
31        observer.unobserve(entry.target);
32      });
33    }, {threshold: 0.25});
34    document.querySelectorAll('[data-press-impression]').forEach(function (element) {observer.observe(element);});
35  }
36  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', observe);
37  else observe();
38}());

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.