Search…

X3 Photo Gallery Support Forums

Search…
 
mattaleis
Topic Author
Posts: 1
Joined: 23 Aug 2021, 10:20

Google Analitycs

23 Aug 2021, 13:39

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
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Google Analitycs

09 Nov 2021, 06:30

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.