Solved

Using Google Analytics with Joomla site.

Posted on 2013-11-25
21
662 Views
Last Modified: 2016-02-24
I performed all the steps necessary to add Google Analytics with my Joomla site via each and every template  - however the main sign in page with the login boxes - I go to View Source and it doesn't show my Google Analytics code.... what gives?

Then I notice that on all the other pages as well nothing in the source code stating Google Analytics.

The weird thing is I can go to Google Analytics and see how many have visited what web site and how many web pages but nothing in the source code.

Am I correct that you can't go to each and every web page and edit it per say to put your Google Analytics code?.  You can only do that in the template manager for each template?

I have a total of 6 templates and I went under each one and verified that they all had the google analytics code.

This is strange to me.joomla-source.png
0
Comment
Question by:stephenlecomptejr
  • 11
  • 10
21 Comments
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
HI stephenlecomptejr

Not sure why the google analytics code that you manually put in your templates is not showing.  How posting a copy and paste snippet of exactly where on the template the code was put.  It would be of course on the index.php page of your template(s) folder.

But an easy way to add the google snippet to every page is to use a joomla plugin to do it.

You will find plenty of them at the Joomla extensions archive.  Here is a link to a popular free one that I have used  Google analytics plugin on extensions.joomla.org

There are others on the Joomla Extension site, but you can't go wrong with the one I linked to.  You just install it, like any other joomla plugin and put in your google ID UA-xxxxxxxx-x  one time in the plugin's Google ID field and it works.  On every page.

In addition to Google analytics, be sure to set up your site with Google Webmasters tools and send them your sitemap -- XMAP is a popular joomla extension that will do that for you.

Rowby
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
Hey Rowby,

What's the difference between adding the Joomla code on every page versus adding it to every template?

Just about every tutorial on youtube has people adding it to every template through the template manager versus a way to do so on each and every page:

http://www.youtube.com/watch?v=ZeypJckxJ5U
http://www.youtube.com/watch?v=7GHU0u0zRkY
http://www.youtube.com/watch?v=lngXSLnRpBM
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
Rowby,

Here is a snippet of the code you requested.

Thank you for your reply!
Capture.PNG
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
That is at the very end of every template.
0
 
LVL 9

Accepted Solution

by:
Rowby Goren earned 500 total points
Comment Utility
Was that the code that your Google Analytics code said to put in?

Here below another way to do it.  However I strongly suggest you delete your manual code and use the joomla plugin to do it.  The reason I suggest it, is there is a possibility there is something in your joomla installation that is removing javascript.  The plugin would avoid that problem.

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Open in new window

0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
I'm going to try this on Monday.  Sorry for the delay.
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
No problem.  Have a nice weekend!
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
"However I strongly suggest you delete your manual code and use the joomla plugin to do it."

Ok.  So the joomla plugin I found was this:

http://extensions.joomla.org/extensions/site-management/analytics/site-analytics-google-based/6170
http://www.thinkbigshot.com/resources/joomla-extensions.html

The version I needed was for Joomla 2.5

When I downloaded it I only got 2 files - bigshotgoogleanalytics.php and bigshotgoogleanalytics.xml

When I went to the Extension Manager -  Install - and browsed and then upload/install to either of those files it said Unknown Archive Type.

Same thing after downloading this one...

http://deconf.com/advanced-google-analytics-joomla/

Sorry about the delay...
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
Hi

You need to upload the complete zip file (unless the file has the name 'unzip first).

So don't unzip the  zip that you downloaded from the component's website -- Jomla does the unzipping during the installation process.

I think this is the file your probably downloaded for bigshot:  plugin_bigshot_google_analytics_30.zip

Use the joomla extension manager to upload the entire zip file.

Rowby
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
Please, please forgive me for this question but I'm very new to Joomla.

But it did work and installed - but I don't know where I can go and start using it....
=)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
This was the one I installed versus the big shot one.
http://deconf.com/advanced-google-analytics-joomla/
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
Hi Steven,  no problem.  That's what Experts Exchange is for!

First of all that is how you install any joomla extension.  Unless the file is named something like "UNZIP FIRST" then you upload the entire zip file.

Now that you have installed it follow these steps

1)  Go to Extensions > Plugin Manager
2)  You will see near the top of the page a search box.  Type in it "bigshot"  And click on the magnifying glass next to it.
3)  You will see the the bigshot plugin you just installed.  It probably has a red "X" next to it.  That means it is not enabled yet.
4)  Click on the text link " System - BIGSHOT Google Analytics".  That will open up the plugin
5)  Change Status to Enabled (that will get  rid of the red "X" box once you save the plugin.
6)  CLick on the "BASIC" tab.
7)  Enter your Google analytics ID  As you know it's something like "UA-XXXXXXXXX- X.  
8)  Click the "SAVE" button.
9)  You will see that the red "X" has been replaced by a checkmark.

Now if you go through the source code on the various pages on your site you will see the google analytics code has been put in the right place on every single page.

That should do it.  But report back here!

Rowby
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
THe steps for Advanced Google Analytics for Joomla are similar.  The nice thing about the one you chose it has a few more features.  But the installation steps I gave your are essentially the same -- except, I think they also ask you to enter the domain name.

I see they have a video on the page that shows the step by step instructions. You will see they match pretty close to the bigshot ones.

I see that the Advanced Google analytics gives you control over more things, such as multiple domains and categories, etc.    That could be handy down the road.

But for now just put in your Google analytics code and the domain name.   That should do it.

When I set up my next site I will try Advanced Google Analytics for Joomla.  It looks good!

Rowby
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
I did a search in the view source for any ua-
and I see it

I sure appreciate this a bunch
Thank you very much.

Sorry again for the delay but I couldn't back up the site till now!

Stephen
0
 
LVL 1

Author Closing Comment

by:stephenlecomptejr
Comment Utility
I appreciate his quick responses!
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
That's fine.

ANd thanks for letting me know about Advanced Google Analytics for Joomla. Looks like I will be using it instead of Bigshot next time.

And yes, always back up the site over and over again.

I assume you are using Akeeba Backup????

Rowby
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
Hi Stephen,

Thanks for the points!  Best wishes!!!

Rowby
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
Hey rowby

What would be the process then for me to use advanced google analytics instead of big shot without messing up the site?
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
Just go to the plugin manager like you did and go to the Bigshot plugin. Click on the Green checkmark and it will turn into a Red X.  You can also Uninstall Bigshot, but that would take a few extra steps.  Disabling it will have the same effect.  

The code that is put in by the bigshot plugin will disappear from the source code of your pages as soon as the bigshot plugin is disabled.  (You may have to refresh your page(s) to see that the bigshot code has disappeared.)

Rowby
0
 
LVL 1

Author Comment

by:stephenlecomptejr
Comment Utility
Ah okay.

Thank you so much.
0
 
LVL 9

Expert Comment

by:Rowby Goren
Comment Utility
Good!  

Don't hesitate to use Experts Exchange for other issues as they come up. It's a great resource.

Rowby
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

What you will need: Any version of Photoshop or similar product (examples in Photoshop) Internet Access FTP Access to your joomla install or ability to upload images within joomla administrator backend Create Image: Lets start off with cre…
DotNetNuke (DNN) (http://www.dotnetnuke.com) is a leading open source web content management system (CMS) and application development framework for Microsoft .NET. Localization is an essential part of building websites, especially in countries that …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now