1// $track 彿°å®ä¹ 2(function (w, d, s, l, i) { 3 w[l] = w[l] || []; 4 w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); 5 const f = d.getElementsByTagName(s)[0]; 6 const j = d.createElement(s); 7 const dl = l != 'dataLayer' ? '&l=' + l : ''; 8 j.async = true; 9 j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 10 f.parentNode.insertBefore(j, f); 11 w[l].push(['js', new Date()]); 12 w[l].push(['config', 'AW-10837261960']); 13 const whiteListParams = [ 14 'id', 15 'type', 16 'pro_type', 17 'user_email', 18 'source', 19 'type_name', 20 'Ecommerce_value', 21 'model_id', 22 'scene_template_id', 23 'scene_type', 24 'count', 25 'time', 26 'sort_type', 27 'model_no', 28 'page_location', 29 'sort_name', 30 'status', 31 'diff', 32 'pageview', 33 ]; 34 w.$track = async ({ event, ...data }) => { 35 // æ°äºä»¶ï¼TAG_ åç¼èµ°ç»ä¸éé 36 if (typeof event === 'string' && event.startsWith('TAG_')) { 37 // éªè¯ä¼ å ¥çåæ°æ¯å¦å¨ç½ååä¸ 38 const invalidParams = Object.keys(data).filter((key) => !whiteListParams.includes(key)); 39 if (invalidParams.length > 0) { 40 console.error( 41 `[Track Error] Invalid parameters for TAG_ event "${event}":`, 42 invalidParams, 43 '\nAllowed parameters:', 44 whiteListParams, 45 ); 46 } 47 window.dataLayer?.push({ 48 event: 'pac_custom_event', 49 origin_pageview_name: event.slice(4), 50 ...data, 51 }); 52 return; 53 } 54 // å¤çåå² pageview äºä»¶ 55 if (typeof event === 'string' && event.includes('pageview')) { 56 data.origin_pageview_name = event; 57 event = 'pac_custom_pageview'; 58 window.dataLayer?.push({ event, ...data }); 59 return; 60 } 61 62 // æ§äºä»¶ï¼ä¿æåæè¡ä¸º 63 if (event) { 64 window.dataLayer?.push({ event, ...data }); 65 } else { 66 window.dataLayer?.push(data); 67 } 68 }; 69 j.onload = () => {}; 70})(window, document, 'script', 'dataLayer', 'GTM-K44XR23');
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.