PageSourceSearch

https://www.betlegendpicks.com/blp-events.js

js betlegendpicks.com collected 2026-10-09 22:08:31 UTC 2,590 bytes, 61 lines download raw bytes

1/* BetLegendPicks conversion events (Oct 1 2026).
2   Sends GA4 events through the page's existing gtag (G-QS8L5TDNLY). Safe when gtag
3   is missing or blocked: events are pushed to dataLayer and nothing else happens.
4
5   pro_cta_click      any element with data-pro-cta (the contextual Pro module)
6                      params: page_type, sport, source_url, cta_variant, destination
7   email_signup_view  an email form scrolled into view      (form[data-email-form])
8   email_signup_submit / email_signup_success / email_signup_error
9                      params: signup_source, list, page_type, sport, source_url
10   Links to the Pro checkout also carry utm_source=betlegendpicks so TrustMyRecord's
11   GA4 sees the arrival, checkout starts and purchases with the same campaign tags. */
12(function () {
13  'use strict';
14  if (window.blpTrack) return; // the Pro and email modules both include this file
15  window.dataLayer = window.dataLayer || [];
16  function send(name, params) {
17    params = params || {};
18    params.source_url = params.source_url || location.pathname;
19    try {
20      if (typeof window.gtag === 'function') {
21        window.gtag('event', name, Object.assign({ transport_type: 'beacon' }, params));
22      } else {
23        window.dataLayer.push(Object.assign({ event: name }, params));
24      }
25    } catch (e) { /* analytics must never break the page */ }
26  }
27  window.blpTrack = send;
28
29  document.addEventListener('click', function (ev) {
30    var a = ev.target && ev.target.closest ? ev.target.closest('[data-pro-cta]') : null;
31    if (!a) return;
32    send('pro_cta_click', {
33      page_type: a.getAttribute('data-page-type') || '',
34      sport: a.getAttribute('data-sport') || '',
35      cta_variant: a.getAttribute('data-pro-cta') || '',
36      destination: (a.href || '').split('?')[0]
37    });
38  }, true);
39
40  if ('IntersectionObserver' in window) {
41    var seen = false;
42    var io = new IntersectionObserver(function (entries) {
43      entries.forEach(function (en) {
44        if (!en.isIntersecting || seen) return;
45        seen = true;
46        var f = en.target;
47        send('email_signup_view', {
48          signup_source: f.getAttribute('data-source') || '',
49          list: f.getAttribute('data-list') || '',
50          page_type: f.getAttribute('data-page-type') || '',
51          sport: f.getAttribute('data-sport') || ''
52        });
53        io.disconnect();
54      });
55    }, { threshold: 0.5 });
56    document.addEventListener('DOMContentLoaded', function () {
57      var f = document.querySelector('form[data-email-form]');
58      if (f) io.observe(f);
59    });
60  }
61})();

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.