osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Google Analytics

This is a discussion on Google Analytics within the osCommerce 2.2 Discussion forums, part of the osCommerce 2.2 Forums category; I want to install Google Analytics, which file do I need to add it to?...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 09-13-2007, 03:23 PM
New Member
 
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
deaniodice is on a distinguished road
Default Google Analytics

I want to install Google Analytics, which file do I need to add it to?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #2  
Old 09-14-2007, 03:19 AM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 468
Thanks: 4
Thanked 79 Times in 73 Posts
Rep Power: 8
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Google Analytics

/templates/yourtemplatename/main_page.tpl.php
__________________
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-22-2007, 11:57 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 346
Thanks: 9
Thanked 27 Times in 26 Posts
Rep Power: 3
MindTwist has a spectacular aura aboutMindTwist has a spectacular aura about
Default Re: Google Analytics

Just had to do this, and the search function saved me some time.

The contrib I installed was the following:
osCommerce: osCommerce Google Analytics module

You need to make 3 changes on /templates/yourtemplatename/main_page.tpl.php :

Find your stylesheets, which on my template are like this:

Code:
 <link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheet','stylesheet.css')); // BTSv1.5 ?>">
<link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheet','print.css')); // BTSv1.5 ?>" media="print">
Paste the following code AFTER it, replacing UA-XXXXXX-X with your google analytics account:

Code:
         <?php
        // osCoders.biz - Analystics - start
        /*
        Conditional code added thank to  rrodkey and bfcase
        IMPORTANT -- IMPORTANT - IMPORTANT
        You'll need to update the "xxxx-x" in the samples (twice) above with your own Google Analytics account and profile number. 
        To find this number you can access your personalized tracking code in its entirety by clicking Check Status in the 
        Analytics Settings page of your Analytics account.
        */
         if ($request_type == 'SSL') {
        ?>    
         <script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
         </script>
         <script type="text/javascript">
           _uacct="UA-XXXXXX-X";
           urchinTracker();
         </script>
        <?php
        } else {
        ?>
         <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
         </script>
         <script type="text/javascript">
           _uacct="UA-XXXXXX-X";
           urchinTracker();
         </script>
        <?
        }
        // osCoders.biz - Analistics - end
        ?>
Find your body tag:

Code:
 <body>
Replace with:

Code:
 </head>
// osCoders.biz - Analistics - start
//     The onLoad="java script:__utmSetTrans()"  from the <body ... > tag
//     was added for the Google Analytics contribution
// osCoders.biz - Analistics - end
<body onLoad="javascript:__utmSetTrans()">
On my template I have no parameters on my <body>, if you have them, keep them and place the onLoad="javascript:__utmSetTrans()" at the end.

And at the end, find the /body tag:

Code:
 </body>
And place right BEFORE it the following code:

Code:
 <?php 
// osCoders.biz - Analystics - start 
    include(DIR_WS_MODULES . 'analytics/analytics.php'); 
// osCoders.biz - Analistics - end
?>
Last, you need to upload the included file to /includes/modules/analytics/analytics.php

Hopefully this is all that needs to be done, my Google Analytics account has checked my installation and said it is ok, and that it is gathering information and I will have my first reports no later than 24h from now.
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to MindTwist For This Useful Post:
eyeofhorus (11-24-2007)
  #4  
Old 06-07-2008, 02:00 PM
New Member
 
Join Date: Nov 2004
Location: California
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Pr0ject
Default Re: Google Analytics

Well I am followed your directions I hope it works in 24 hrs too I'll post if it worked for me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 06-07-2008, 02:24 PM
New Member
 
Join Date: Nov 2004
Location: California
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Pr0ject
Default Re: Google Analytics

i get a string at the bottom of my screen after installing this... any idea what that is?

"pageTracker._addTrans( "460"," ","2700.00","0.00","0.00","Houston","Texas","U SA" ); pageTracker._addItem( "460","1167","Sharp Dial Microwave R-21LCF","Microwave Ovens","249.00","12"); pageTracker._trackTrans(); "
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 06-23-2008, 01:54 PM
Member
 
Join Date: Aug 2007
Posts: 68
Thanks: 9
Thanked 1 Time in 1 Post
Rep Power: 2
tcshadow is on a distinguished road
Default Re: Google Analytics

Quote:
Originally Posted by met00 View Post
/templates/yourtemplatename/main_page.tpl.php
I put mine in this file and it won't pick up my checkout_success.php


any ideas why?

Oh I'm using the new code btw not urchin

Last edited by tcshadow; 06-23-2008 at 02:12 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 06-23-2008, 04:05 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 346
Thanks: 9
Thanked 27 Times in 26 Posts
Rep Power: 3
MindTwist has a spectacular aura aboutMindTwist has a spectacular aura about
Default Re: Google Analytics

So, what is "mine", and what it won't pick up?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 06-23-2008, 04:16 PM
Member
 
Join Date: Aug 2007
Posts: 68
Thanks: 9
Thanked 1 Time in 1 Post
Rep Power: 2
tcshadow is on a distinguished road
Default Re: Google Analytics

PHP Code:
<script type="text/javascript">
var 
gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." "http://www.");
document.write(unescape("%3Cscript src='" gaJsHost "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
</script> 
As far as I was aware this was supposed to work just fine in the secure pages... except it isn't.

ie it works just fine and dandy on http pages and they show up in my analytics but none of the pages in https(ie past /checkout_shipping.php) show up..

this means my goals aren't being tracked
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 06-23-2008, 06:11 PM
Member
 
Join Date: Aug 2007
Posts: 68
Thanks: 9
Thanked 1 Time in 1 Post
Rep Power: 2
tcshadow is on a distinguished road
Default Re: Google Analytics

I just did some more looking into it and it seems that it tracks all the way to /checkout_confirmation.php and then gets lost between there and my /checkout_success.php

any idea why it's not recording /checkout_success.php?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 06-24-2008, 01:59 AM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 346
Thanks: 9
Thanked 27 Times in 26 Posts
Rep Power: 3
MindTwist has a spectacular aura aboutMindTwist has a spectacular aura about
Default Re: Google Analytics

No clue, sorry. I still use the old google analytics code (urchin) and I do not use SSL on my web page (just for CC transactions, and that is handled by me)
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
osCommerce Google Analytics module michael_s New osCommerce Contributions 0 06-21-2007 03:01 PM
osCommerce Google Analytics module michael_s New osCommerce Contributions 0 02-14-2007 04:21 AM
osCommerce Google Analytics module michael_s New osCommerce Contributions 0 02-13-2007 02:50 PM
Google-Analytics dasmurphy osCMax v2 Customization/Mods 3 08-24-2006 10:02 AM
Reviews and google analytics dasmurphy osCMax v2 Installation issues 0 08-15-2006 06:28 PM


All times are GMT -8. The time now is 08:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax