ituob / ituob.github.io

Searchable ITU OB web view, generated from itu-ob-data
2 stars 2 forks source link

Add Google analytics #44

Closed ronaldtse closed 1 year ago

ronaldtse commented 2 years ago

We should apply Google analytics so as to view traffic.

ronaldtse commented 1 year ago

Google Analytics tag:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-L3TCVBGNJ0"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-L3TCVBGNJ0');
</script>
ronaldtse commented 1 year ago

@strogonoff could you please help add this ASAP? Thanks!

strogonoff commented 1 year ago

@CAMOBAP could you take a look. You can put GA ID into config or just hardcode in template, it’s not important right now I think because we aren’t going to manage it from environment.

ronaldtse commented 1 year ago

This is an urgent issue. @CAMOBAP can you help check? Thanks!

CAMOBAP commented 1 year ago

The implementation looks straight forward - https://morotsman.github.io/blog,/google/analytics,/jekyll,/github/pages/2020/07/07/add-google-analytics.html

PR is on the way

ronaldtse commented 1 year ago

Google Analytics is working now. Thanks @CAMOBAP !

Screenshot 2023-03-23 at 8 40 32 AM