Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: How to Install New Google Analytics gtak.js file  (Read 2021 times)

0 Members and 1 Guest are viewing this topic.

andyschlei

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Posts: 9
How to Install New Google Analytics gtak.js file
« on: July 13, 2022, 01:30:48 am »

I am trying to track my gallery in the new Google Analytics as the old one is being deprecated.  To collect data, they require you to put this snippet of code into page in the <head> section of the HTML.

How would I do this in my Coppermine installation?

Here is the code

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

  gtag('config', 'X-XXXXXXXXX');
</script>
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4886
    • Windsurf.me
Re: How to Install New Google Analytics gtak.js file
« Reply #1 on: July 13, 2022, 09:58:49 pm »

Whatever theme you are using contains a number of files theme.PHP, style.css and template.html . The template.html is where you need to place your code.

https://coppermine-gallery.net/docs/curr/en/theme.htm#theme_files
Logged
It is a mistake to think you can solve any major problems just with potatoes.

andyschlei

  • Coppermine newbie
  • Country: us
  • Offline Offline
  • Posts: 9
Re: How to Install New Google Analytics gtak.js file
« Reply #2 on: July 15, 2022, 12:40:16 am »

Great, thank you!
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.