(window.gaDevIds=window.gaDevIds||[]).push('BwiEti'); (function () { var customDocumentWrite = function(content) { var jquery = null; if (window.jQuery) { jquery = window.jQuery; } else if (window.Checkout && window.Checkout.$) { jquery = window.Checkout.$; } if (jquery) { jquery('body').append(content); } }; var hasLoggedConversion = function(token) { if (token) { return document.cookie.indexOf('loggedConversion=' + token) !== -1; } return false; } var setCookieIfConversion = function(token) { if (token) { var twoMonthsFromNow = new Date(Date.now()); twoMonthsFromNow.setMonth(twoMonthsFromNow.getMonth() + 2); document.cookie = 'loggedConversion=' + token + '; expires=' + twoMonthsFromNow; } } var trekkie = window.ShopifyAnalytics.lib = window.trekkie = window.trekkie || []; if (trekkie.integrations) { return; } trekkie.methods = [ 'identify', 'page', 'ready', 'track', 'trackForm', 'trackLink' ]; trekkie.factory = function(method) { return function() { var args = Array.prototype.slice.call(arguments); args.unshift(method); trekkie.push(args); return trekkie; }; }; for (var i = 0; i < trekkie.methods.length; i++) { var key = trekkie.methods[i]; trekkie[key] = trekkie.factory(key); } trekkie.load = function(config) { trekkie.config = config || {}; trekkie.config.initialDocumentCookie = document.cookie; var first = document.getElementsByTagName('script')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.onerror = function(e) { var scriptFallback = document.createElement('script'); scriptFallback.type = 'text/javascript'; scriptFallback.onerror = function(error) { var Monorail = { produce: function produce(monorailDomain, schemaId, payload) { var currentMs = new Date().getTime(); var event = { schema_id: schemaId, payload: payload, metadata: { event_created_at_ms: currentMs, event_sent_at_ms: currentMs } }; return Monorail.sendRequest("https://" + monorailDomain + "/v1/produce", JSON.stringify(event)); }, sendRequest: function sendRequest(endpointUrl, payload) { // Try the sendBeacon API if (window && window.navigator && typeof window.navigator.sendBeacon === 'function' && typeof window.Blob === 'function' && !Monorail.isIos12()) { var blobData = new window.Blob([payload], { type: 'text/plain' }); if (window.navigator.sendBeacon(endpointUrl, blobData)) { return true; } // sendBeacon was not successful } // XHR beacon var xhr = new XMLHttpRequest(); try { xhr.open('POST', endpointUrl); xhr.setRequestHeader('Content-Type', 'text/plain'); xhr.send(payload); } catch (e) { console.log(e); } return false; }, isIos12: function isIos12() { return window.navigator.userAgent.lastIndexOf('iPhone; CPU iPhone OS 12_') !== -1 || window.navigator.userAgent.lastIndexOf('iPad; CPU OS 12_') !== -1; } }; Monorail.produce('monorail-edge.shopifysvc.com', 'trekkie_storefront_load_errors/1.1', {shop_id: 6539731, theme_id: 133854593210, app_name: "storefront", context_url: window.location.href, source_url: "//chescadirect.co.uk/cdn/s/trekkie.storefront.64022fdadec5c8ec4be5f67dbeb0521916405ce3.min.js"}); }; scriptFallback.async = true; scriptFallback.src = '//chescadirect.co.uk/cdn/s/trekkie.storefront.64022fdadec5c8ec4be5f67dbeb0521916405ce3.min.js'; first.parentNode.insertBefore(scriptFallback, first); }; script.async = true; script.src = '//chescadirect.co.uk/cdn/s/trekkie.storefront.64022fdadec5c8ec4be5f67dbeb0521916405ce3.min.js'; first.parentNode.insertBefore(script, first); }; trekkie.load( {"Trekkie":{"appName":"storefront","development":false,"defaultAttributes":{"shopId":6539731,"isMerchantRequest":null,"themeId":133854593210,"themeCityHash":"14354358185815197866","contentLanguage":"en","currency":"GBP"},"isServerSideCookieWritingEnabled":true,"monorailRegion":"shop_domain"},"Google Analytics":{"trackingId":"UA-4274159-6","domain":"auto","siteSpeedSampleRate":"10","enhancedEcommerce":true,"doubleClick":true,"includeSearch":true},"Facebook Pixel":{"pixelIds":["899154257527247"],"agent":"plshopify1.2"},"Pinterest Pixel":{"pixelId":"2614233168572"},"Google Gtag Pixel":{"conversionId":"G-7W1QRSFWDM","eventLabels":[{"type":"search","action_label":["G-7W1QRSFWDM","AW-1055895193\/_tQUCMaCgJMBEJndvvcD"]},{"type":"begin_checkout","action_label":["G-7W1QRSFWDM","AW-1055895193\/K91zCMOCgJMBEJndvvcD"]},{"type":"view_item","action_label":["G-7W1QRSFWDM","AW-1055895193\/s7u8CL2CgJMBEJndvvcD","MC-ETWXMEG5C3"]},{"type":"purchase","action_label":["G-7W1QRSFWDM","AW-1055895193\/U4sUCLqCgJMBEJndvvcD","MC-ETWXMEG5C3"]},{"type":"page_view","action_label":["G-7W1QRSFWDM","AW-1055895193\/6BimCLeCgJMBEJndvvcD","MC-ETWXMEG5C3"]},{"type":"add_payment_info","action_label":["G-7W1QRSFWDM","AW-1055895193\/l4OjCMmCgJMBEJndvvcD"]},{"type":"add_to_cart","action_label":["G-7W1QRSFWDM","AW-1055895193\/z1ILCMCCgJMBEJndvvcD"]}],"targetCountry":"GB"},"Session Attribution":{},"S2S":{"facebookCapiEnabled":true,"facebookAppPixelId":"899154257527247","source":"trekkie-storefront-renderer"}} ); var loaded = false; trekkie.ready(function() { if (loaded) return; loaded = true; window.ShopifyAnalytics.lib = window.trekkie; ga('require', 'linker'); function addListener(element, type, callback) { if (element.addEventListener) { element.addEventListener(type, callback); } else if (element.attachEvent) { element.attachEvent('on' + type, callback); } } function decorate(event) { event = event || window.event; var target = event.target || event.srcElement; if (target && (target.getAttribute('action') || target.getAttribute('href'))) { ga(function (tracker) { var linkerParam = tracker.get('linkerParam'); document.cookie = '_shopify_ga=' + linkerParam + '; ' + 'path=/'; }); } } addListener(window, 'load', function(){ for (var i=0; i < document.forms.length; i++) { var action = document.forms[i].getAttribute('action'); if(action && action.indexOf('/cart') >= 0) { addListener(document.forms[i], 'submit', decorate); } } for (var i=0; i < document.links.length; i++) { var href = document.links[i].getAttribute('href'); if(href && href.indexOf('/checkout') >= 0) { addListener(document.links[i], 'click', decorate); } } }); var originalDocumentWrite = document.write; document.write = customDocumentWrite; try { window.ShopifyAnalytics.merchantGoogleAnalytics.call(this); } catch(error) {}; document.write = originalDocumentWrite; window.ShopifyAnalytics.lib.page(null,{"pageType":"home"}); var match = window.location.pathname.match(/checkouts\/(.+)\/(thank_you|post_purchase)/) var token = match? match[1]: undefined; if (!hasLoggedConversion(token)) { setCookieIfConversion(token); } }); var eventsListenerScript = document.createElement('script'); eventsListenerScript.async = true; eventsListenerScript.src = "//chescadirect.co.uk/cdn/shopifycloud/shopify/assets/shop_events_listener-a7c63dba65ccddc484f77541dc8ca437e60e1e9e297fe1c3faebf6523a0ede9b.js"; document.getElementsByTagName('head')[0].appendChild(eventsListenerScript); })();