How to Install New Google Analytics gtak.js file How to Install New Google Analytics gtak.js file
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How to Install New Google Analytics gtak.js file

Started by andyschlei, July 13, 2022, 01:30:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

andyschlei

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

<!-- 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>

phill104

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
It is a mistake to think you can solve any major problems just with potatoes.

andyschlei