Search…

X3 Photo Gallery Support Forums

Search…
 
nampara17
Topic Author
Posts: 6
Joined: 28 Jul 2024, 16:21

Google analytics field UA code - GA v4 uses a G code

30 Jul 2024, 09:59

Hi Karl,

The field of Google Analytics shows a UA- code. The current GA uses a code that starts "G"xxxx

In fact google have phased out the old UA code analytics and now 'strongly' recommend use the new v4 GA's

The embed code is different in UA code to the G code plus a few other changes.

Is the system (x3) able to deal with the new "G" coding structure for GA please
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14077
Joined: 30 Sep 2006, 03:37

Re: Google analytics field UA code - GA v4 uses a G code

30 Jul 2024, 23:22

Yes it works fine with new tracking ID's. I have checked the latest Javascript code install instructions from Google, and it's the same as X3 is already using. You just need to insert your tracking ID, no matter how the code is formatted.

This is the code noted by Google and used internally by X3:
Code
<script async src="https://www.googletagmanager.com/gtag/js?id=TRACKINGID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'TRACKINGID');
</script>
If it wasn't working (for any reason), you could just leave the "Google Analytics" input field empty, and instead just copy-paste the full Javascript, as instructed from your Google Analytics account, directly into X3 Settings > Custom > <head>.
 
nampara17
Topic Author
Posts: 6
Joined: 28 Jul 2024, 16:21

Re: Google analytics field UA code - GA v4 uses a G code

31 Jul 2024, 04:00

Thanks for confirming.