### JavaScript: Mark Shopify Content Header Start Performance Source: https://strypergolf.com.au/pages/key-drills This snippet uses the `window.performance.mark` API to record a timestamp for the start of the Shopify content header loading. It helps in performance monitoring and identifying bottlenecks during page rendering, providing insights into initial load times. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Mark Shopify Header Performance Source: https://strypergolf.com.au/pages/support-swingmate This snippet uses the `window.performance.mark` API to record the start time of the Shopify content for header loading. It helps in performance monitoring and debugging by creating a timestamp in the browser's performance timeline. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Mark Shopify Content Header Start Performance Source: https://strypergolf.com.au/blogs/learngolf/swing-training-with-multiple-alignment-rods This snippet uses the window.performance.mark API to record a performance timestamp at the beginning of the Shopify content header loading process. It helps in profiling and optimizing page load times. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Initialize Shopify Analytics and Trekkie Source: https://strypergolf.com.au/products/swingmate-swing-training-system This snippet initializes the `window.ShopifyAnalytics` and `window.trekkie` objects, which are fundamental components of Shopify's analytics tracking system. It sets up meta-data such as currency and product information, defines `trekkie` methods, and provides a factory for creating tracking functions. This setup is crucial for collecting comprehensive e-commerce analytics data. ```JavaScript window.ShopifyAnalytics = window.ShopifyAnalytics || {}; window.ShopifyAnalytics.meta = window.ShopifyAnalytics.meta || {}; window.ShopifyAnalytics.meta.currency = 'USD'; var meta = { "product": { "id": 9732916085053, "gid": "gid:\/\/shopify\/Product\/9732916085053", "vendor": "Stryper Golf", "type": "", "variants": [ { "id": 49609630974269, "price": 11900, "name": "SwingMate Swing Training Aid", "public_title": null, "sku": "STRYSWM824" } ] }, "page": { "pageType": "product", "resourceType": "product", "resourceId": 9732916085053 } }; for (var attr in meta) { window.ShopifyAnalytics.meta[attr] = meta[attr]; } (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: 89691521341, theme_id: 171882185021, app_name: "storefront", context_url: window.location.href, source_url: "//www.strypergolf.com.au/cdn/s/trekkie.storefront.7f48c99429cb25be36839f7a7bcca2ac8a6982" }); }; }; }; })(); ``` -------------------------------- ### Initialize Shopify Analytics Replay Queue Source: https://strypergolf.com.au/collections/all This JavaScript code initializes the Shopify analytics object and sets up a replay queue. It ensures that analytics events are queued if the analytics object is not yet fully ready, and provides a `publish` method to push events into this queue for later processing. It also includes a performance mark for 'wpm:start'. ```JavaScript if (void 0 === i && (i = {}), !Boolean(null === (t = null === (a = window.Shopify) || void 0 === a ? void 0 : a.analytics) || void 0 === t ? void 0 : t.replayQueue)) { var a, t; window.Shopify = window.Shopify || {}; var s = window.Shopify; s.analytics = s.analytics || {}; var l = s.analytics; l.replayQueue = [], l.publish = function(e, d, r) { return l.replayQueue.push([e, d, r]), !0 }; try { self.performance.mark("wpm:start") } catch (e) {} } ``` -------------------------------- ### Initialize SQUIRAI Customer Tags Object Source: https://strypergolf.com.au/products/stancemate-stance-width-training-system This JavaScript snippet initializes the global `window.SQUIRAI` object, specifically setting up its `customer_tags` property. Currently, the `tags` array is null, indicating no customer tags are present or loaded at this initialization point. This setup is crucial for customer segmentation and personalized experiences. ```JavaScript window.SQUIRAI = {customer_tags: {tags: null}}; ``` -------------------------------- ### JavaScript: Shopify Analytics (Trekkie) Core Setup Source: https://strypergolf.com.au/blogs/learngolf/swing-training-with-multiple-alignment-rods This snippet initializes the 'trekkie' object, which serves as the core Shopify Analytics library. It defines the standard methods for tracking (e.g., identify, page, track) and provides a factory function to ensure all calls are properly queued and processed by the library. ```JavaScript 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); } ``` -------------------------------- ### JavaScript: Trekkie Configuration and Ready Callback Execution Source: https://strypergolf.com.au/blogs/learngolf/swing-training-with-multiple-alignment-rods This snippet demonstrates how the 'trekkie.load' function is invoked with specific configuration parameters for the Shopify storefront, including shop and theme IDs. It also shows the 'trekkie.ready' callback, which executes critical post-load logic such as integrating with Google Analytics, tracking page views, and performing final conversion logging based on checkout tokens. ```JavaScript trekkie.load( {"Trekkie":{"appName":"storefront","development":false,"defaultAttributes":{"shopId":89691521341,"isMerchantRequest":null,"themeId":171882185021,"themeCityHash":"4494216190069830747","contentLanguage":"en","currency":"USD","eventMetadataId":"3d6fcb1c-c2bc-453c-8083-7752f2d557fc"},"isServerSideCookieWritingEnabled":true,"monorailRegion":"shop_domain"},"Session Attribution":{},"S2S":{"facebookCapiEnabled":true,"source":"trekkie-storefront-renderer","apiClientId":580111}} ); var loaded = false; trekkie.ready(function() { if (loaded) return; loaded = true; window.ShopifyAnalytics.lib = window.trekkie; var originalDocumentWrite = document.write; document.write = customDocumentWrite; try { window.ShopifyAnalytics.merchantGoogleAnalytics.call(this); } catch(error) {}; document.write = originalDocumentWrite; window.ShopifyAnalytics.lib.page(null,{"pageType":"article","resourceType":"article","resourceId":609781121341,"shopifyEmitted":true}); var match = window.location.pathname.match(/checkouts\\/(.+)\\/(thank_you|post_purchase)/) var token = match? match[1]: undefined; if (!hasLoggedConversion(token)) { setCookieIfConversion(token); } }); ``` -------------------------------- ### Mark Shopify Content Header Start in JavaScript Source: https://strypergolf.com.au/policies/shipping-policy This JavaScript snippet uses the window.performance.mark API to record a performance timestamp for the start of Shopify's content for header. It helps in performance monitoring and debugging by marking specific events in the page load lifecycle. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Mark Shopify Content Header Start Source: https://strypergolf.com.au/cart This JavaScript snippet uses the `window.performance.mark` API to record a performance timestamp, indicating the start of the Shopify content header rendering process. It is typically used for performance monitoring and debugging within the browser. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### Initialize SQUIRAI and ppData JavaScript Variables Source: https://strypergolf.com.au/blogs/learngolf/swing-training-with-multiple-alignment-rods This JavaScript snippet initializes `ppData` with configuration for popups and tabs, including status, title, colors, and position. It also sets up `window.SQUIRAI` with customer tags, likely for analytics or personalization features on the website. ```JavaScript let ppData = {"tabs":"{\"status\":true,\"must_click_to_open\":true,\"tab_title\":\"Special Offer\",\"tab_text_color\":\"#FFFFFF\",\"background_color\":\"#333333\",\"tab_position\":\"bottom_center\"}","popups":[],"hidden_brandmark":true} window.SQUIRAI = {customer_tags: {tags: null}}; ``` -------------------------------- ### Mark Shopify Content Header Start in JavaScript Source: https://strypergolf.com.au/products/training-bag-with-1-6m-alignment-rods This JavaScript snippet uses the `window.performance` API to mark the start of the `content_for_header` section in Shopify. It's used for performance monitoring and timing the loading of critical header content, aiding in web performance optimization. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript Initialization for `ppData` and `SQUIRAI` Source: https://strypergolf.com.au/pages/the-system This JavaScript code initializes two global variables: `ppData` and `window.SQUIRAI`. `ppData` configures a 'Special Offer' tab with its properties, while `window.SQUIRAI` is set up with customer tags, likely for analytics or personalization purposes. ```JavaScript let ppData = {"tabs":"{\"status\":true,\"must_click_to_open\":true,\"tab_title\":\"Special Offer\",\"tab_text_color\":\"#FFFFFF\",\"background_color\":\"#333333\",\"tab_position\":\"bottom_center\"}","popups":[],"hidden_brandmark":true} window.SQUIRAI = {customer_tags: {tags: null}}; ``` -------------------------------- ### JavaScript: Initialize Shopify Trekkie Analytics Library Source: https://strypergolf.com.au/pages/the-system This snippet initializes the Shopify Trekkie analytics library, making it available globally as `window.ShopifyAnalytics.lib` and `window.trekkie`. It defines core methods like `identify`, `page`, `track`, and uses a factory pattern to create callable functions for each method, pushing arguments onto the `trekkie` queue. ```JavaScript 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); } ``` -------------------------------- ### JavaScript: Mark Shopify Content Header Start Performance Source: https://strypergolf.com.au/policies/terms-of-service This snippet uses the 'window.performance.mark' API to record a performance timestamp for the start of the Shopify content header. It helps in profiling the loading performance of the page. This requires the 'window.performance' object to be available in the browser environment. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Execute actions on Shopify Analytics ready event Source: https://strypergolf.com.au/pages/support-swingmate This `trekkie.ready` callback ensures that certain actions are performed only after the Shopify Analytics library is fully loaded and ready. It reassigns `window.ShopifyAnalytics.lib`, temporarily overrides `document.write` for Google Analytics initialization, tracks the current page view, and implements logic to set a conversion cookie for checkout thank-you pages. This ensures proper analytics tracking and conversion attribution. ```JavaScript var loaded = false; trekkie.ready(function() { if (loaded) return; loaded = true; window.ShopifyAnalytics.lib = window.trekkie; var originalDocumentWrite = document.write; document.write = customDocumentWrite; try { window.ShopifyAnalytics.merchantGoogleAnalytics.call(this); } catch(error) {}; document.write = originalDocumentWrite; window.ShopifyAnalytics.lib.page(null,{"pageType":"page","resourceType":"page","resourceId":146790809917,"shopifyEmitted":true}); var match = window.location.pathname.match(/checkouts\/(.+)\/(thank_you|post_purchase)/) var token = match? match[1]: undefined; if (!hasLoggedConversion(token)) { setCookieIfConversion(token); } }); ``` -------------------------------- ### JavaScript: Initialize StanceMate Product Data Object Source: https://strypergolf.com.au/cart This JavaScript snippet initializes or retrieves the product data for 'StanceMate Stance Width Training Aid' within the `window.__shgProducts` object. It uses the logical OR assignment operator (`||`) to ensure the object is created with its ID, title, handle, and a partial description if it doesn't already exist. This pattern is common for client-side data hydration. ```JavaScript window.__shgProducts["stancemate-stance-width-training-aid"] = window.__shgProducts["stancemate-stance-width-training-aid"] || {"id":9732911628605,"title":"StanceMate Stance Width Training Aid","handle":"stancemate-stance-width-training-aid","description":"\\u003cp class=\\"MsoNormal\\"\\u003e\\u003cmeta charset=\\"utf-8\\"\\u003e\\u003cstrong\\u003ePERFECT STANCE AND BALL POSITION FOR EVERY CLUB IN THE BAG\\u003c\\/strong\\u003e\\u003c\\/p\\u003e"} ``` -------------------------------- ### Adding an Extra Hinge to SwingMate Source: https://strypergolf.com.au/pages/support-swingmate This guide provides step-by-step instructions on how to easily add an additional hinge to your SwingMate base plate. It outlines the simple tools required and the process of sliding the T-nut into position. ```APIDOC Procedure: 1. Remove the plastic end cap from the base plate using a small screwdriver or butter knife. 2. Loosen the T-nut. 3. Slide the T-nut into the base plate. 4. Replace the end cap. ``` -------------------------------- ### JavaScript: Initialize Shopify Trekkie Analytics Library Source: https://strypergolf.com.au/pages/about-us This snippet initializes the Shopify Trekkie analytics library, making it available globally as window.trekkie and window.ShopifyAnalytics.lib. It defines core methods like identify, page, track, and ready, and sets up a factory pattern to push calls to an internal queue, ensuring commands are processed even if the library isn't fully loaded yet. ```javascript 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); } ``` -------------------------------- ### Mark Shopify Header Content Start Performance Source: https://strypergolf.com.au/pages/support-stancemate This JavaScript snippet uses the `window.performance.mark` API to record a performance timestamp. It marks the beginning of the 'shopify.content_for_header' rendering process, which is useful for performance monitoring and debugging. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### Initialize Shopify Performance Mark Source: https://strypergolf.com.au/pages/contact This JavaScript snippet marks the start of the 'content_for_header' rendering process in Shopify, utilizing the browser's Performance API. It helps in profiling and understanding the page load performance. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### APIDOC: Shopify Storefront Initialization JSON Source: https://strypergolf.com.au/blogs/learngolf/how-to-measure-stance-width-and-ball-position This JSON object provides essential data for initializing the Shopify storefront, including an access token, beta features, domain, and locale. It configures the client-side Shopify environment for features like predictive search. ```JSON { "accessToken": "e27128ff606d6e8d43ac7ba0c2fc9c12", "betas": [ "rich-media-storefront-analytics" ], "domain": "www.strypergolf.com.au", "predictiveSearch": true, "shopId": 89691521341, "locale": "en" } ``` -------------------------------- ### JavaScript: Execute Analytics on Trekkie Ready Event Source: https://strypergolf.com.au/pages/key-drills This block of code executes once the `trekkie` library signals it's ready. It reassigns `window.ShopifyAnalytics.lib` to `window.trekkie`, temporarily overrides `document.write` for Google Analytics integration, and then restores it. It also performs a `page` track event and handles conversion cookie setting based on checkout URL parameters, ensuring analytics and tracking are performed post-load. ```JavaScript var loaded = false; trekkie.ready(function() { if (loaded) return; loaded = true; window.ShopifyAnalytics.lib = window.trekkie; var originalDocumentWrite = document.write; document.write = customDocumentWrite; try { window.ShopifyAnalytics.merchantGoogleAnalytics.call(this); } catch(error) {}; document.write = originalDocumentWrite; window.ShopifyAnalytics.lib.page(null,{"pageType":"page","resourceType":"page","resourceId":146875842877,"shopifyEmitted":true}); var match = window.location.pathname.match(/checkouts\/(.+)\/(thank_you|post_purchase)/) var token = match? match[1]: undefined; if (!hasLoggedConversion(token)) { setCookieIfConversion(token); } }); ``` -------------------------------- ### JavaScript: Mark Shopify Content Header Performance Source: https://strypergolf.com.au/pages/testimonials This snippet uses the `window.performance` API to mark the start of the Shopify content for header loading process. It helps in performance monitoring and debugging by creating a timestamp for a specific event. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Mark Shopify Header Content Performance Source: https://strypergolf.com.au/blogs/learngolf/junior-golfers-stance-width-and-ball-position Records a performance mark indicating the start of Shopify's content for header loading. This snippet uses the 'window.performance' API to track frontend performance metrics. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### Initializing Shopify Analytics and Web Pixels Manager Source: https://strypergolf.com.au/products/swingmate-swing-training-system This complex self-executing function sets up Shopify's analytics and web pixels manager. It initializes a replay queue for analytics events, defines a `publish` method to push events to this queue, and includes extensive browser user-agent detection to determine 'modern' or 'legacy' browser support. It also contains logic to emit load status events for the web pixels manager using `sendBeacon` or falling back to `XMLHttpRequest` if `sendBeacon` fails or is unavailable. ```javascript (function e(e,d,r,n,o,i){if(void 0===i&&(i={}),!Boolean(null===(t=null===(a=window.Shopify)||void 0===a?void 0:a.analytics)||void 0===t?void 0:t.replayQueue)){var a,t;window.Shopify=window.Shopify||{};var s=window.Shopify;s.analytics=s.analytics||{};var l=s.analytics;l.replayQueue=[],l.publish=function(e,d,r){return l.replayQueue.push([e,d,r]),!0};try{self.performance.mark("wpm:start")}catch(e){}var u=function(){var e={modern:/Edge?\/(1{2}[4-9]|1[2-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Firefox\/(1{2}[4-9]|1[2-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Chrom(ium|e)\/(9{2}|\d{3,})\.\d+(\.\d+|)|(Maci|X1{2}).+ Version\/(15\.\d+|(1[6-9]|[2-9]\d|\d{3,})\.\d+)([,.]\d+|)( (\w+)|)( Mobile\/\w+|) Safari\/|Chrome.+OPR\/(9{2}|\d{3,})\.\d+\.\d+|(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS|CPU iPad OS)[ +]+(15[._]\d+|(1[6-9]|[2-9]\d|\d{3,})[._]\d+)([._]\d+|)|Android:?[ /-]((13[3-9]|1[4-9]\d|[2-9]\d{2}|\d{4,})(\.\d+|)(\.\d+|))|Android.+Firefox\/(13[5-9]|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Android.+Chrom(ium|e)\/(13[3-9]|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|SamsungBrowser\/([2-9]\d|\d{3,})\.\d+/,legacy:/Edge?\/(1[6-9]|[2-9]\d|\d{3,})\.\d+(\.\d+|)|Firefox\/(5[4-9]|[6-9]\d|\d{3,})\.\d+(\.\d+|)|Chrom(ium|e)\/((5[1-9]|[6-9]\d|\d{3,})\.\d+(\.\d+|)([\d.]+$|.*Safari\/(?![\d.]+ Edge\/[\d.]+$)))|(Maci|X1{2}).+ Version\/(10\.\d+|(1[1-9]|[2-9]\d|\d{3,})\.\d+)([,.]\d+|)( (\w+)|)( Mobile\/\w+|) Safari\/|Chrome.+OPR\/(3[89]|[4-9]\d|\d{3,})\.\d+\.\d+|(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS|CPU iPad OS)[ +]+(10[._]\d+|(1[1-9]|[2-9]\d|\d{3,})[._]\d+)([._]\d+|)|Android:?[ /-]((13[3-9]|1[4-9]\d|[2-9]\d{2}|\d{4,})(\.\d+|)(\.\d+|))|Mobile Safari.+OPR\/([89]\d|\d{3,})\.\d+\.\d+|Android.+Firefox\/(13[5-9]|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)|Android.+Chrom(ium|e)\/((13[3-9]|1[4-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|))|Android.+(UC? ?Browser|UCWEB|U3)[ /]?(15\.([5-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+)\.\d+|SamsungBrowser\/(5\.\d+|([6-9]|\d{2,})\.\d+)|Android.+MQ{2}Browser\/(14((\.(9|\d{2,})|)|(1[5-9]|[2-9]\d|\d{3,})(\.\d+|)))(\.\d+|)|K[Aa][Ii]OS\/(3\.\d+|([4-9]|\d{2,})\.\d+)(\.\d+|)/},d=e.modern,r=e.legacy,n=navigator.userAgent;return n.match(d)?"modern":n.match(r)?"legacy":"unknown"}(),c="modern"===u?"modern":"legacy",f=(null!=o?o:{modern:"",legacy:""})[c],m=function(e){return[e.baseUrl,"/wpm","/b",e.hashVersion,"modern"===e.buildTarget?"m":"l",".js"].join("")}({baseUrl:r,hashVersion:n,buildTarget:c}),p=function(e){var d=e.version,r=e.bundleTarget,n=e.surface,o=e.pageUrl,i=e.monorailEndpoint;return{emit:function(e){var a=e.status,t=e.errorMsg,s=(new Date).getTime(),l=JSON.stringify({metadata:{event_sent_at_ms:s},events:[{schema_id:"web_pixels_manager_load/3.1",payload:{version:d,bundle_target:r,page_url:o,status:a,surface:n,error_msg:t},metadata:{event_created_at_ms:s}}]});if(!i)return console&&console.warn&&console.warn("[Web Pixels Manager] No Monorail endpoint provided, skipping logging."),!1;try{return self.navigator.sendBeacon.bind(self.navigator)(i,l)}catch(e){}var u=new XMLHttpRequest;try{return u.open("POST",i,!0),u.setRequestHeader("Content-Type","text/plain"),u.send(l),!0}catch(e){return ``` -------------------------------- ### JavaScript: Mark Shopify Content Header Performance Source: https://strypergolf.com.au/blogs/learngolf/how-to-measure-stance-width-and-ball-position This JavaScript snippet uses the Performance API to mark the start of the Shopify content for header loading. It helps in measuring the performance of page rendering by creating a timestamp at a specific point. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### Initialize Shopify Trekkie Analytics Library Source: https://strypergolf.com.au/collections/all This snippet initializes the Shopify Trekkie analytics library, aliasing it to `window.trekkie` and `window.ShopifyAnalytics.lib`. It defines a factory pattern to create methods like `identify`, `page`, and `track`, pushing calls onto a queue for deferred execution. ```javascript 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); } ``` -------------------------------- ### Track Shopify Header Content Load Performance Source: https://strypergolf.com.au/policies/refund-policy This JavaScript snippet uses the `window.performance.mark` API to record the start time of the Shopify header content loading. It helps in performance monitoring and identifying potential bottlenecks during page rendering. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript: Initialize Shopify Analytics (trekkie) library Source: https://strypergolf.com.au/pages/support-swingmate This snippet initializes the Shopify Analytics library, aliased as `trekkie` and `window.ShopifyAnalytics.lib`. It defines a set of standard methods like 'identify', 'page', 'ready', 'track', 'trackForm', and 'trackLink'. A factory function is used to create wrappers for these methods, pushing arguments onto the `trekkie` queue for deferred execution. ```JavaScript 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); } ``` -------------------------------- ### Initialize Shopify Trekkie Analytics Library Source: https://strypergolf.com.au/products/1-6m-foldable-alignment-rod This code initializes the `trekkie` analytics library, defining its core methods (`identify`, `page`, `ready`, `track`, `trackForm`, `trackLink`) and a factory function to create method wrappers. It prepares the `trekkie` object for tracking events and interactions on the storefront. ```JavaScript 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); } ``` -------------------------------- ### Cleaning and Maintaining SwingMate Source: https://strypergolf.com.au/pages/support-swingmate This guide provides simple instructions for cleaning your SwingMate to maintain its appearance and functionality. It specifies using water and normal dishwashing detergent with a soft cloth or brush, and offers a tip for effectively cleaning dirty laser-etched text. ```APIDOC General Cleaning: - Wash with water and normal dishwashing detergent. - Use a soft cloth or brush. Cleaning Dirty Text: - Best way to clean dirty laser-etched text is with a "plastic" pencil eraser. ``` -------------------------------- ### APIDOC: Shopify Storefront Initialization Configuration Source: https://strypergolf.com.au/pages/support-swingmate This JSON object provides essential configuration details for the Shopify storefront. It includes the access token, beta features, domain, shop ID, and locale, which are crucial for initializing various storefront functionalities like predictive search. ```JSON {"accessToken":"e27128ff606d6e8d43ac7ba0c2fc9c12","betas":["rich-media-storefront-analytics"],"domain":"www.strypergolf.com.au","predictiveSearch":true,"shopId":89691521341,"locale":"en"} ``` -------------------------------- ### Initialize Shopify Trekkie Analytics Library in JavaScript Source: https://strypergolf.com.au/blogs/learngolf/how-to-measure-stance-width-and-ball-position This snippet initializes the core Shopify Trekkie analytics library, setting up its methods like 'identify', 'page', 'track', and 'ready'. It ensures that the analytics object is globally accessible and ready to receive tracking calls. This is a foundational step for any client-side Shopify analytics integration. ```JavaScript 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); } ``` -------------------------------- ### JavaScript: Mark Shopify Content Header Performance Source: https://strypergolf.com.au/pages/support This snippet uses the window.performance API to mark the start of the Shopify content header loading process. It helps in performance monitoring and debugging by creating a timestamped entry in the browser's performance timeline. ```javascript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ``` -------------------------------- ### JavaScript Shopify Feature and Module Loader Setup Source: https://strypergolf.com.au/products/1-6m-foldable-alignment-rod This JavaScript code sets up the Shopify module and feature loading mechanisms. It initializes `Shopify.modules` to true and defines `Shopify.loadFeatures` and `Shopify.autoloadFeatures` as queues to manage the loading of various Shopify functionalities dynamically. ```JavaScript !function(o){ (o.Shopify=o.Shopify||{}).modules=!0 }(window); !function(o){ function n(){ var o=[]; function n(){ o.push(Array.prototype.slice.apply(arguments)) } return n.q=o,n } var t=o.Shopify=o.Shopify||{}; t.loadFeatures=n(), t.autoloadFeatures=n() }(window); ``` -------------------------------- ### Shopify Storefront Initialization Configuration in JSON Source: https://strypergolf.com.au/products/adjustable-golf-alignment-stick-holders This JSON object provides essential configuration details for the Shopify storefront, including the access token, beta features, domain, predictive search status, shop ID, and locale. It's crucial for client-side Shopify functionalities and ensures the storefront behaves as expected. ```JSON { "accessToken": "e27128ff606d6e8d43ac7ba0c2fc9c12", "betas": [ "rich-media-storefront-analytics" ], "domain": "www.strypergolf.com.au", "predictiveSearch": true, "shopId": 89691521341, "locale": "en" } ``` -------------------------------- ### JavaScript: Configure Shopify Module and Feature Loading Setup Source: https://strypergolf.com.au/pages/support This snippet sets up the Shopify.modules flag and defines Shopify.loadFeatures and Shopify.autoloadFeatures as functions that queue arguments for later processing. This pattern is used by Shopify to manage the loading and execution of various client-side features and modules. ```javascript !function(o){(o.Shopify=o.Shopify||{}).modules=!0}(window); !function(o){function n(){var o=[];function n(){o.push(Array.prototype.slice.apply(arguments))}return n.q=o,n}var t=o.Shopify=o.Shopify||{};t.loadFeatures=n(),t.autoloadFeatures=n()}(window); ``` -------------------------------- ### JavaScript: Initialize Shopify Trekkie Analytics Library Source: https://strypergolf.com.au/pages/key-drills This code initializes the Shopify Analytics (trekkie) library, making it available globally as `window.ShopifyAnalytics.lib` and `window.trekkie`. It defines standard methods like `identify`, `page`, `track`, etc., and provides a factory pattern to push calls onto the trekkie queue. This setup ensures that analytics calls are queued and processed once the library is fully loaded. ```JavaScript 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); } ``` -------------------------------- ### JavaScript: Initialize Shopify Storefront Global Variables Source: https://strypergolf.com.au/blogs/learngolf/junior-golfers-stance-width-and-ball-position Initializes global Shopify variables such as access token, beta features, domain, shop ID, and locale. This setup is fundamental for the storefront's dynamic functionalities and API interactions, including predictive search. ```JavaScript {"accessToken":"e27128ff606d6e8d43ac7ba0c2fc9c12","betas":["rich-media-storefront-analytics"],"domain":"www.strypergolf.com.au","predictiveSearch":true,"shopId":89691521341,"locale":"en"} var Shopify = Shopify || {}; Shopify.shop = "strypergolf.myshopify.com"; Shopify.locale = "en"; Shopify.currency = {"active":"USD","rate":"0.66353142"}; Shopify.country = "US"; Shopify.theme = {"name":"Dawn","id":171882185021,"schema_name":"Dawn","schema_version":"15.1.0","theme_store_id":887,"role":"main"}; Shopify.theme.handle = "null"; Shopify.theme.style = {"id":null,"handle":null}; Shopify.cdnHost = "www.strypergolf.com.au/cdn"; Shopify.routes = Shopify.routes || {}; Shopify.routes.root = "/"; ``` -------------------------------- ### Execute Shopify Trekkie Ready Callback and Track Product Views Source: https://strypergolf.com.au/products/adjustable-golf-alignment-stick-holders This JavaScript snippet executes code once the Shopify Trekkie library is ready. It sets window.ShopifyAnalytics.lib to window.trekkie, temporarily overrides document.write for analytics calls, and tracks 'Viewed Product' events. It includes logic to prevent duplicate conversion logging and captures detailed product information like currency, variant ID, product ID, name, price, SKU, and brand. ```JavaScript var loaded = false; trekkie.ready(function() { if (loaded) return; loaded = true; window.ShopifyAnalytics.lib = window.trekkie; var originalDocumentWrite = document.write; document.write = customDocumentWrite; try { window.ShopifyAnalytics.merchantGoogleAnalytics.call(this); } catch(error) {}; document.write = originalDocumentWrite; window.ShopifyAnalytics.lib.page(null,{"pageType":"product","resourceType":"product","resourceId":9682059067709,"shopifyEmitted":true}); var match = window.location.pathname.match(/checkouts\\/(.+)\\/(thank\_you|post\_purchase)/) var token = match? match[1]: undefined; if (!hasLoggedConversion(token)) { setCookieIfConversion(token); window.ShopifyAnalytics.lib.track("Viewed Product",{"currency":"USD","variantId":49438857560381,"productId":9682059067709,"productGid":"gid:\\\/\\\/shopify\\\/Product\\\/9682059067709","name":"Adjustable golf alignment rod holder hinges","price":"10.00","sku":"STRYHINGE24","brand":"Stryper Golf","variant":null,"category":"","nonInteraction":true},undefined,undefined,{"shopifyEmitted":true}); window.ShopifyAnalytics.lib.track("monorail:\\\/\\\/trekkie\_storefront\_viewed\_product\\\/1.1",{"currency":"USD","variantId":49438857560381,"productId":9682059067709,"productGid":"gid:\\\/\\\/shopify\\\/Product\\\/9682059067709","name":"Adjustable golf alignment rod holder hinges","price":"10.00","sku":"STRYHINGE24","brand":"Stryper Golf","variant":null,"category":"","nonInteraction":true,"referer":"https:\\\/\\\/www.strypergolf.com.au\\\/products\\\/adjustable-golf ``` -------------------------------- ### JavaScript: Mark Shopify Header Content Load Performance Source: https://strypergolf.com.au/products/swingmate-swing-training-system This snippet uses the `window.performance` API to mark the start of the Shopify content for header loading. It helps in performance monitoring and analysis by creating a timestamp for a specific event within the browser's performance timeline. ```JavaScript window.performance && window.performance.mark && window.performance.mark('shopify.content_for_header.start'); ```