Support Forums

Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Google Analytics code

Featured Lock Resolved Task
Hi guys,
as far as I understand we can add Google Analytics using Custom Code > Before </body>, Right ?

Please,
Do I have to add the "The JavaScript tracking snippet" or Can I add the "Alternative async tracking snippet" ?
Can you help adding an example, a link, (tothe documentation) to understand which code we have to add there ?

(I was used only to add the UA-XXXX code)

17 Answers

Paul Frankowski - Staff

More than a month ago #Permalink
Hi,
yes, you have two options:
1) Use whole code (from Google) inside template settings, as you mentioned.
OR
2) Install extra plugin which allows you to put only ID.
I suggest o install free - Eorisis Google Analytics plugin.

Attachments (1)

  • google-analytics-system-plugin-joomla-extension-tracking.jpg
    google-analytics-system-plugin-joomla-extension-tracking.jpg 98.8 KB

joomleb

More than a month ago #Permalink
Hi Paul,
many thanks for your help.

In the first case the best solution is always to add "Alternative async tracking snippet", isn't it ?

What is your favorite solution ?

Google Analytics is something basic,
Do we have any chance to see it implemented directly into Helix Hultimate just adding the UA-XXXX code ?

Paul Frankowski - Staff

More than a month ago #Permalink
1) Adding full tracking code into template settings is the easiest & quicker solution

2) Both, depends of the project.

3) In HU free version I don't think so.

joomleb

More than a month ago #Permalink
Hi Paul,
seem that now Google suggest to implement directly the Global site Tag (gtag.js)

Now, google say to place it "...immediately after the <head> tag on every page of your site..." / "...in the <head> section, and we recommend placing the snippet at the bottom of the section for best performance..."

Here a a good article explaining why to put code in head tag:
The Pageview is recorded only after that code is loaded up. So the sooner you load the code, the sooner that Pageview is recorded. Let’s say you have a big blog page, and it’s a slow loading one, taking even 10 to 20 seconds to load everything up. If your Google Code doesn’t start until the end of the page, it can get held up, just like the old non-asynchronous code used to hold up OTHER lines of code. Except now it’s holding up the tracking code. If a visitor to your site hits the page, and then leaves it before the tracking code fires the Pageview, then you lose that visitor. They now become a new direct visit to whatever page of the site they landed on. This can make all sorts of data on your site incorrect.

In Helix Ultimate I have two chance:
- Before </head>
- Before </body>

Please, What is the best choice ?

Paul Frankowski - Staff

More than a month ago #Permalink
For site speed (/body) or for Google (/head)? but to be fully honest with you : We are not Google support to be your oracle.
Beside trends are changing and some people choose different solutions than GA.
----
Anyway you can use also extra plugins 4 GA.

joomleb

More than a month ago #Permalink
Hi Paul,

Google: "...immediately after the <head> tag on every page of your site..." / "...in the <head> section, and we recommend placing the snippet at the bottom of the section for best performance..."

Helix Ultimate:
- Before </head>
- Before </body>

So, the question is also: a "before" </body> is an "after" the <head> tag ?!?

Paul Frankowski - Staff

More than a month ago #Permalink
In Helix Ultimate you cannot from settings add line after open <head> !
only before end of </head> tag. That's why I suggested you to use addcional / extra plugin for it.
For example: eorisis Google Analytics or similar.

Paul Frankowski - Staff

More than a month ago #Permalink
it's not suggested to use this same tracking/stats code twice. It will not help, and even worse -> it can slow down your site. Choose only one way.

Céline Charles

More than a month ago #Permalink
In Helix Ultimate you cannot from settings add line after open <head> !
only before end of </head> tag. That's why I suggested you to use addcional / extra plugin for it.
For example: eorisis Google Analytics or similar.


Do you mean using a (free) plugin is a better way than writing the code before </head> or </body> in Helix Ultimate template?
With what has been said in this thread, I'd rather choose before </body>…

Thanks!

Céline Charles

More than a month ago #Permalink
it's not suggested to use this same tracking/stats code twice. It will not help, and even worse -> it can slow down your site. Choose only one way.


Ok for that. But is one way more advised than the other?

Thks!

Paul Frankowski - Staff

More than a month ago #Permalink
I never seen any difference in stats results.
You can also buy commercial plugin for adding GA code... if this may help you feel better.

Céline Charles

More than a month ago #Permalink
I never seen any difference in stats results.
You can also buy commercial plugin for adding GA code... if this may help you feel better.


No, I'm not that kind!
Thanks a lot for your answer! Then I will do the easiest way… Thanks again!

Paul Frankowski - Staff

More than a month ago #Permalink
adding code in template settings is faster and request less request from joomla than extra plugin. ;)

Céline Charles

More than a month ago #Permalink
adding code in template settings is faster and request less request from joomla than extra plugin. ;)

So in a way, it's better, isn't it? ;)
Great!

joomleb

More than a month ago #Permalink
Hi guys,
Google has changed something. Now Google suggest to add the new
analytics.js library


The recommendetion was to place it "...immediately after the <head> tag on every page of your site..." / "...in the <head> section, and we recommend placing the snippet at the bottom of the section for best performance..."

Now is to place it "...the code should be added near the top of the <head> tag and before any other script or CSS tags..."

In Helix Ultimate I have two chance:
- Before </head>
- Before </body>

So, again, Please, What is the best choice where to past the code ?

Paul Frankowski - Staff

More than a month ago #Permalink
Use an extra plugin.

if current, built-in solutions are too weak for you.


There are no replies made for this post yet.
Be one of the first to reply to this post!

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 146
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 87
Toufiq

Toufiq

Total Accepted Answers: 25
Pavel

Pavel

Total Accepted Answers: 4
Al Mamun

Al Mamun

Total Accepted Answers: 3

113

Templates

289440

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us