Skip to content

Commit

Permalink
Merge pull request #279 from cul/add-matomo-tracking
Browse files Browse the repository at this point in the history
add matomo tracking code
  • Loading branch information
edmadrid authored Feb 14, 2024
2 parents 4e9284c + e37a258 commit 524d728
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions app/views/shared/_google_analytics.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
<%- if Rails.application.config.analytics_enabled == true -%>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-10481105-1"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-890CVKT79K"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-10481105-1');

gtag('config', 'G-890CVKT79K');
</script>

<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://columbia-libraries.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '23']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='//cdn.matomo.cloud/columbia-libraries.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<% end %>

0 comments on commit 524d728

Please sign in to comment.