Skip to content

Commit

Permalink
fix: upgrade to GA4 analytics and add download event
Browse files Browse the repository at this point in the history
Closes #491
  • Loading branch information
stdavis committed Mar 20, 2023
1 parent 39675f0 commit a40a87c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions _src/app/download/Download.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ define([

this.gp.submitJob(params);

window.gtag('event', 'download', {
format: this.fileTypes.value,
layers: Object.keys(this.downloadFeatures).join(', ')
});

return params;
},
showLoader: function () {
Expand Down
11 changes: 5 additions & 6 deletions _src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@
/build -->

<!-- GOOGLE ANALYTICS -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-86JW86154S"></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');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

ga('create', 'UA-11849964-48', 'auto');
ga('send', 'pageview');
gtag('config', 'G-86JW86154S');
</script>

<!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->
Expand Down

0 comments on commit a40a87c

Please sign in to comment.