After using various googleanalytics mods for years, I now find myself cleaning up a lot of crap! I have created a small mod to clean up and use the gtags analytics code.
But testing needs to be done. The mod is available on github for use and I invite anyone to help with any edits necessary.
https://github.com/wiztechinc/googleAnalytics/
All that's needs doing on the template is adding this code to the html_header before the ending head tag:
PHP Code:
<?php
if (GA_ENABLED == 'True') {
{
?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo GOOGLE_ANALYTICS_UACCT ?>"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '<?php echo GOOGLE_ANALYTICS_UACCT ?>');
</script>
<?php }
?>
Bookmarks