Skip to content

Commit

Permalink
Atualização do código javascript para registrar dados no GA googleana…
Browse files Browse the repository at this point in the history
…lytics (#1903)
  • Loading branch information
robertatakenaka committed May 20, 2021
1 parent 4ebeb25 commit 370934d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions opac/webapp/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@

{% if not config.DEBUG and config.GA_TRACKING_CODE %}
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.GA_TRACKING_CODE }}"></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', '{{ config.GA_TRACKING_CODE }}', 'auto');
ga('send', 'pageview');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ config.GA_TRACKING_CODE }}');
</script>
<!-- End Google Analytics -->
{% endif %}
Expand Down

0 comments on commit 370934d

Please sign in to comment.