diff options
| author | spiderr <spiderr@bitweaver.org> | 2020-11-18 00:40:55 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2020-11-18 00:40:55 -0500 |
| commit | f3a671eaf468bef1d980a0edabfa96e5e5321a5d (patch) | |
| tree | b24fafadef41daa686c50159a7f2d4e0bd4ddd7d | |
| parent | c7eecd687f46a2d1fe764b3e28ad1c453eb8b8f3 (diff) | |
| download | stats-f3a671eaf468bef1d980a0edabfa96e5e5321a5d.tar.gz stats-f3a671eaf468bef1d980a0edabfa96e5e5321a5d.tar.bz2 stats-f3a671eaf468bef1d980a0edabfa96e5e5321a5d.zip | |
add analytics for google and microsoft; remove boostsuite
| -rw-r--r-- | admin/admin_stats_inc.php | 3 | ||||
| -rw-r--r-- | templates/admin_stats.tpl | 19 | ||||
| -rw-r--r-- | templates/html_head_inc.tpl | 39 |
3 files changed, 28 insertions, 33 deletions
diff --git a/admin/admin_stats_inc.php b/admin/admin_stats_inc.php index 6de3290..48d40e7 100644 --- a/admin/admin_stats_inc.php +++ b/admin/admin_stats_inc.php @@ -9,6 +9,7 @@ if( !empty( $_REQUEST['change_prefs'] ) ) { foreach( $formFeaturesBit as $item => $info ) { simple_set_toggle( $item, STATS_PKG_NAME ); } + $gBitSystem->storeConfig( 'analytics_google_ua', BitBase::getParameter( $_REQUEST, 'analytics_google_ua' ) ); + $gBitSystem->storeConfig( 'analytics_microsoft_ti', BitBase::getParameter( $_REQUEST, 'analytics_microsoft_ti' ) ); } -?> diff --git a/templates/admin_stats.tpl b/templates/admin_stats.tpl index 57ff0f7..4c5e5f2 100644 --- a/templates/admin_stats.tpl +++ b/templates/admin_stats.tpl @@ -2,10 +2,27 @@ {strip} {form legend="Statistics Settings"} <input type="hidden" name="page" value="{$page}" /> + + <div class="form-group"> + {formlabel label="Google Analytics UA" for="analytics_google_ua"} + {forminput} + <input type="text" class="form-control" name="analytics_google_ua" id="analytics_google_ua" value="{$gBitSystem->getConfig('analytics_google_ua')|escape}" /> + {formhelp note="UA from anayltics.google.com"} + {/forminput} + </div> + + <div class="form-group"> + {formlabel label="Microsoft Analytics TI" for="analytics_microsoft_ti"} + {forminput} + <input type="text" class="form-control" name="analytics_microsoft_ti" id="analytics_microsoft_ti" value="{$gBitSystem->getConfig('analytics_microsoft_ti')|escape}" /> + {formhelp note="TI from ads.microsoft.com conversion javascript"} + {/forminput} + </div> + {foreach from=$formFeaturesBit key=feature item=output} <div class="form-group"> {formlabel label=$output.label for=$feature} - {forminput} + {forminput label="checkbox"} {html_checkboxes name="$feature" values="y" checked=$gBitSystem->getConfig($feature) labels=false id=$feature} {formhelp note=$output.note page=$output.page} {/forminput} diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index bbbc6d9..4d60112 100644 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl @@ -3,45 +3,22 @@ {if $gBitSystem->isTracking()} {* **** GOOGLE ANALYTICS **** *} - {if $gBitSystem->getConfig('google_analytics_ua')} -<script async src="https://www.googletagmanager.com/gtag/js?id={$gBitSystem->getConfig('google_analytics_ua')}"></script> + {if $gBitSystem->getConfig('analytics_google_ua')} +<script async src="https://www.googletagmanager.com/gtag/js?id={$gBitSystem->getConfig('analytics_google_ua')}"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){ldelim}dataLayer.push(arguments);{rdelim} gtag('js', new Date()); - gtag('config', '{$gBitSystem->getConfig('google_analytics_ua')}'); + gtag('config', '{$gBitSystem->getConfig('analytics_google_ua')}'); {if $gBitUser->isRegistered()}gtag('set', {ldelim}'user_id': '{$gBitUser->mUserId}'{rdelim});{/if} </script> - -{*<script> - {literal}(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');{/literal} - ga('create', '{$gBitSystem->getConfig('google_analytics_ua')}', 'auto'); - {if $gBitUser->isRegistered()}ga('set', 'userId', '{$gBitUser->mUserId}');{/if} - ga('require', 'displayfeatures'); - ga('require', 'linkid', 'linkid.js'); -{if $gBitSystem->isPackageActive('bitcommerce')} - ga('require', 'ec'); -{/if} - ga('send', 'pageview'); -</script>*} {/if} - {* **** BOOSTSUITE **** *} - {*if $gBitSystem->getConfig('boostsuite_site_id')} -<script type="text/javascript"> -{literal} -var _bsc = _bsc || {"suffix":""}; -(function() { - var bs = document.createElement('script'); - bs.type = 'text/javascript'; - bs.async = true; - bs.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://d2so4705rl485y.cloudfront.net/widgets/tracker/tracker.js'; - var s = document.getElementsByTagName('script')[0]; - s.parentNode.insertBefore(bs, s); -})(); -{/literal} -</script> - {/if*} + {* **** MICROSOFT ANALYTICS **** *} + {if $gBitSystem->getConfig('analytics_microsoft_ti')}{literal} +<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"{/literal}{$gBitSystem->getConfig('analytics_microsoft_ti')}{literal}"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script> +<noscript><img src="//bat.bing.com/action/0?ti={/literal}{$gBitSystem->getConfig('analytics_microsoft_ti')}{literal}&Ver=2" height="0" width="0" style="display:none; visibility: hidden;" /></noscript> + {/literal}{/if} {/if} {/strip} |
