Created
June 26, 2018 12:54
-
-
Save aseredenko/c0ef3ad82ff05ab19715dfc3f3d2344d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script> | |
<script> | |
var device = '{{ device }}'; | |
const appMP = !!'{{ MP }}'; | |
if (localStorage.getItem("showAbdn") === 'yes' && localStorage.getItem("abdnShown") !== 'yes' && device === 'mobile') { | |
axios.get('https://services.trackingmax.com/abandonment', { | |
params: { | |
site: 'homesecurityhunter.com', | |
mp: appMP, | |
zip: localStorage.getItem("zip"), | |
vid: appJsData.vid, | |
landing_url: appJsData.landing_url | |
} | |
}) | |
.then(function (response) { | |
if (response.data.mobile_enabled && response.data.mobile_html && response.data.mobile_css) { | |
localStorage.setItem('abdnShown', 'yes'); | |
$('#abdn-popup').fadeIn(); | |
$('#abdn-popup .abdn-popup-container').html(response.data.mobile_html); | |
var css = response.data.mobile_css; | |
var head = document.head || document.getElementsByTagName('head')[0]; | |
var style = document.createElement('style'); | |
style.type = 'text/css'; | |
if (style.styleSheet) { | |
style.styleSheet.cssText = css; | |
} else { | |
style.appendChild(document.createTextNode(css)); | |
} | |
head.appendChild(style); | |
} | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment