var dmlphytoWrapperElement = document.getElementById("dml_phyto_wrapper"); dmlphytoWrapperElement.style.transition = "all 0.5s;"; var phyto_banner_cta_active = true; var phytoCSSid = 'phytoStyleSheet'; let sessionTimeString = (new Date()).getTime(); var phyto_pagehead = document.getElementsByTagName('head')[0]; var phyto_pagelink = document.createElement('link'); phyto_pagelink.id = phytoCSSid; phyto_pagelink.rel = 'stylesheet'; phyto_pagelink.type = 'text/css'; phyto_pagelink.href = 'https://phytotouch-production.herokuapp.com/stylesheets/style.min.css?'+sessionTimeString; phyto_pagelink.media = 'all'; phyto_pagehead.appendChild(phyto_pagelink); window.phyto_forcedLanguageCode = typeof window.phyto_forcedLanguageCode != "undefined" ? window.phyto_forcedLanguageCode : ""; window.phyto_hasBanner = typeof window.phyto_hasBanner != "undefined" ? window.phyto_hasBanner : true; window.phyto_isEmbed = typeof window.phyto_isEmbed != "undefined" ? window.phyto_isEmbed : true; window.phyto_maxwidth = typeof window.phyto_maxwidth != "undefined" ? window.phyto_maxwidth : "100%"; window.phyto_maxheight = typeof window.phyto_maxheight != "undefined" ? window.phyto_maxheight : window.innerHeight +"px"; window.phyto_bannerwidth= typeof window.phyto_bannerwidth != "undefined" ? window.phyto_bannerwidth : "100%"; window.phyto_banner_cta_title= typeof window.phyto_banner_cta_title != "undefined" ? window.phyto_banner_cta_title : "phyto touch"; window.phyto_banner_cta_text= typeof window.phyto_banner_cta_text != "undefined" ? window.phyto_banner_cta_text : "reawaken your skin with the power of touch"; window.phyto_banner_cta_button= typeof window.phyto_banner_cta_button != "undefined" ? window.phyto_banner_cta_button : "show me how"; dmlphytoWrapperElement.style.width = window.phyto_maxwidth; function logOnLocalHostFrontEnd(inStringBefore,inVariable){ inStringBefore = (inStringBefore === undefined) ? '' : inStringBefore; if (/localhost/g.test("https://phytotouch-production.herokuapp.com") || /192\.168\.0\./g.test("https://phytotouch-production.herokuapp.com") || /\.ngrok\.io/g.test("https://phytotouch-production.herokuapp.com") || /facemappingconsumer-staging\.herokuapp/g.test("https://phytotouch-production.herokuapp.com")){ if (inVariable == undefined){ console.log(inStringBefore) }else{ console.log(inStringBefore, inVariable) } } } // GA - START window.phytoGAsetup = false; function phytoSendGA(eventName,eventValue){ eventValue = (eventValue == undefined) ? "" : eventValue; if (window.phytoGAsetup){ if (window.ga) { window.ga('phyto_gtag.send', 'event', eventName, eventValue); }else if (window.gtag) { window.gtag('event', eventName, {value: eventValue}); } else if (window._gaq) { window._gaq.push(['phyto_gtag._trackEvent',eventName,eventValue]); } } } function phytoSetupGA(){ let pageTitle ="not found"; pageTitle = window.location.hostname; if (window.ga) { window.ga('create', 'UA-36853599-27', 'auto', 'phyto_gtag'); // change with new value! window.ga('phyto_gtag.set','anonymizeIp', true); window.ga('phyto_gtag.send','pageview',window.location.href); }else if (window.gtag) { window.gtag('config', 'UA-36853599-27', { 'anonymize_ip': true, 'page_title': pageTitle , 'page_location': window.location.href }); } else if (window._gaq) { window._gaq.push(['phyto_gtag._setAccount','UA-36853599-27'],['phyto_gtag._trackPageview']); } window.phytoGAsetup = true; } // GA - END function getEmbedHtmlData(url, callback){ let request = new XMLHttpRequest(); request.open('GET', url, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { // Success! callback({"status": "success","status_code":request.status, "data" : request.responseText}); } else { // We reached our target server, but it returned an error callback({"status": "success","status_code":request.status, "data" : "We reached our target server, but it returned an error"}); } }; request.onerror = function() { // There was a connection error of some sort callback({"error": "success","status_code":request.status, "data" : "Error occured in getting html data"}); }; request.send(); } function dmlphyto_getScript(source, callback) { //console.log('inside get script call'); var script = document.createElement('script'); //var prior = document.getElementsByTagName('script')[0]; script.async = 1; script.onload = function(evt) { //console.log(source ," ready state: ",evt); callback({"status":"success","message":"done"}); }; script.onerror = function(err){ console.log(err) callback({"status":"error", "message":"error in getting script " + source}); } script.setAttribute('type','text/javascript'); script.src = source; dmlphytoWrapperElement.appendChild(script); } function dmlphyto_getScript_withAttributes(source, attributeObj, callback) { //console.log('inside get script call'); var script = document.createElement('script'); //var prior = document.getElementsByTagName('script')[0]; script.async = 1; script.onload = function(evt) { //console.log(source ," ready state: ",evt); callback({"status":"success","message":"done"}); }; script.onerror = function(err){ console.log(err) callback({"status":"error", "message":"error in getting script " + source}); } script.setAttribute('type','text/javascript'); try{ Object.keys(attributeObj).forEach( function(attrKey){ script.setAttribute(attrKey,attributeObj[attrKey]); }); }catch(err){ console.log(err); } script.src = source; dmlphytoWrapperElement.appendChild(script); } function phytoOpenApp(){ let gaTimer = 100; let gacheckinterval = setInterval(function(){ if (window.ga){ logOnLocalHostFrontEnd("GA AVAILABLE - "+ gaTimer/1000 + "s",""); clearInterval(gacheckinterval); phytoSetupGA(); }else{ if (gaTimer > 10000){ logOnLocalHostFrontEnd("GA NOT AVAILABLE - "+ gaTimer/1000 + "s",""); clearInterval(gacheckinterval); } gaTimer += 100; } },100) if (dmlphytoWrapperElement.offsetWidth > 768 && false){ dmlphytoWrapperElement.innerHTML += '
Still interested?
To preview this widget now, visit www.phytotouch.com from your mobile device
We don\'t currently support this browser. Please reopen this page in a different browser, such as Chrome.