PageSourceSearch

https://www.mmawarehouse.com/cdn/shop/t/111/assets/mma-trustpilot-tracking.js?v=110575238244916256411785314325

js mmawarehouse.com collected 2026-10-03 21:29:29 UTC 6,416 bytes, 2 lines download raw bytes

1(function(){"use strict";var GA4_MEASUREMENT_ID="G-PKHVJ3LX7Z",TRACKING_VERSION="trustpilot_engagement_20260722_v1",WIDGET_SELECTOR=".mma-trustpilot-widget[data-mma-trustpilot-placement]",trackedImpressions=new Set,lastTrackedFrame=null,pendingBlurSequence=0,recordedBlurSequence=0;function getCookie(name){var prefix=name+"=",item=document.cookie.split("; ").find(function(cookie){return cookie.indexOf(prefix)===0});return item?decodeURIComponent(item.slice(prefix.length)):""}function analyticsAllowed(){try{var privacy=window.Shopify&&window.Shopify.customerPrivacy;if(privacy&&typeof privacy.analyticsProcessingAllowed=="function")return privacy.analyticsProcessingAllowed()}catch(error){return!1}return!0}function gaClientId(){var gaCookie=getCookie("_ga"),parts=gaCookie.split(".");if(parts.length>=4)return parts.slice(-2).join(".");var storageKey="mma_trustpilot_ga_cid";try{var stored=window.sessionStorage.getItem(storageKey);if(stored)return stored;var generated=Math.floor(Math.random()*2147483647)+"."+Math.floor(Date.now()/1e3);return window.sessionStorage.setItem(storageKey,generated),generated}catch(error){return Math.floor(Math.random()*2147483647)+"."+Math.floor(Date.now()/1e3)}}function gaSessionId(){var cookieName="_ga_"+GA4_MEASUREMENT_ID.replace("G-",""),match=getCookie(cookieName).match(/\$s(\d+)/);return match?match[1]:String(Math.floor(Date.now()/1e3))}function pageType(){var className=document.documentElement.className||"",match=className.match(/(?:^|\s)template-([^\s]+)/);return match?match[1]:window.location.pathname==="/"?"index":window.location.pathname.split("/").filter(Boolean)[0]||"unknown"}function productHandle(){var match=window.location.pathname.match(/^\/products\/([^/?#]+)/);return match?match[1]:""}function eventPayload(widget,interactionMethod){return{trustpilot_placement:widget.dataset.mmaTrustpilotPlacement||"unknown",widget_template_id:widget.dataset.templateId||"",page_type:pageType(),page_path:window.location.pathname,product_handle:productHandle(),interaction_method:interactionMethod||"",tracking_version:TRACKING_VERSION}}function sendGa4Event(name,payload){if(analyticsAllowed()){var query=new URLSearchParams({v:"2",tid:GA4_MEASUREMENT_ID,cid:gaClientId(),en:name,_p:String(Date.now()),dl:window.location.href,dt:document.title,sr:window.screen.width+"x"+window.screen.height,ul:(navigator.language||"en-us").toLowerCase(),sid:gaSessionId(),sct:"1",seg:"1"});Object.entries(payload).forEach(function(entry){var key=entry[0],value=entry[1];if(!(value==null||value==="")){var prefix=typeof value=="number"?"epn":"ep";query.set(prefix+"."+key,String(value))}});var endpoint="https://region1.analytics.google.com/g/collect?"+query.toString(),sent=!1;try{sent=typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(endpoint,"")}catch(error){sent=!1}!sent&&typeof window.fetch=="function"&&window.fetch(endpoint,{method:"POST",mode:"no-cors",keepalive:!0}).catch(function(){})}}function publish(widget,action,interactionMethod){if(widget){var placement=widget.dataset.mmaTrustpilotPlacement;if(placement){var eventName="trustpilot_"+placement+"_"+action,payload=eventPayload(widget,interactionMethod);sendGa4Event(eventName,payload);try{window.Shopify&&window.Shopify.analytics&&typeof window.Shopify.analytics.publish=="function"&&window.Shopify.analytics.publish(eventName,payload)}catch(error){}document.dispatchEvent(new CustomEvent("mma:trustpilot-engagement",{detail:Object.assign({event:eventName},payload)}))}}}function widgetForFrame(frame){return frame&&frame.closest?frame.closest(WIDGET_SELECTOR):null}function activeTrustpilotFrame(){var active=document.activeElement;return active&&active.tagName==="IFRAME"&&widgetForFrame(active)?active:null}function recordFocusedFrame(method){window.setTimeout(function(){var frame=activeTrustpilotFrame();!frame||frame===lastTrackedFrame||(lastTrackedFrame=frame,recordedBlurSequence=pendingBlurSequence,publish(widgetForFrame(frame),"click",method))},0)}function observeImpressions(){if(!("IntersectionObserver"in window))return;function recordImpressionIfReady(widget){var placement=widget.dataset.mmaTrustpilotPlacement;widget.dataset.mmaTrustpilotVisible!=="true"||!placement||trackedImpressions.has(placement)||!widget.querySelector("iframe")||(trackedImpressions.add(placement),publish(widget,"impression","intersection_50"))}var observer=new IntersectionObserver(function(entries){entries.forEac
1h(function(entry){var widget=entry.target;widget.dataset.mmaTrustpilotVisible=String(entry.isIntersecting&&entry.intersectionRatio>=.5),recordImpressionIfReady(widget)})},{threshold:[.5]});function addWidgets(root){var widgets=[];root.nodeType===1&&root.matches&&root.matches(WIDGET_SELECTOR)&&widgets.push(root),root.querySelectorAll&&(widgets=widgets.concat(Array.from(root.querySelectorAll(WIDGET_SELECTOR)))),widgets.forEach(function(widget){widget.dataset.mmaTrustpilotImpressionObserved!=="true"&&(widget.dataset.mmaTrustpilotImpressionObserved="true",observer.observe(widget))})}addWidgets(document),new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){addWidgets(node);var widget=widgetForFrame(node);widget&&recordImpressionIfReady(widget)})})}).observe(document.documentElement,{childList:!0,subtree:!0})}document.addEventListener("click",function(event){var link=event.target.closest&&event.target.closest(WIDGET_SELECTOR+" > a");link&&publish(link.closest(WIDGET_SELECTOR),"click","fallback_link")},!0),document.addEventListener("pointerdown",function(event){(!event.target.closest||!event.target.closest(WIDGET_SELECTOR))&&(lastTrackedFrame=null)},!0),window.addEventListener("blur",function(){pendingBlurSequence+=1,recordFocusedFrame("iframe_focus_blur")}),window.addEventListener("focus",function(){recordedBlurSequence!==pendingBlurSequence&&recordFocusedFrame("iframe_focus_return"),window.setTimeout(function(){var frame=activeTrustpilotFrame();frame&&typeof frame.blur=="function"&&frame.blur(),lastTrackedFrame=null},100)}),document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&recordFocusedFrame("iframe_focus_hidden")}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",observeImpressions,{once:!0}):observeImpressions()})();
2//# sourceMappingURL=/cdn/shop/t/111/assets/mma-trustpilot-tracking.js.map?v=110575238244916256411785314325

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.