1window.dataLayer = window.dataLayer || []; 2 3$(function () { 4 //GTM - For "data-gtm" identifiers 5 $('[data-gtm]').on('click', fnPushGTMData); 6}); 7 8var fnPush2DL = function (pushThis) { // common function to push data to layer (dataLayer) 9 // console.log(typeof(pushThis)); 10 if(typeof(pushThis) == "string") { 11 // pushThis.replace(/'/g,'"'); 12 pushThis = JSON.parse(pushThis); 13 } 14 if (window.dataLayer) { 15 // console.log("Before >>" + dataLayer); 16 window.dataLayer.push(pushThis); 17 // console.log("After >>" + dataLayer); 18 } 19}, 20fnPushGTMData = function () { 21 // <a href="#" data-gtm="{'event':'gild.event','eventCategory':'Brochures','eventAction':'Downloaded','eventLabel':'Supporting Family Members','intendedAudience':'Family/Caregiver','subject':'Patient Support','language':'English'}">GTM Event Element</a> 22 if ($(this).data("gtm")) { 23 fnPush2DL($(this).data("gtm")); 24 } 25};
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.