Page 1 of 1

Google Analitycs

Posted: 23 Aug 2021, 13:39
by mattaleis
I would like to see statistics. I tried to input the code in the index.php and bewteen the <head>. But it don't work. 

Can you help me please

Re: Google Analitycs

Posted: 09 Nov 2021, 06:30
by mjau-mjau
Hi. Apologies. I'm not sure why, but it seems I missed this post a couple of months ago. Since Files app 0.3.0, you can include your own head.html that may contain counters / analytics etc. For example Google Analytics:

  1. Create a file _files/include/head.html
  2. Open the file and add your Google analytics tracking code, something like this:
    Code
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-123456-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-123456-1');
    </script>
That's basically it. Google analytics will automatically track navigation (pages) when url changes.