Google Analytics

Permalink
Hi All,

Does anyone have a nice step by step Google analytics install instruction set and things to watch out for.

Id just like to add this to a new site and wonder if anyone has had experience in this area.

I have seen a post about where to put the code and have read this.

Any other traps to watch out for.

Nige

nige
 
RobertJNL replied on at Permalink Reply
RobertJNL
Hi Nige,

add the following to your theme's footer just before the </body> tag;
<?php  require(DIR_FILES_ELEMENTS_CORE . '/footer_required.php'); ?>


Then in the sitewide settings of your dashboard you can fill in your analytics code.

-Robert
nige replied on at Permalink Reply
nige
Cheers!
Abs0lute replied on at Permalink Reply
Abs0lute
Thanks goodfellow.
SteveAtParadigm replied on at Permalink Reply
Thanks! I didn't know you had to add that php code to the template.

I was tearing my hair out trying to figure out why my analytics code would not appear on the pages!
dibbc replied on at Permalink Reply
dibbc
What am I missing?

Is there a Google Analytics module you have to add first? i don't see where you put in your analytics code.

Nevermind - I see in the dashboard where you can insert the code now.
Tony replied on at Permalink Reply
Tony
oh i just read that you found it. well for anyone else, go to the dashboard, click on the settings tab, then add the google analytics javascript that they provide after signing up to the "Tracking Code" box there in the dashboard. note that your theme must have the footer_required include in the footer.

btw, analytics is good if you want something free, but if you want to have stats that are accessible straight from within your dashboard, that's integrated to work with other blocks, that can tell you exactly what registered users have been visiting, and their paths through the site, then check out this package:
http://www.concrete5.org/marketplace/addons/stats/...
Peters replied on at Permalink Reply
Hi Guys,
Im sorry to be simple but I have no experience with coding. I have the code from Google analytics....and I have pasted it into the Tracking code box.

How do I insert the footer code? Can you please tell me step by step how I do this.
Really appreciate the help
LucasAnderson replied on at Permalink Reply
LucasAnderson
1. Open your FTP program. (The program you used to upload concrete5's file to your server.)

2. Navigate to your /themes folder, then the folder of your current theme.

3. In the /elements folder of your theme folder, there will be a file named footer.php, download and edit in a text editor.

4. Add the following line just before the </body> tag:

<?php  require(DIR_FILES_ELEMENTS_CORE . '/footer_required.php'); ?>


5. Save, and upload/overwrite this file back to your themes /elements folder.

6. Enjoy Google Analytics tracking.
Peters replied on at Permalink Reply
Higuys,

im sorry to be so simple...but i have added my google analytics code to the tracking code part found under "dashboard" and Settings. Im assuming this is where i put it....but i dont understand the instructions kindly provided above.
I dont really understand the FTP file as i use concrete 5 to host my site. How do i insert this footer into the theme? im tearing my hair out. I tried going to dashboard and then pages and themes...but still cannot work out where to go. Please can somebody help!!!!
Tony replied on at Permalink Reply
Tony
most themes should have the footer_required.php included by default, but if it's not working, then open up your theme's directory.

if you installed a theme from the marketplace it's probably in the packages directory:
/packages/your_theme_package_name/themes/your_theme_name/

otherwise, if you theme was custom made, it should be located here:
/themes/your_theme_name/

then have a look to see if the theme includes a standard footer file for all of it's page types. this might just be called footer.php, or maybe it's located at /elements/footer.php

then paste in this piece of code:

<?php Loader::element('footer_required'); ?>

some themes don't have a footer.php file, in that case you've got to just open up each available page type file, and paste that text in the bottom of the file.
nige replied on at Permalink Reply
nige
Hi Guy,
Unfortunately you will need to insert this piece of code (mentioned above) into the document named footer.php.

This page exists in your C5 install and the code must be put into it.

If you don't know what I am talking about then you must ask the person who installed C5 for you. I assume you only ever edit the site using the C5 dashboard?

You have to get access to footer.php which resides in your c5 install as mentioned above.

Talk to the person who set it all up for you because you cant do it without access to this page.

Hope that helps.

Nige
nige replied on at Permalink Reply
nige
I seem to have this code at the bottom

<?php $this->inc('elements/footer.php'); ?>

I guess it does the same job because it works?

N
Tony replied on at Permalink Reply
Tony
that footer.php probably includes footer_required.php within it then
nige replied on at Permalink Reply
nige
the wonders of php..
Mnkras replied on at Permalink Reply
Mnkras
instead of the above code use

<?php  Loader::element('footer_required'); ?>
hereNT replied on at Permalink Reply
hereNT
If you look at what google is saying now, the script is supposed to go in the head:

"Copy the following code, then paste it onto every page you want to track immediately before the closing </head> tag."

I'm guessing there are a lot of people that were screwed by this :P
nige replied on at Permalink Reply
nige
...your reading the section that relates to PHP based database websites,

there is a section devoted to this and it's different, it makes more sense