How to add Google Analytics? Topic is solved
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
How to add Google Analytics?
Hello,
normally, it goes into the index.php of I am not mistaken.
But when I create a child template the index.php cannot be copied.
I am afraid that when I add something to the index.php it will be overridden by future updates.
Anyone knows about that?
normally, it goes into the index.php of I am not mistaken.
But when I create a child template the index.php cannot be copied.
I am afraid that when I add something to the index.php it will be overridden by future updates.
Anyone knows about that?
- sozzled
- Joomla! Master
- Posts: 12201
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: How to add Google Analytics?
As I wrote in reply to another question of yours:
It's more practical to create a custom HTML module to add the required [Javascript] code and assign the module to one of the existing template's module positions and enable the module on the pages where you want to collect analytic information. Alternatively, if you're using a template that supports such a feature (Cassiopeia does not have a feature like this built in), it may be possible to add Javascript code "globally".
I use both approaches in my webcraft.
This includes making changes to the template's index.php file.
It's more practical to create a custom HTML module to add the required [Javascript] code and assign the module to one of the existing template's module positions and enable the module on the pages where you want to collect analytic information. Alternatively, if you're using a template that supports such a feature (Cassiopeia does not have a feature like this built in), it may be possible to add Javascript code "globally".
I use both approaches in my webcraft.

“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
Re: How to add Google Analytics?
I have never thought of doing it into a module.
That is fantastique. I am using Cassiopeia, because I think this is also a very good and fast template with a lot possibilities if you are familiar with it. Will take some time.
Thank you.
That is fantastique. I am using Cassiopeia, because I think this is also a very good and fast template with a lot possibilities if you are familiar with it. Will take some time.
Thank you.
-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
Re: How to add Google Analytics?
How do I assign a module to the <head> position? Google requires one code to be placed between the <head> area.
- sozzled
- Joomla! Master
- Posts: 12201
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: How to add Google Analytics?
You don't necessarily have to assign the module to the <head> section (even if that's what Google "recommends"). Try assigning the module to any position and see if Google Analytics—I assume that's what we're discussing—starts collecting data. Works for me. 

Last edited by sozzled on Tue Jul 05, 2022 9:26 pm, edited 1 time in total.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

- AMurray
- Joomla! Exemplar
- Posts: 7817
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: How to add Google Analytics?
Google says put the code in the <head> section of the HTML, not the "head module position". Two different things...... ?
Regardless, using the custom module makes sense.
Regardless, using the custom module makes sense.
Regards - A Murray
-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
Re: How to add Google Analytics?
So, I added the code into two modules, and after waiting overnight it is not working.
- sozzled
- Joomla! Master
- Posts: 12201
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: How to add Google Analytics?
Try something simpler: one module (not two). What is the [Javascript] code you're using to feed your site visits into Google Analytics?
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
Re: How to add Google Analytics?
I found a very simple Plugin: https://github.com/GHSVS-de/plg_system_ ... 2022.04.08
- sozzled
- Joomla! Master
- Posts: 12201
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: How to add Google Analytics?
I don't know anything about this plugin. Does it work?
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
Re: How to add Google Analytics?
Looks like. Let you know in a while. Got that from the German Joomla.de site forum.
- sozzled
- Joomla! Master
- Posts: 12201
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: How to add Google Analytics?
Good for you. 

“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Jul 12, 2022 9:25 pm
Re: How to add Google Analytics?
1. Login to Joomla Admin Panel. 2. On the left side menu, go to Extensions → Extension Manager. 3. Click Browse button and select the zip file containing the plugin. 4. Click Upload & Install and then click Install Now. 5. Click Go to extension and click Google Analytics. 6. Copy the script and paste it into the <head> tag at the beginning of your website’s HTML. 7. Click Save Config.
-
- Joomla! Enthusiast
- Posts: 192
- Joined: Thu Aug 09, 2007 2:08 pm
Re: How to add Google Analytics?
juliana9089 wrote: ↑Tue Jul 12, 2022 9:30 pm1. Login to Joomla Admin Panel. 2. On the left side menu, go to Extensions → Extension Manager. 3. Click Browse button and select the zip file containing the plugin. 4. Click Upload & Install and then click Install Now. 5. Click Go to extension and click Google Analytics. 6. Copy the script and paste it into the <head> tag at the beginning of your website’s HTML. 7. Click Save Config.




