Author |
Message |
mvillamizar
Regular


Joined: Nov 02, 2004
Posts: 54
Location: Colombia
|
Posted:
Tue Jul 25, 2006 6:42 am |
|
Hi,
I want to install google analytics in my website using the last version from raven, does anyone knows where to put it the javascript code that they give you?
Thanks. |
_________________ Mario Villamizar
Web Developer |
|
|
 |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Tue Jul 25, 2006 6:47 am |
|
what do they suggest in the install? |
|
|
|
 |
hitwalker

|
Posted:
Tue Jul 25, 2006 6:55 am |
|
i just read it...
Quote: | Copy and paste the code segment into the bottom of your content, immediately before the closing body tag of each page you are planning to track. If you use a common include or template, you can enter it there. |
you could try putting in your custom footer...after php closing tag. |
|
|
|
 |
mvillamizar

|
Posted:
Tue Jul 25, 2006 12:42 pm |
|
you are talking about the foot.php file or in one of the theme files? |
|
|
|
 |
hitwalker

|
Posted:
Tue Jul 25, 2006 12:44 pm |
|
no...
this one...
includes/custom_files/custom_footer.php |
|
|
|
 |
crypto
Worker


Joined: Aug 02, 2004
Posts: 165
|
Posted:
Wed Aug 23, 2006 8:39 am |
|
Hmmm, where should I put the code? Could somebody send an example, thanx. |
|
|
|
 |
hitwalker

|
Posted:
Wed Aug 23, 2006 8:41 am |
|
what example ?
its easy ...not?
tell me what isnt clear... |
|
|
|
 |
crypto

|
Posted:
Wed Aug 23, 2006 8:51 am |
|
Hmmm, /includes/custom_files/ doesnt have any files which to edit.
Please send a full example code which to edit. Then I can edit the google analytics code as it should be. |
|
|
|
 |
hitwalker

|
Posted:
Wed Aug 23, 2006 8:56 am |
|
ok 1 time deal...
create a php file named custom_footer.php
put that in your includes/custom_files/ folder
and put this in the php file..
Code:<?php
if (stristr($_SERVER['SCRIPT_NAME'], "custom_footer.php")) {
Header("Location: ../index.php");
die();
}
?>
after closingtag HERE comes your code
|
|
|
|
|
 |
crypto

|
Posted:
Wed Aug 23, 2006 9:13 am |
|
Thanx Hitwalker!
I appreciate your help! |
|
|
|
 |
hitwalker

|
Posted:
Wed Aug 23, 2006 9:15 am |
|
|
|
 |
Aikon
New Member


Joined: May 22, 2005
Posts: 6
Location: Oradea
|
Posted:
Fri Aug 25, 2006 6:31 pm |
|
...or you can just add this code into one of the three footer messages from admin->preferences [straight from phpMyAdmin in case it doesn't allow you from admin panel]. |
|
|
|
 |
hitwalker

|
Posted:
Fri Aug 25, 2006 7:08 pm |
|
thats not realy needed,and that could give problems to as the code is javascript. |
|
|
|
 |
Aikon

|
Posted:
Sat Aug 26, 2006 3:37 am |
|
It is javascript & it went smoothly for others. |
|
|
|
 |
hitwalker

|
Posted:
Sat Aug 26, 2006 4:54 am |
|
but i fail to see why you suggested it.
the custom footer is the best place to publish this,and not putting it in the footer lines from within admin. |
|
|
|
 |
Aikon

|
Posted:
Sat Aug 26, 2006 7:43 am |
|
Quote: | but i fail to see why you suggested it. |
Rather than open a editor, create a new file, add the code, save it, login to ftp, upload the file, it seemed to me much easier to login into phpMyAdmin and add][copy/ paste] it from there. That's why I suggested it.
It's just another more comfortable solution!!!
I didn't say that yours isn't good or something. Just another solution.That's all. |
|
|
|
 |
hitwalker

|
Posted:
Sat Aug 26, 2006 8:00 am |
|
well there was a typical reason why i suggested it with the custom footer.
the install of the javascript part clear says to do it before the closing body tag.
fact is that the custom footer comes after the footer messages and therefor would be better,as google says so.... |
|
|
|
 |
Aikon

|
Posted:
Sat Aug 26, 2006 8:29 am |
|
ok I understand.
Google Analytics have some sort of reporting system that allows users to see if they had added the code in the right way.
If you do as I said won't be any problem[no errors issued by this system] so I'm guessing that's ok!!! |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Sat Aug 26, 2006 3:26 pm |
|
Yes, but it won't know if your visitors click any of the links below it, which is why it's suggested to put in the footer as hitwalker suggested, just before the closing body tag. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Aikon

|
Posted:
Sat Aug 26, 2006 5:54 pm |
|
You say something but I think you got it backwards.
Of course it will know:
1. If that link is toward a page from your site[which will contain the footer again, the javascript also] will be no problem with the tracking[hope you'll agree with me on this].
2. If it's about a outside link and you really what to track the clicks for that link you must edit a little bit that link.
Probably you won't believe me so let's see what have Google to Only registered users can see links on this board! Get registered or login! about this:
[bold text is most important]
Quote: | How do I track clicks on outbound links?
Google Analytics provides an easy way to track clicks on links that lead away from your site. Because these links do not lead to a page on your site containing the UTM JavaScript, you will need to tag the link itself with the urchinTracker JavaScript. This piece of JavaScript assigns a pageview to any click on a link - the pageview is attributed to the filename you specify.
For example, to log every click on a particular link to www.example.com as a pageview for "/outgoing/example_com" you would add the following attribute to the link's <a> tag:
<a href="http://www.example.com" onC lick="javascript:urchinTracker('/outgoing/example_com');">
It is a good idea to log all of your outbound links into a logical directory structure as shown in the example. This way, you will be able to easily identify what pages visitors clicked on to leave your site.
Important: if your pages include a call to urchinTracker(), utmLinker(), utmSetTrans(), or utmLinkPost(), your Analytics tracking code must be placed in your HTML code above any of these calls. In these cases the tracking code can be placed anywhere between the opening <body> tag and the JavaScript call. |
|
|
|
|
 |
kguske

|
Posted:
Sat Aug 26, 2006 7:11 pm |
|
These are different subjects. That's saying the tracking code needs to be placed above calls to the javascript, but doesn't address links that occur AFTER the javascript call. I think that's why Google recommends putting the javascript call right before the closing body tag. |
|
|
|
 |
Aikon

|
Posted:
Sat Aug 26, 2006 8:02 pm |
|
kguske, there can be 2 kind of links as I said before.
The first type is clear.
The problem lies with the outside links, you cannot track a outside link[clicks] even if you put hat code after de </bo dy> tag unless you are doing what they said.
Quote: | Because these links do not lead to a page on your site containing the UTM JavaScript |
If it would be like you said, then the above recomendation made by Google would be absolutely useless, since all the links would be before the javascript, is it?
You can put the code wherever in the page as long the new page [following a link] have the javascript code[...and footer is in every page of your php-nuke site!], the tracking will be ok. You will still get the whole bunch of informations provided by Google Analytics[the referrers too].
Well, enough it's enough, let's end this looks like I can't convice you. |
|
|
|
 |
kguske

|
Posted:
Sat Aug 26, 2006 8:45 pm |
|
I see what you mean for the links where you add a specific javascript call.
My point was that you need to have the javascript Google recommends just before the closing BODY tag if you do NOT add a specific call on each link. I'd rather do that than to change all the links... |
|
|
|
 |
|