THIS is how to add Google Analytics Code to your Joomla Site

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

User avatar
Ghonjez
Joomla! Exemplar
Joomla! Exemplar
Posts: 8770
Joined: Sat Oct 18, 2008 3:02 am
Location: Mars
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby Ghonjez » Wed Aug 18, 2010 6:08 pm

zanvll wrote:But can I add one of the other statistical code?

Hi...

You can add more than one statistical code because that's my experience

zanvll wrote:This will affect the right SEO?

Do you mean if you're adding many statistical code, it's will decrease SEO rank ?

;)

netbean
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Sep 08, 2010 6:57 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby netbean » Thu Sep 09, 2010 8:06 pm

Nice question and great comments by all. Putting the code in the template work for me.
Thanks

marriah753
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Sep 10, 2010 7:11 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby marriah753 » Fri Sep 10, 2010 8:12 am

This is a nice information on adding Google Analytics Code to your Joomla Site. It makes so easy to understand the content and the procedure. Thanks for sharing.
Last edited by Leftfield on Fri Sep 10, 2010 8:34 am, edited 1 time in total.
Reason: Manual signature is not allowed in post. See your profile for signature.

avantim
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Dec 15, 2008 10:18 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby avantim » Wed Nov 24, 2010 12:09 pm

Hello every one,

my template html end with
$tmplTools->display ($layout);
}

this line plz help me in this issue

avantim
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Dec 15, 2008 10:18 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby avantim » Thu Nov 25, 2010 5:24 am

topazsword wrote:i am having problem in 1.5? i didn't see any </body>

Below shows what i've got
}
//End for main navigation

$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}


Hey there,

how you solve this problem plz tell me i m facing same problem while add the code in joomla 1.5 ja ores template

Regards,
Avanti

amedida
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Thu Mar 18, 2010 3:45 pm
Location: Portugal

Re: THIS is how to add Google Analytics Code to your Joomla

Postby amedida » Thu Nov 25, 2010 10:47 am

Well, you have to look in the template files where the site will pick the <head>.

Usually it will be in the index.php

Solved?

art knotly
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Oct 12, 2010 8:21 pm
Location: DC
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby art knotly » Fri Nov 26, 2010 6:04 pm

In the template and index.php files?
To err is human, to forgive divine. Punch a baby!
http://basementdetective.com
http://moldremediation101.com

icecyboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Nov 28, 2010 9:12 am
Location: Thailand
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby icecyboy » Sun Nov 28, 2010 12:06 pm

When I add Google Analytics Code to my Joomla Site. Is my site risk into goggle sand box?
กระเป๋าแฟชั่น
http://www.lady-choice.com

siryarquest
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Oct 17, 2010 1:48 am
Location: Springfield, MO
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby siryarquest » Mon Nov 29, 2010 4:21 pm

"i am having problem in 1.5? i didn't see any </body>

Below shows what i've got
}
//End for main navigation

$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}"


I had to put it at the beginning of the code, I tried it at the end, it blew chow.
First of all, there was no /head anywhere in the code (/head is not valid syntax in PHP) so therefore there is no /body as well.

I will update you guys later on whether or not it worked.

wises
Joomla! Intern
Joomla! Intern
Posts: 61
Joined: Wed Feb 18, 2009 11:28 pm

Another Solution

Postby wises » Tue Nov 30, 2010 11:51 pm

Here is a dead simple method for adding Google Analytics to your joomla 1.5.21 website here

he has other tutorials as well that will be of interest as well.

enjoy!.
8)

User avatar
Canopee
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Dec 01, 2010 11:15 am
Location: 13500 Martigues
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby Canopee » Wed Dec 01, 2010 3:49 pm

Thank you
Last edited by v2interactive on Wed Dec 01, 2010 4:31 pm, edited 1 time in total.
Reason: Only literal URL's in signature: http://forum.joomla.org/viewtopic.php?f=8&t=65

kevb8ll
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Fri Mar 23, 2007 9:04 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby kevb8ll » Sat Mar 26, 2011 5:27 pm

I have installed the code inside the head tags and seems to be working, does the code work through the whole site or just the index page?

brittney marie
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Fri Feb 11, 2011 7:18 am
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby brittney marie » Thu Mar 31, 2011 1:14 pm

Hey thanks for sharing it with me!!
Signature rules: Literal URLs only - viewtopic.php?f=8&t=65

jyork
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Apr 06, 2011 11:25 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby jyork » Thu Apr 28, 2011 9:56 pm

First, I'd like to thank you guys for the useful information, but I'm having a problem. I just added the code to my site, and i think there might be a problem. This is my first time using google analytics, so i could be wrong. In the "website profiles" section on the google analytics page under the "status" column, it is giving me a caution sign that says "tracking unknown." Also, it is telling me that i have had no visitors, while my site itself is saying i have two guests. Does anyone know what i can do to fix it?
[EDIT] false alarm, guys. I got it to work.

tinus2003
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Wed Oct 18, 2006 9:25 am
Location: Holland
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby tinus2003 » Fri May 06, 2011 6:32 pm

Hi Jyork, You may just have to be a bit patient. Google Analytics is not a real time tool. The data refreshed every few hours. If you continue having problems, let me know!
Kinds regards,
Martijn
http://www.analyticsforjoomla.com - Analytics plugins for Joomla
Follow us on Twitter: @analyticsjoomla

Gstar09
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Jun 10, 2011 12:41 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby Gstar09 » Tue Jun 21, 2011 3:19 am

OHHHH is that true?? I kept changing from body to head o body...and probably should wait!!

thanks a lot

ashok_be
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 148
Joined: Wed Jul 07, 2010 4:34 am
Location: Bengaluru - Karnataka

Re: THIS is how to add Google Analytics Code to your Joomla

Postby ashok_be » Tue Jun 21, 2011 3:50 am

good post ya
"Life is a Challenge, Win or Loss, We need to be Positive."
Ashok A

karencheah
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun May 25, 2008 6:08 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby karencheah » Thu Sep 01, 2011 8:02 am

Hi Haynest,

This is a great tip. I placed the GA code just before </head> and it works perfectly. Thanks for the post!

Cheers,
Karen

millerdigital
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 13, 2011 1:16 pm
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby millerdigital » Tue Sep 13, 2011 1:25 pm

@hotwebideas - thanks so much for that tip on tinymc, oh myyyy

Like to mention here that I'm recommending to paste the code manually, I'm sure module is fine, but in my case of Zephyr template I was using their template setting to insert the code and let the template system handle it, to my dismay none of my pages under the root were being tracked for months now and the code source that was handling the GA tracking code was very cryptic, nothing I have seen from GA in past. My fault for not checking sooner, fortunately Zephyr let me edit the HTML without screwing things up and I was able to insert the latest tracking code and view source is showing it on all pages correctly now so I assume I'm all set.

Some minor usability notes in GA, if your tracking more than one site from the Overview page the edit link next to profile opens a different edit view, you need to make sure you first open the site profile in question, then click edit link, you get the full profile settings where I was able to find my latest tracking code. This I spent a half hour in GA trying to find my latest tracking code but Google Help to the rescue.

StefanOne
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Feb 16, 2011 10:23 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby StefanOne » Sat Oct 01, 2011 6:35 pm

avantim wrote:
topazsword wrote:i am having problem in 1.5? i didn't see any </body>

Below shows what i've got
}
//End for main navigation

$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}


Hey there,

how you solve this problem plz tell me i m facing same problem while add the code in joomla 1.5 ja ores template

Regards,
Avanti


The solution is very simple and straightforward. Your index.php just uses other php files which contain the header tag. Look for folder named 'layouts' in the folder of your default template. It should contain some php files(usually used to render the design of your site for different devices like iphone, other handheld devices etc.). Find the one named default and insert the analytics code in its header tag.
Go to Template Manager-->'Your template'->>Parameters and see if there is parameter called Default Layout. Make sure it is set to 'default'. After a couple of hours Google will be finished collecting your website info.

P.S. I know your post is old, but I just saw it. Hope it helps someone.

rjus
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Nov 09, 2011 3:32 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby rjus » Wed Nov 09, 2011 3:35 pm

hey guys!

What about in joomla 1.7?

I found the template manager but there's nothing sayng 'edit html'.=X

please, help me

jpxgen
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Nov 29, 2011 8:01 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby jpxgen » Tue Nov 29, 2011 8:09 pm

StefanOne wrote:
avantim wrote:
topazsword wrote:i am having problem in 1.5? i didn't see any </body>

Below shows what i've got
}
//End for main navigation

$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}


Hey there,

how you solve this problem plz tell me i m facing same problem while add the code in joomla 1.5 ja ores template

Regards,
Avanti


The solution is very simple and straightforward. Your index.php just uses other php files which contain the header tag. Look for folder named 'layouts' in the folder of your default template. It should contain some php files(usually used to render the design of your site for different devices like iphone, other handheld devices etc.). Find the one named default and insert the analytics code in its header tag.
Go to Template Manager-->'Your template'->>Parameters and see if there is parameter called Default Layout. Make sure it is set to 'default'. After a couple of hours Google will be finished collecting your website info.

P.S. I know your post is old, but I just saw it. Hope it helps someone.


@StefanOne your solution really helped. Thanks a lot.

Regards,
JP

User avatar
Kev261266
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 177
Joined: Thu May 20, 2010 7:33 am
Location: South Shields, UK

Re: THIS is how to add Google Analytics Code to your Joomla

Postby Kev261266 » Thu Dec 01, 2011 6:45 am

I was wondering why my google analytics was not working. I know why after reading this post.

Great info. Still relevant to the latest Joomla edition.
Cheers.

Kev.
----

datametric
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Dec 31, 2011 7:17 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby datametric » Sat Dec 31, 2011 7:19 pm

Hi

Did you see that ?

http://www.yootheme.com/themes/warp-framework and the Admin User Interface explanation ?

jhachkowski
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Jun 29, 2011 1:52 am
Location: Winnipeg
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby jhachkowski » Sat Jan 28, 2012 2:51 pm

I'm not new to installing tracking code on webpages, but I was having a bit of a trouble, and thought this might help people in the future.

I'm using J 1.7 on this site http://winnipegcarpetinstallers.com

I installed the snippet in the template (as the template had a box for adding the ID and generates the code). Google says no data.

I installed the snippet in a module position. Google says no data.

I finally thought about webmaster tools and verifying ownership of the site....Now GA is receiving data.

Moral of the story: Be sure to use webmaster tools to verify ownership of the site, or you may be unable to track a damn thing :)

Peace.

Lamer4o
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Thu May 20, 2010 11:37 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby Lamer4o » Thu Mar 08, 2012 1:40 am

Can some one tell me a way with out posting the code in the <body> </body> (Edit html) because the template i'm using and made doesn't have a body tag in the Edit Html.


*Edit :
Will it work if i Create a Custom HTML Module and Enable - > Put it on the Footer on all pages ?
Please read forum rules regarding signatures: viewtopic.php?t=65

socksiong
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Mar 08, 2012 5:40 pm
Contact:

Re: THIS is how to add Google Analytics Code to your Joomla

Postby socksiong » Tue Mar 20, 2012 9:01 am

after adding the code, Analytics still did not detect any code installed, any idea why?

stephanie_wg23
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu May 20, 2010 7:30 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby stephanie_wg23 » Sun May 13, 2012 2:23 pm

Hi!
Thank you for the information. I have recently installed the extension j4age: http://extensions.joomla.org/extensions ... 11750...to collect stats. Only later to find out that google analytics is also supported in joomla. Do you by any chance know the difference and which is better in terms of security for the website or to refer to a client.
Thanks in advance...
Best,
Stephanie

jdran
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 165
Joined: Thu Aug 16, 2012 5:32 pm

Re: THIS is how to add Google Analytics Code to your Joomla

Postby jdran » Fri Aug 31, 2012 3:45 pm

Is it ok if I add this before the /head tag and especially, is it ok if I do this while my site is offline for common users? I am going to open my site for common users in couple of weeks, just I don't know if it is ok to do it before my site is not indexed yet..

dsdsdsdsd
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Mon Sep 26, 2011 8:42 am

Re: THIS is how to add Google Analytics Code to your Joomla

Postby dsdsdsdsd » Wed Sep 05, 2012 7:07 pm

thanks very much.

one question: once I have installed the ga init code, how do I assign a mouseevent to a menu item click?


thanks,
dsdsdsdsd


Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 3 guests