Skip to content

Commit

Permalink
commit updated syntax for g analytics tag, re #11131
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Jul 3, 2024
1 parent 4de3d92 commit d84e33c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions arches/app/templates/base.htm
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@

{% if app_settings.GOOGLE_ANALYTICS_TRACKING_ID != None %}

<script async src="https://www.googletagmanager.com/gtag/js?id={{app_settings.GOOGLE_ANALYTICS_TRACKING_ID}}"></script>
<script>
(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');

ga('create', '{{app_settings.GOOGLE_ANALYTICS_TRACKING_ID}}', 'auto');
ga('send', 'pageview');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{app_settings.GOOGLE_ANALYTICS_TRACKING_ID}}');
</script>

{% endif %}
Expand Down

0 comments on commit d84e33c

Please sign in to comment.