[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using Google Analytics with Joomla site.

Posted on 2013-11-25
21
Medium Priority
?
827 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
ID: 39674549
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
ID: 39674944
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
ID: 39674998
Rowby,

Here is a snippet of the code you requested.

Thank you for your reply!
Capture.PNG
0
Get Certified for a Job in Cybersecurity

Want an exciting career in an emerging field? Earn your MS in Cybersecurity and get certified in ethical hacking or computer forensic investigation. WGU’s MSCSIA degree program was designed to meet the most recent U.S. Department of Homeland Security (DHS) and NSA guidelines.  

 
LVL 1

Author Comment

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

Accepted Solution

by:
Rowby Goren earned 2000 total points
ID: 39675112
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
ID: 39685317
I'm going to try this on Monday.  Sorry for the delay.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 39685361
No problem.  Have a nice weekend!
0
 
LVL 1

Author Comment

by:stephenlecomptejr
ID: 39700753
"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
ID: 39701038
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
ID: 39701182
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
 
LVL 1

Author Comment

by:stephenlecomptejr
ID: 39701223
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
ID: 39701230
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
ID: 39701258
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
ID: 39701263
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
ID: 39701266
I appreciate his quick responses!
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 39701268
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
ID: 39701273
Hi Stephen,

Thanks for the points!  Best wishes!!!

Rowby
0
 
LVL 1

Author Comment

by:stephenlecomptejr
ID: 39701278
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
ID: 39701311
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
ID: 39701316
Ah okay.

Thank you so much.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 39701350
Good!  

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

Rowby
0

Featured Post

The IT Degree for Career Advancement

Earn your B.S. in Network Operations and Security and become a network and IT security expert. This WGU degree program curriculum was designed with tech-savvy, self-motivated students in mind – allowing you to use your technical expertise, to address real-world business problems.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One event, two days, a great line-up of speakers, and 48% female presence. Still have no idea what I’m talking about?
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

830 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