Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-18-2021 14:54:09

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

New Google Analytics Tag

Google says they want me to update my Analytics Tag as per the quote and code below.

Previously you've said that K9 will handle this, but I just wanted to check whether the config line they mention is in place and, if not, which file I should edit to include it.

Global Site Tag (gtag.js)

This is the Global Site Tag (gtag.js) tracking code for this property. Copy and paste this code as the first item into the <HEAD> of every web page that you want to track. If you already have a Global Site Tag on your page, simply add the config line from the snippet below to your existing Global Site Tag.

Code:

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

  gtag('config', 'UA-xxxxxxxx-1');
</script>

Offline

 

#2 03-19-2021 08:34:16

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: New Google Analytics Tag

K9 executes Google Analytics and Google Tag Manager separately so they use different code than what you posted.  That looks like combined code that pushes the Google Analytics id through Google Tag Manager.  Our setup is not like this.  We fire them individually.


Nick Hendler

Offline

 

#3 10-16-2021 03:37:50

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 882

Re: New Google Analytics Tag

I thought I would give it a try and just added the above gtag code to skin.php via Dashboard / System / Displays / Display Skins just under the <head> tag. Both the old and new Analytics code are running and collecting data.

Last edited by sdn (10-16-2021 03:38:26)


Simon

Offline

 

#4 10-18-2021 08:25:59

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: New Google Analytics Tag

The best place to lay the new tag in is {private}/core/CORE/includes/jslib.php - replace the GA and GTM code there.


Nick Hendler

Offline

 

Board footer