analytics: change munchkin script
This commit is contained in:
parent
a706901405
commit
c91295da95
1 changed files with 20 additions and 2 deletions
|
@ -66,9 +66,27 @@
|
|||
|
||||
{% if munchkin_key %}
|
||||
<script type="text/javascript">
|
||||
document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
(function() {
|
||||
var didInit = false;
|
||||
function initMunchkin() {
|
||||
if(didInit === false) {
|
||||
didInit = true;
|
||||
Munchkin.init('{{ munchkin_key }}');
|
||||
}
|
||||
}
|
||||
var s = document.createElement('script');
|
||||
s.type = 'text/javascript';
|
||||
s.async = true;
|
||||
s.src = '//munchkin.marketo.net/munchkin-beta.js';
|
||||
s.onreadystatechange = function() {
|
||||
if (this.readyState == 'complete' || this.readyState == 'loaded') {
|
||||
initMunchkin();
|
||||
}
|
||||
};
|
||||
s.onload = initMunchkin;
|
||||
document.getElementsByTagName('head')[0].appendChild(s);
|
||||
})();
|
||||
</script>
|
||||
<script>Munchkin.init('{{ munchkin_key }}');</script>
|
||||
{% endif %}
|
||||
|
||||
{% if google_analytics_key %}
|
||||
|
|
Reference in a new issue