'use strict'; (function () { const originalAddEventListener = EventTarget.prototype.addEventListener; const originalRemoveEventListener = EventTarget.prototype.removeEventListener; const {hostname, pathname} = self.location const safeFetchHandlers = new WeakMap(); let currentOnFetch = null; const matches = /^\/(apps|a|community|tools)\/[^\/]+/.exec(pathname); const proxy = matches && matches[0]; const hostnameRegex = hostname.replace(/\./g, '\\.'); const ALLOWLIST = [ // Allow only specific subroutes within a storefront `^https\:\/\/${hostnameRegex}+\/($|collections|products|pages|cart|search|blogs|account|recommendations)`, // Allow requests from the app proxy in which the service worker was served `^https\:\/\/${hostnameRegex}+${proxy}`, // Allow all 3rd party urls `^https?\:\/\/(?!${hostnameRegex}).+`, ]; function isAllowlisted(url) { return ALLOWLIST.some((str) => { const re = new RegExp(str); return url.match(re) }) } function safeAddEventListener(event, handler, options) { if (event !== 'fetch') return originalAddEventListener.call(this, event, handler, options); function safeHandler(event) { if (!isAllowlisted(event.request.url)) { return console.debug(`FETCH EVENT BLOCKED: Cannot execute fetch event handler on following request: ${event.request.url}`) } return handler.call(this, event); } safeFetchHandlers.set(handler, safeHandler); originalAddEventListener.call(this, event, safeHandler, options); }; function safeRemoveEventListener(event, handler) { if (!safeFetchHandlers.has(handler)) return; const safeHandler = safeFetchHandlers.get(handler) safeFetchHandlers.delete(handler); originalRemoveEventListener.call(this, event, safeHandler); } Object.defineProperty(EventTarget.prototype, 'addEventListener', { ...Object.getOwnPropertyDescriptor(EventTarget.prototype, 'addEventListener'), value: safeAddEventListener }); Object.defineProperty(EventTarget.prototype, 'removeEventListener', { ...Object.getOwnPropertyDescriptor(EventTarget.prototype, 'removeEventListener'), value: safeRemoveEventListener }); Object.defineProperty(self, 'onfetch', { ...Object.getOwnPropertyDescriptor(self, 'onfetch'), get() { return currentOnFetch; }, set(newOnFetch) { if (currentOnFetch !== null) { safeRemoveEventListener.call(self, 'fetch', currentOnFetch); } if (typeof newOnFetch === 'function') { safeAddEventListener.call(self, 'fetch', newOnFetch); } currentOnFetch = newOnFetch; }, }); }()); if(!window.jQuery){ (function(){ if('serviceWorker' in navigator){ navigator.serviceWorker.register('/apps/files/getserviceworker?shop=herbert-works.myshopify.com',{scope:'./'}).then(function(registration){ registration.update() }).catch(err=>console.log('Error',err)) } if(('standalone' in window.navigator)&&window.navigator.standalone){ var noddy,remotes=!1; document.addEventListener('click',function(event){ noddy=event.target; while(noddy.nodeName!=='A'&&noddy.nodeName!=='HTML'){ noddy=noddy.parentNode } if('href' in noddy&&noddy.href.indexOf('http')!==-1&&(noddy.href.indexOf(document.location.host)!==-1||remotes)){ event.preventDefault(); document.location.href=/noddy.href } },!1) } var iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream; var ua=navigator.userAgent.toLowerCase();var isAndroid=ua.indexOf('android')>-1; var ua=navigator.userAgent||navigator.vendor||window.opera; var isInstagram = (ua.indexOf('Instagram')>-1)?!0:!1; var isFacebook = (ua.indexOf("FBAN")>-1)||(ua.indexOf("FBAV")>-1); var preventDefault = function(e){ e=e||window.event; if(e.preventDefault) e.preventDefault(); e.returnValue=!1 }; var getURLParams=function(url){ var params=new URLSearchParams(url.search); return params }; var setCookie=function(name,value,duration){ var d = new Date(); d.setTime(d.getTime() + (7*24*60*60*1000)); var expires = 'expires='+ d.toUTCString(); document.cookie = name + '=' + value + ';' + expires + ';path=/;'+"SameSite=None;"+"Secure"; }; var getCookie=function(name){ var name = name + '='; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i 0) { el.appendChild(div.children[0]); }} var ajax = {}; ajax.x = function () { if (typeof XMLHttpRequest !== 'undefined') { return new XMLHttpRequest(); } var versions = [ 'MSXML2.XmlHttp.6.0', 'MSXML2.XmlHttp.5.0', 'MSXML2.XmlHttp.4.0', 'MSXML2.XmlHttp.3.0', 'MSXML2.XmlHttp.2.0', 'Microsoft.XmlHttp' ]; var xhr; for (var i = 0; i < versions.length; i++) { try { xhr = new ActiveXObject(versions[i]); break; } catch (e) { } } return xhr;}; ajax.send = function (url, callback, method, data, async) { if (async === undefined) { async = true; } var x = ajax.x(); x.open(method, url, async); x.onreadystatechange = function () { if (x.readyState == 4) { callback(x.responseText) } }; if (method == 'POST') { x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); } x.send(data)}; ajax.get = function (url, data, callback, async) { var query = []; for (var key in data) { query.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key])); } ajax.send(url + (query.length ? '?' + query.join('&') : ''), callback, 'GET', null, async)}; ajax.post = function (url, data, callback, async) { var query = []; for (var key in data) { query.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key])); } ajax.send(url, callback, 'POST', query.join('&'), async)}; var backdrop = '
'; var card = '

Install our App in your Android Device

  • ✔ Allow easy navigation
  • ✔ Load pages faster
  • ✔ Permit working on weak or no internet connections
➜ Click on 👇 "Get App" to get App for your Android device.
'; var close = '
'; var iOSBackdrop = '
'; var iOScard = '

Install our App in your iPhone

  • ✔ Great performance
  • ✔ Offline & Cache functionalities
  • ✔ Compatibility with iOS
Icon ➜ Click On 👇 "Get App" and follow the Instructions to get App for your iOS Device.
Get App
'; var iOSclose = '
'; var iOSBackdropins = '
'; var iOScardins = '
Icon
Got It!
'; var iOScloseins = '
'; var showAppAlert = true; var showiOSAppAlert = true; var currentShop ='herbert-works.myshopify.com'; var iosDelay = (getURLParams(window.location).get('appmixo_pwaTask')==='ios')?0:12000; if(!isFacebook && !isInstagram && iOS && showiOSAppAlert && getCookie('appmixo_pwaIOSMessage') != 'showed' && !window.navigator.standalone && !navigator.userAgent.match('CriOS') || getURLParams(window.location).get('appmixo_pwaTask') === 'ios' && iOS){ setTimeout(function(){ appendHtml(document.body, iOSBackdrop); appendHtml(document.body, iOScard); appendHtml(document.body, iOSclose); var closeIOSButton = document.getElementById('closeIos'); closeIOSButton.addEventListener('click',function(event){ event.stopPropagation(); var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo iOS PWA Dismissed', eventLabel: 'Closed popup without install' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo iOS PWA Dismissed', { Closed_popup_without_install: 'AppMixo iOS PWA Dismissed' }) } ajax.post('https://live.appmixo.com/pwa/getiOSDismissed', {shop: 'herbert-works.myshopify.com'}, function() { }); setCookie('appmixo_pwaIOSMessage','showed', 3000); }); var appmixo_pwa_app_ios_banner_get_button = document.getElementById('appmixo_pwa_app_ios_banner_get_button'); appmixo_pwa_app_ios_banner_get_button.addEventListener('click',function(event){ event.stopPropagation(); var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo iOS PWA install', eventLabel: 'Added to home screen' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo iOS PWA install', { added_to_home_screen: 'AppMixo iOS PWA installed' }) } ajax.post('https://live.appmixo.com/pwa/getiOSInstall', {shop: 'herbert-works.myshopify.com'}, function() { }); setCookie('appmixo_pwaIOSMessage','showed', 3000); appendHtml(document.body, iOSBackdropins); appendHtml(document.body, iOScardins); appendHtml(document.body, iOScloseins); var closeIos_ins = document.getElementById('closeIos_ins'); closeIos_ins.onclick = function() { var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert_ins'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }; var appmixo_pwa_app_ios_banner_get_button_ins = document.getElementById('appmixo_pwa_app_ios_banner_get_button_ins'); appmixo_pwa_app_ios_banner_get_button_ins.addEventListener('click',function(event){ var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert_ins'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } },false); },false); },iosDelay) } if(iOS){ var link=document.createElement('link'); link.rel='apple-touch-icon'; link.href="https://d1yl2s4t04o9uw.cloudfront.net/secure/appmixo/pwa/shop/icon512x512/herbert-works_icon_512x512.png"; document.head.appendChild(link); var metaTitle=document.createElement('meta'); metaTitle.name='apple-mobile-web-app-title'; metaTitle.content='Herbert'; document.head.appendChild(metaTitle); var metaCapable=document.createElement('meta'); metaCapable.name='apple-mobile-web-app-capable'; metaCapable.content='yes'; document.head.appendChild(metaCapable); } window.addEventListener('appinstalled',(event)=>{ var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }); window.addEventListener('beforeinstallprompt',e=>{ if(showAppAlert && isAndroid && getCookie('appmixo_pwaAndroidMessage')!='showed'){ appendHtml(document.body, backdrop); appendHtml(document.body, card); appendHtml(document.body, close); var installButton = document.getElementById('butInstall'); installButton.addEventListener('click', installPWA); let deferredInstallPrompt = e; function installPWA(evt) { deferredInstallPrompt.prompt(); evt.srcElement.setAttribute('hidden', true); deferredInstallPrompt.userChoice.then((choice) => { if (choice.outcome === 'accepted') { ajax.post('https://live.appmixo.com/pwa/getAndroidInstall', {shop: 'herbert-works.myshopify.com'}, function() { }); if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo Android PWA install', eventLabel: 'Added to home screen' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo Android PWA install', { added_to_home_screen: 'AppMixo Android PWA installed' }) } var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } } else { ajax.post('https://live.appmixo.com/pwa/getAndroidDismissed', {shop: 'herbert-works.myshopify.com'}, function() { }); if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo Android PWA Dismissed', eventLabel: 'Closed popup without install' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo Android PWA Dismissed', { Closed_popup_without_install: 'AppMixo Android PWA Dismissed' }) } var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } } deferredInstallPrompt = null; }); } var element = document.getElementById('closeAndroid'); element.addEventListener('click',function(event){ ajax.post('https://live.appmixo.com/pwa/getAndroidDismissed', {shop: 'herbert-works.myshopify.com'}, function() { }); if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo Android PWA Dismissed', eventLabel: 'Closed popup without install' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo Android PWA Dismissed', { Closed_popup_without_install: 'AppMixo Android PWA Dismissed' }) } var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } setCookie('appmixo_pwaAndroidMessage', 'showed', 3000); }); } e.userChoice.then(choiceResult=>{ var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }) }); window.addEventListener('appinstalled',(evt)=>{ var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }); var suburl = '/checkouts'; if(document.URL.indexOf(suburl) !== -1){ if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo PWA Initiate Checkout', eventLabel: 'Initiate Checkout' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo PWA Checkout', { initiate_checkout: 'AppMixo PWA Initiate Checkout' }) } } var suburl = '/thank_you'; if(document.URL.indexOf(suburl) !== -1){ if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo PWA Purchased', eventLabel: 'purchased' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo PWA Purchased', { purchased: 'AppMixo PWA Purchased' }) } } if (window.location.search === '?source=homescreen') { if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo PWA Open', eventLabel: 'App Open' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo PWA Open', { App_open: 'AppMixo PWA Open' }) } } })(); }else{ (function(){ if('serviceWorker' in navigator){ navigator.serviceWorker.register('/apps/files/getserviceworker?shop=herbert-works.myshopify.com',{scope:'./'}).then(function(registration){ registration.update() }).catch(err=>console.log('Error',err)) } if(('standalone' in window.navigator)&&window.navigator.standalone){ var noddy,remotes=!1; document.addEventListener('click',function(event){ noddy=event.target; while(noddy.nodeName!=='A'&&noddy.nodeName!=='HTML'){ noddy=noddy.parentNode } if('href' in noddy&&noddy.href.indexOf('http')!==-1&&(noddy.href.indexOf(document.location.host)!==-1||remotes)){ event.preventDefault(); document.location.href=/noddy.href } },!1) } var iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream; var ua=navigator.userAgent.toLowerCase();var isAndroid=ua.indexOf('android')>-1; var ua=navigator.userAgent||navigator.vendor||window.opera; var isInstagram = (ua.indexOf('Instagram')>-1)?!0:!1; var isFacebook = (ua.indexOf("FBAN")>-1)||(ua.indexOf("FBAV")>-1); var preventDefault = function(e){ e=e||window.event; if(e.preventDefault) e.preventDefault(); e.returnValue=!1 }; var getURLParams=function(url){ var params=new URLSearchParams(url.search); return params }; var setCookie=function(name,value,duration){ var d = new Date(); d.setTime(d.getTime() + (7*24*60*60*1000)); var expires = 'expires='+ d.toUTCString(); document.cookie = name + '=' + value + ';' + expires + ';path=/;'+"SameSite=None;"+"Secure"; }; var getCookie=function(name){ var name = name + '='; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i 0) { el.appendChild(div.children[0]); }} var ajax = {}; ajax.x = function () { if (typeof XMLHttpRequest !== 'undefined') { return new XMLHttpRequest(); } var versions = [ 'MSXML2.XmlHttp.6.0', 'MSXML2.XmlHttp.5.0', 'MSXML2.XmlHttp.4.0', 'MSXML2.XmlHttp.3.0', 'MSXML2.XmlHttp.2.0', 'Microsoft.XmlHttp' ]; var xhr; for (var i = 0; i < versions.length; i++) { try { xhr = new ActiveXObject(versions[i]); break; } catch (e) { } } return xhr;}; ajax.send = function (url, callback, method, data, async) { if (async === undefined) { async = true; } var x = ajax.x(); x.open(method, url, async); x.onreadystatechange = function () { if (x.readyState == 4) { callback(x.responseText) } }; if (method == 'POST') { x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); } x.send(data)}; ajax.get = function (url, data, callback, async) { var query = []; for (var key in data) { query.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key])); } ajax.send(url + (query.length ? '?' + query.join('&') : ''), callback, 'GET', null, async)}; ajax.post = function (url, data, callback, async) { var query = []; for (var key in data) { query.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key])); } ajax.send(url, callback, 'POST', query.join('&'), async)}; var backdrop = '
'; var card = '

Install our App in your Android Device

  • ✔ Allow easy navigation
  • ✔ Load pages faster
  • ✔ Permit working on weak or no internet connections
➜ Click on 👇 "Get App" to get App for your Android device.
'; var close = '
'; var iOSBackdrop = '
'; var iOScard = '

Install our App in your iPhone

  • ✔ Great performance
  • ✔ Offline & Cache functionalities
  • ✔ Compatibility with iOS
Icon ➜ Click On 👇 "Get App" and follow the Instructions to get App for your iOS Device.
Get App
'; var iOSclose = '
'; var iOSBackdropins = '
'; var iOScardins = '
Icon
Got It!
'; var iOScloseins = '
'; var showAppAlert = true; var showiOSAppAlert = true; var currentShop ='herbert-works.myshopify.com'; var iosDelay = (getURLParams(window.location).get('appmixo_pwaTask')==='ios')?0:12000; if(!isFacebook && !isInstagram && iOS && showiOSAppAlert && getCookie('appmixo_pwaIOSMessage') != 'showed' && !window.navigator.standalone && !navigator.userAgent.match('CriOS') || getURLParams(window.location).get('appmixo_pwaTask') === 'ios' && iOS){ setTimeout(function(){ appendHtml(document.body, iOSBackdrop); appendHtml(document.body, iOScard); appendHtml(document.body, iOSclose); $(document).on('click', '#closeIos', function(){ event.stopPropagation(); var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo iOS PWA Dismissed', eventLabel: 'Closed popup without install' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo iOS PWA Dismissed', { Closed_popup_without_install: 'AppMixo iOS PWA Dismissed' }) } ajax.post('https://live.appmixo.com/pwa/getiOSDismissed', {shop: 'herbert-works.myshopify.com'}, function() { }); setCookie('appmixo_pwaIOSMessage','showed', 3000); }); $(document).on('click', '#appmixo_pwa_app_ios_banner_get_button', function(){ event.stopPropagation(); var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo iOS PWA install', eventLabel: 'Added to home screen' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo iOS PWA install', { added_to_home_screen: 'AppMixo iOS PWA installed' }) } ajax.post('https://live.appmixo.com/pwa/getiOSInstall', {shop: 'herbert-works.myshopify.com'}, function() { }); setCookie('appmixo_pwaIOSMessage','showed', 3000); appendHtml(document.body, iOSBackdropins); appendHtml(document.body, iOScardins); appendHtml(document.body, iOScloseins); var closeIos_ins = document.getElementById('closeIos_ins'); closeIos_ins.onclick = function() { var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert_ins'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }; $(document).on('click', '#appmixo_pwa_app_ios_banner_get_button_ins', function(){ var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert_ins'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }); }); },iosDelay) } if(iOS){ var link=document.createElement('link'); link.rel='apple-touch-icon'; link.href="https://d1yl2s4t04o9uw.cloudfront.net/secure/appmixo/pwa/shop/icon512x512/herbert-works_icon_512x512.png"; document.head.appendChild(link); var metaTitle=document.createElement('meta'); metaTitle.name='apple-mobile-web-app-title'; metaTitle.content='Herbert'; document.head.appendChild(metaTitle); var metaCapable=document.createElement('meta'); metaCapable.name='apple-mobile-web-app-capable'; metaCapable.content='yes'; document.head.appendChild(metaCapable); } window.addEventListener('appinstalled',(event)=>{ var elements = document.getElementsByClassName('appmixo_pwa_app_ios_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }); window.addEventListener('beforeinstallprompt',e=>{ if(showAppAlert && isAndroid && getCookie('appmixo_pwaAndroidMessage')!='showed'){ appendHtml(document.body, backdrop); appendHtml(document.body, card); appendHtml(document.body, close); let deferredInstallPrompt = e; $(document).on('click', '#butInstall', function(event){ deferredInstallPrompt.prompt(); deferredInstallPrompt.userChoice.then((choice) => { if (choice.outcome === 'accepted') { ajax.post('https://live.appmixo.com/pwa/getAndroidInstall', {shop: 'herbert-works.myshopify.com'}, function() { }); if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo Android PWA install', eventLabel: 'Added to home screen' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo Android PWA install', { added_to_home_screen: 'AppMixo Android PWA installed' }) } var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } } else { ajax.post('https://live.appmixo.com/pwa/getAndroidDismissed', {shop: 'herbert-works.myshopify.com'}, function() { }); if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo Android PWA Dismissed', eventLabel: 'Closed popup without install' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo Android PWA Dismissed', { Closed_popup_without_install: 'AppMixo Android PWA Dismissed' }) } var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } } deferredInstallPrompt = null; }); }); $(document).on('click', '#closeAndroid', function(event){ ajax.post('https://live.appmixo.com/pwa/getAndroidDismissed', {shop: 'herbert-works.myshopify.com'}, function() { }); if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo Android PWA Dismissed', eventLabel: 'Closed popup without install' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo Android PWA Dismissed', { Closed_popup_without_install: 'AppMixo Android PWA Dismissed' }) } var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } setCookie('appmixo_pwaAndroidMessage', 'showed', 3000); }); } e.userChoice.then(choiceResult=>{ var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }) }); window.addEventListener('appinstalled',(evt)=>{ var elements = document.getElementsByClassName('appmixo_pwa_app_android_install_alert'); while (elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } }); var suburl = '/checkouts'; if(document.URL.indexOf(suburl) !== -1){ if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo PWA Initiate Checkout', eventLabel: 'Initiate Checkout' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo PWA Checkout', { initiate_checkout: 'AppMixo PWA Initiate Checkout' }) } } var suburl = '/thank_you'; if(document.URL.indexOf(suburl) !== -1){ if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo PWA Purchased', eventLabel: 'purchased' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo PWA Purchased', { purchased: 'AppMixo PWA Purchased' }) } } if (window.location.search === '?source=homescreen') { if ('ga' in window) { ga('send', 'event', { eventCategory: 'AppMixo PWA', eventAction: 'AppMixo PWA Open', eventLabel: 'App Open' }) } if (typeof fbq !== 'undefined') { fbq('track', 'AppMixo PWA Open', { App_open: 'AppMixo PWA Open' }) } } })(); }