Esempio n. 1
0
function smarty_function_mixpanel($params, Smarty_Internal_Template $template)
{
    $params += array('script' => 'head');
    if ($params['script'] == 'head') {
        return Mixpanel::head_script();
    }
    return Mixpanel::body_script();
}
Esempio n. 2
0
if (!IS_LOCALHOST) {
    ?>
    // Google Analytics code 
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-23722503-1']);
    _gaq.push(['_trackPageview']);

    (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

    // SiftScience code
    var _user_id = "<?php 
    echo $session->userid;
    ?>
"; // TODO: Set to the user's ID, username, email address, or '' if not yet known
    var _sift = _sift || []; _sift.push(['_setAccount', '946aa02e41']); _sift.push(['_setUserId', _user_id]); _sift.push(['_trackPageview']); (function() { function ls() { var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true; e.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.siftscience.com/s.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); } if (window.attachEvent) { window.attachEvent('onload', ls); } else { window.addEventListener('load', ls, false); }})();
    <?php 
}
?>
  </script>

  <!-- Optimizely code -->
  <script src="//cdn.optimizely.com/js/595240679.js"></script>

  <!-- Mixpanel --> 
  <?php 
echo Mixpanel::head_script();