diff options
| author | spiderr <spiderr@bitweaver.org> | 2023-08-27 15:24:40 -0400 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2023-08-27 15:24:40 -0400 |
| commit | 19f88c253a2b1041bab24d5bce260abffa9b1612 (patch) | |
| tree | 83fd01d58ddb9bee122578396b276a704a3f280f | |
| parent | c2fc1402cdff299dcf2c0042f67c67f8ed2f7d14 (diff) | |
| download | stats-19f88c253a2b1041bab24d5bce260abffa9b1612.tar.gz stats-19f88c253a2b1041bab24d5bce260abffa9b1612.tar.bz2 stats-19f88c253a2b1041bab24d5bce260abffa9b1612.zip | |
add support for google_tagmanager_id and google_adwordstag_id
| -rw-r--r-- | templates/html_head_inc.tpl | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index 4d60112..361feac 100644 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl @@ -2,7 +2,29 @@ {* Google analytics setup *} {if $gBitSystem->isTracking()} - {* **** GOOGLE ANALYTICS **** *} + {* **** GOOGLE TAG MANAGER **** *} + {if $gBitSystem->getConfig('google_tagmanager_id')} +{literal} +<!-- Google Tag Manager --> +<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','{/literal}{$gBitSystem->getConfig('google_tagmanager_id')}{literal}');</script> +<!-- End Google Tag Manager --> + {/if} + + {* **** GOOGLE ADWORDS **** *} + {if $gBitSystem->getConfig('google_adwordstag_id')} +<!-- Google tag (gtag.js) --> +<script async src="https://www.googletagmanager.com/gtag/js?id={/literal}{$gBitSystem->getConfig('google_adwordstag_id')}{literal}"></script> +<script> + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', '{/literal}{$gBitSystem->getConfig('google_adwordstag_id')}{literal}') +</script> +{/literal} + {/if} + + {* **** GOOGLE UNIVERSAL ANALYTICS **** *} +<!-- Google Univeral Analytics --> {if $gBitSystem->getConfig('analytics_google_ua')} <script async src="https://www.googletagmanager.com/gtag/js?id={$gBitSystem->getConfig('analytics_google_ua')}"></script> <script> |
