Author |
Message |
cornishpixie
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Dec 15, 2008
Posts: 79
|
Posted:
Thu Mar 05, 2009 12:56 pm |
|
I'd like to place this on my 2 ravenNuke sites, and added the code to the bottom of the index.php as instructed in the Google Analytics account dashboard, but nothing happens.
It's saying that the code isn't installed.
On html sites the code is placed directly before the /body tag.
Does anyone else use Google Analytics, and could tell me if there's some place else I should be putting the code for it to work?
Thanks.
Hope this is the right place to post this, it didnt seem to fit in with any other category. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Thu Mar 05, 2009 1:13 pm |
|
Try installing it in your footer.php after the closing ?> and see if that works for you. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jakec
Site Admin
![](modules/Forums/images/avatars/502a2d1345d88a86ddb4a.png)
Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Thu Mar 05, 2009 2:06 pm |
|
On one of my sites I posted it in WYSIWYG editor under preferences and it worked. It seemed to take a little bit of time for Google to recognise it, but it did work.
Also you can create a custom_footer.php file and save it in /includes/custom_files/ that works also. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 05, 2009 2:25 pm |
|
I put it in a file and did an include in header.php. It will take a few hours for google to check it and I will let you know how it went. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 05, 2009 2:40 pm |
|
It should work because it shows up with view source.
I created a file in the includes directory named googleanalytics.php with the following code:
Code:
<?php
echo "<script type=\"text/javascript\">\n";
echo "var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");\n";
echo "document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));\n";
echo "</script>\n";
echo "<script type=\"text/javascript\">\n";
echo "try {\n";
echo "var pageTracker = _gat._getTracker(\"UA-yournumber-1\");\n";
echo "pageTracker._trackPageview();\n";
echo "} catch(err) {}</script>\n";
echo "\n";
?>
|
replace yournumber with the analytics number you get from google.
Code:echo "var pageTracker = _gat._getTracker(\"UA-yournumber-1\");\n";
|
Inside header.php find:
Code:
//End of Dynamic Titles changes
include_once 'includes/meta.php';
include_once 'includes/javascript.php';
if (file_exists('themes/' . $ThemeSel . '/images/favicon.ico')) {
|
change to:
Code:
//End of Dynamic Titles changes
include_once 'includes/meta.php';
include_once 'includes/javascript.php';
include_once 'includes/googleanalytics.php';
if (file_exists('themes/' . $ThemeSel . '/images/favicon.ico')) {
|
That should do it.
Edit:
It does work. Google Analytics gave the status a big green check. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
cornishpixie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 05, 2009 5:30 pm |
|
ooh thanks for all the replies.
Gonna go with the last one from nuken. Thanks so much for that. xxx |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jakec
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 1:58 am |
|
It should really be in the footer, but it is good that it works.
Instead of modding the header.php file, which would be wiped out by an upgrade you can easily create a custom_footer.php file and this is included automatically.
....but I still think using the WYSIWYG editor is probably the easiest. Switch it to Source and paste the code straight in. ![Very Happy](modules/Forums/images/smiles/icon_biggrin.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
cornishpixie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 6:16 am |
|
I did try it in the footer but it didnt work, Google couldnt find it. Maybe Sentinel blocks it?
The php file in includes works a treat though. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jakec
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 6:18 am |
|
It may take a little time for Google to find it. I know it did on mine, but once it found it I had no problems. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 6:22 am |
|
if it shows up in view source on you browser, google will find it. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 6:27 am |
|
on a side note.... Google Analytics really shows detailed info about site visitors. It does everything except show their house on google maps. ![Cheers](modules/Forums/images/smiles/cheers.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
cornishpixie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 7:05 am |
|
It is good isnt it. I'm very impressed for something that good to be free. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 8:42 am |
|
jakec is 100% correct that you can create a file in includes/custom_files named custom_header.php with the analytics code and it will work. This would be the best option just like jekec said. It would not be over written after an upgrade and is easily changed if the google code changes. Thank you. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jakec
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 06, 2009 8:51 am |
|
Try the WYSIWYG editor as well under preferences, I promise that works as well. ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
Site Admin
![](modules/Forums/images/avatars/41f0b40a419280935f3a0.gif)
Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Fri Mar 06, 2009 10:34 pm |
|
If you like Google Analytics, check out Only registered users can see links on this board! Get registered or login!. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 08, 2009 12:40 pm |
|
Quote: | Try the WYSIWYG editor as well under preferences, I promise that works as well. Wink |
That is the best option. The custom_header gives you XHTML issues. The WYSIWYG editor in the preferences has no issues. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jakec
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 08, 2009 12:59 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
dad7732
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Mar 18, 2007
Posts: 1242
|
Posted:
Sun Mar 08, 2009 1:47 pm |
|
kguske wrote: | If you like Google Analytics, check out Only registered users can see links on this board! Get registered or login!. |
I had an issue with Quantcast. They harvested one of my sites with a lot of copyrighted material on it and since I didn't register with them they refused to update the inaccurate analytics themselves. That wasn't so bad but they were very rude and flat refused to cooperate saying in essence that they do what they want and refused to change anything. Sooo, I did a little fiddling with the htaccess file and included a referrer image of a nasty note referring to Quantcast (not vulgar, just not so nice) that prominently displayed on their site when someone clicked on it. Only took 14 days for them to remove my site. ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 08, 2009 3:33 pm |
|
Circumvention is the key to all progress... That's unfortunate, but I like the creative alternative. I use a special treat like that for special purposes, too - a little redirection to certain sites that I don't want referring to me. If you click a link to one of my sites from one of those sites, you end up right back where you were.... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|