PageSourceSearch

https://www.supercheapauto.co.nz/on/demandware.static/Sites-superc…/-/en_NZ/v1790551372172/lib/ga4.js

js supercheapauto.co.nz collected 2026-09-28 06:45:41 UTC 1,417 bytes, 46 lines download raw bytes

1'use strict';
2
3window.GA4 = (function () {
4    var GA4Manager = {
5        updateDataLayerByJson : function(jsonData) {
6            if(typeof gtmEnabled == "undefined") {
7                return;
8            }
9
10            if (typeof dataLayer !== "undefined" && dataLayer != null) {
11                dataLayer.push(jsonData);
12            }
13        },
14        updateDataLayerByJsonString : function(jsonString) {
15            if(typeof gtmEnabled == "undefined") {
16                return;
17            }
18
19            if (typeof dataLayer !== "undefined" && dataLayer != null){
20                var jsonData = JSON.parse(jsonString);
21                this.updateDataLayerByJson(jsonData);
22            }
23        },
24        updateDataLayerByElem : function(elem) {
25            if(typeof gtmEnabled == "undefined" || typeof elem == "undefined") {
26                return;
27            }
28
29            var ga4Value = elem.getAttribute('data-ga4');
30
31            if (!ga4Value) return;
32
33            this.updateDataLayerByJsonString(decodeURIComponent(ga4Value));
34        },
35        initContentClick: function (containerId) {
36            var container = document.getElementById(containerId);
37
38            if (container) {
39                container.addEventListener('click', function (e) {
40                    GA4Manager.updateDataLayerByElem(this);
41                }, false)
42            }
43        }
44    };
45    return GA4Manager;
46}());

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.