Move busui to seperate repository
[bus.git] / js_log_tag.tpl
1 <?php if ( isset($options) && ! $this->getValue( 'no_script_wrapper', $options ) ): ?>
2 <!-- Start Open Web Analytics Tracker -->
3 <script type="text/javascript">
4 //<![CDATA[
5 <?php endif;?>
6 var owa_baseUrl = '<?php $this->out( owa_coreAPI::getSetting( 'base', 'public_url' ) ); ?>';
7 var owa_cmds = owa_cmds || [];
8 <?php if (owa_coreAPI::getSetting('base', 'error_handler') === 'development'): ?>
9 owa_cmds.push(['setDebug', true]);
10 <?php endif;?>
11 <?php if ( isset($options) && $this->getValue('apiEndpoint', $options ) ): ?>
12 owa_cmds.push(['setApiEndpoint', '<?php echo $options['apiEndpoint'];?>']);
13 <?php endif;?>
14 owa_cmds.push(['setSiteId', '<?php echo $site_id; ?>']);
15 <?php if ( isset($options) && $this->getValue( 'cmds', $options ) ): ?>
16 <?php $this->out($this->getValue( 'cmds', $options ), false ); ?>
17 <?php endif;?>
18 <?php if (isset($options) && ! $this->getValue('do_not_log_pageview', $options ) ): ?>
19 owa_cmds.push(['trackPageView']);
20 <?php endif;?>
21 <?php if (isset($options) && ! $this->getValue('do_not_log_clicks', $options ) ): ?>
22 owa_cmds.push(['trackClicks']);
23 <?php endif;?>
24 <?php if (isset($options) && ! $this->getValue('do_not_log_domstream', $options ) ): ?>
25 owa_cmds.push(['trackDomStream']);
26 <?php endif;?>
27
28 (function() {
29 var _owa = document.createElement('script'); _owa.type = 'text/javascript'; _owa.async = true;
30 owa_baseUrl = ('https:' == document.location.protocol ? window.owa_baseSecUrl || owa_baseUrl.replace(/http:/, 'https:') : owa_baseUrl );
31 _owa.src = owa_baseUrl + 'modules/base/js/owa.tracker-combined-min.js';
32 var _owa_s = document.getElementsByTagName('script')[0]; _owa_s.parentNode.insertBefore(_owa, _owa_s);
33 }());
34 <?php if ( isset($options) && ! $this->getValue( 'no_script_wrapper', $options ) ): ?>
35 //]]>
36 </script>
37 <!-- End Open Web Analytics Code -->
38 <?php endif;?>