chemjul2005 Posted February 11, 2008 Share Posted February 11, 2008 did anybody install the new module (ga.js) with sts? I can't get it to work :( kind regards gina Quote Link to comment Share on other sites More sharing options...
mr_marbles Posted February 19, 2008 Share Posted February 19, 2008 It's the weirdest thing... I installed the Google Analytics module on two sites: my live one, and on a dummy (on a different server and a different domian) I use for experimenting. It works really good on the dummy site, but on the live one, Google Analytics cannot confirm that the tracker script is installed. The script IS there, however, on every single page. This has been confirmed with the EpikOne site scan. It is not the same tracking code for the sites, of course. I have configured two different website profiles in GA. And I even redid it for the non-working one. Otherwise I have followed the same procedure in both cases. It is an excellent contribution and I would really like the tracking to work on my live shop. But what's wrong? Does anyone know? Quote Link to comment Share on other sites More sharing options...
mr_marbles Posted February 20, 2008 Share Posted February 20, 2008 Please ignore my question above! All of a sudden it works... :thumbsup: Quote Link to comment Share on other sites More sharing options...
Beamfire Posted February 25, 2008 Share Posted February 25, 2008 Hi to everyone, After I read all posts i fell a bit like somebody who has no idea, but nobody reported an easy question as mine will be. Acoording to the installatiion file I have created the folder, inlcuded the file and as next stepI have added into the footer php following code: echo FOOTER_TEXT_BODY ?> </td> </tr> </table> </div> <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._setDomainName("beamfire.at"); pageTracker._trackPageview(); </script> In checkout success.php I have included following: <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <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-xxxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); </script></head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> AT THE BOTTOM: <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer-tracker.php'); ?> <!-- footer_eof //--> <br> </body> MY PROBLEM: Google does not recognize the tracking code. Any ideas will be very helpful! Thanking you in advacne, Bernhard Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted February 29, 2008 Share Posted February 29, 2008 Anyone got this working with Paypal IPN? This seems to be a problem because the Paypal IPN never returns to the checkout_success page. So nothing is ever recorded in Google Analyitics for the sale. Quote Link to comment Share on other sites More sharing options...
pfilias Posted March 5, 2008 Share Posted March 5, 2008 I am using this contribution, but I am getting the following at the top of my checkout_success.php page: pageTracker._addTrans( "5"," ","72.45","","5.45","Shelby Twp.","Michigan","United States" ); pageTracker._addItem( "5","29","Long Sleeve T-Shirt (Grey)","T-Shirts","17.00","1""5","35","MS Movement Bracelet","Bracelets","20.00","1""5","40","MS Movement Markers","Pens","30.00","1" ); pageTracker._trackTrans(); I can't seem to figure out why this is happening, either. Here is the code I have in my checkout_success.php page: <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-XXXXXX-"); pageTracker._initData(); pageTracker._trackPageview(); <?php include(DIR_WS_MODULES . 'analytics/analytics.php'); ?> </script> Quote Link to comment Share on other sites More sharing options...
Eighteen48 Posted March 8, 2008 Share Posted March 8, 2008 Not to take away from the great work that was put into the Contrib, but wouldn't it be easier and work just as well to use Googles methods for integration of Google Analytics into thrid-party shopping carts found here? As it uses the new tracking code used by Google. How do I use Google Analytics to track a 3rd-party shopping cart? Quote Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0 Link to comment Share on other sites More sharing options...
Trentide Posted March 25, 2008 Share Posted March 25, 2008 I am using this contribution, but I am getting the following at the top of my checkout_success.php page: pageTracker._addTrans( "5"," ","72.45","","5.45","Shelby Twp.","Michigan","United States" ); pageTracker._addItem( "5","29","Long Sleeve T-Shirt (Grey)","T-Shirts","17.00","1""5","35","MS Movement Bracelet","Bracelets","20.00","1""5","40","MS Movement Markers","Pens","30.00","1" ); pageTracker._trackTrans(); I can't seem to figure out why this is happening, either. Here is the code I have in my checkout_success.php page: <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-XXXXXX-"); pageTracker._initData(); pageTracker._trackPageview(); <?php include(DIR_WS_MODULES . 'analytics/analytics.php'); ?> </script> I'm really not an expert, but I can see that you didn't put in your google analytics number: UA-123456, whatever. Hope this helps. Jaason Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted March 28, 2008 Share Posted March 28, 2008 Still no fix for the Paypal IPN and Google analytics. That stinks. Quote Link to comment Share on other sites More sharing options...
seanmd Posted April 7, 2008 Share Posted April 7, 2008 Hey Guys, does anyone have an update on the new Google Analytics and OS Commerce? I understand there are 2 contributions 1. http://addons.oscommerce.com/info/5037 and 2. http://www.oscommerce.com/community/contri...3/search,google can anyone report on their expereances and if everything worked well with the code? thank you sean Quote Link to comment Share on other sites More sharing options...
Guest Posted April 7, 2008 Share Posted April 7, 2008 (edited) Here is the code I developped for the new module, let me know how it works for you: in all top-level files of your site you want to be tracked: after <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> I added the following line (instead of inserting the code repeatedly on every page) <?php require('includes/google_analytics.php'); ?> I DID NOT USED THE HEADER to call it, because the header does not contain the <head> tag, and google wants us to install this between the <head> </head> tags. so this google_analytics file is within the catalog/includes directory contains the following: <script src="https://ssl.google-analytics.com/ga.js"></script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); </script> as you may have noticed, I don't care checking if we are on a secure URL or not: I always call the secure one(https://ssl.google-analytics.com), it works all the time, as opposed to the mysterious unescaped string that we can never see "for real" because of its document.write structure, it looks like it's not working that great. E_COMMERCE TRACKING: in your catalog/checkout_success.php, the e-commerce tracking code is called by <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); include(DIR_WS_MODULES . 'analytics/analytics.php'); ?> <!-- footer_eof //--> here is the new content of the file includes/modules/analytics/analytics.php: (of course you will have to replace the xxxx-x by your account number and names) <?php /* ========================================================== Include Google Analystics module for osCommerce Modified by PIXCLINIC (http://www.pixclinic.com) v. 1.0.0 - 2008/04/07 ========================================================== -------------------------------------------------- osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce -------------------------------------------------- Released under the GNU General Public License */ // ############## Google Analytics - start ############### // Get order id $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); $orders = tep_db_fetch_array($orders_query); $order_id = $orders['orders_id']; // Get order info for Analytics "Transaction line" (affiliation, city, state, country, total, tax and shipping) // Set value for "affiliation" $analytics_affiliation = 'replace by your account name'; // Get info for "city", "state", "country" $orders_query = tep_db_query("select customers_city, customers_state, customers_country from " . TABLE_ORDERS . " where orders_id = '" . $order_id . "' AND customers_id = '" . (int)$customer_id . "'"); $orders = tep_db_fetch_array($orders_query); $totals_query = tep_db_query("select value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order"); // Set values for "total", "tax" and "shipping" $analytics_total = ''; $analytics_tax = ''; $analytics_shipping = ''; while ($totals = tep_db_fetch_array($totals_query)) { if ($totals['class'] == 'ot_total') { $analytics_total = number_format($totals['value'], 2); $total_flag = 'true'; } else if ($totals['class'] == 'ot_tax') { $analytics_tax = number_format($totals['value'], 2); $tax_flag = 'true'; } else if ($totals['class'] == 'ot_shipping') { $analytics_shipping = number_format($totals['value'], 2); $shipping_flag = 'true'; } } /* Prepare the Analytics "Transaction line" string <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); pageTracker._addTrans( "1234", // order ID - required "Mountain View", // affiliation or store name "11.99", // total - required "1.29", // tax "5", // shipping "San Jose", // city "California", // state or province "USA" // country ); */ $transaction_string = ' <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-196922-1"); pageTracker._initData(); pageTracker._trackPageview(); pageTracker._addTrans( '; $transaction_string .= '"' . $order_id . '",'; $transaction_string .= '"' . $analytics_affiliation . '",'; $transaction_string .= '"' . $analytics_total . '",'; $transaction_string .= '"' . $analytics_tax . '","'; $transaction_string .= '"' . $analytics_shipping . '",'; $transaction_string .= '"' . $orders['customers_city'] . '",'; $transaction_string .= '"' . $orders['customers_state'] . '",'; $transaction_string .= '"' . $orders['customers_country'] .'"'; $transaction_string .= ');'; /* Get products info for Analytics "Item lines" pageTracker._addItem( "1234", // order ID - required "DD44", // SKU/code "T-Shirt", // product name "Green Medium", // category or variation "11.99", // unit price - required "1" // quantity - required ); pageTracker._trackTrans(); </script> */ $items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name"); while ($items = tep_db_fetch_array($items_query)) { $category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); $item_string = ' pageTracker._addItem('; $item_string .= '"' . $order_id . '",'; $item_string .= '"' . $items['products_id'] . '",'; $item_string .= '"' . $items['products_name'] . '",'; $item_string .= '"' . $category['categories_name'] . '",'; $item_string .= '"' . number_format($items['final_price'], 2) . '",'; $item_string .= '"' . $items['products_quantity'] . '"'; $item_string .= ');'; $item_string .= ' pageTracker._trackTrans();</script>'; }; echo $transaction_string . $item_string; ?> let me know how it goes! (please no PM, posts only. PM will not be answered) Enjoy! Edited April 8, 2008 by pixclinic Quote Link to comment Share on other sites More sharing options...
Guest Posted April 8, 2008 Share Posted April 8, 2008 (edited) Of course, if some of you are a little bit paranoid about not respecting the google calls to respective http / https transactions, you may still create a discriminative call with a ternary operation like: PLEASE NOT THAT IN TEH CODE BELOW, THE OPENING SQUARE BRACKET IN FRONT OF THE WORD S.C.R.I.P.T HAS BEEN REPLACED BY AMPERSAND L T BY THE FORUM . YOU MUST REPLACE THIS WITH THE CORRECT TAG : < <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <?php (($request_type == 'SSL') ? require('includes/google_analytics_SSL.php'): require('includes/google_analytics_NONSSL.php')); ?> with includes/google_analytics_SSL.php being: <script src="https://ssl.google-analytics.com/ga.js"></script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); </script> and includes/google_analytics_NONSSL.php being: <script src="http://google-analytics.com/ga.js"></script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); </script> of course still replacing the xxxxx-x with your GA account number :-) Edited April 8, 2008 by pixclinic Quote Link to comment Share on other sites More sharing options...
blaine109 Posted April 15, 2008 Share Posted April 15, 2008 I'm looking to add the Google Analytics to my STS v4.5. Any ideas on where to start or how to implement? Thanks, Blaine Quote Link to comment Share on other sites More sharing options...
dirkgerbrands Posted April 15, 2008 Share Posted April 15, 2008 I'm looking to add the Google Analytics to my STS v4.5. Any ideas on where to start or how to implement? Thanks, Blaine Me Too!! Quote Link to comment Share on other sites More sharing options...
dirkgerbrands Posted April 17, 2008 Share Posted April 17, 2008 Is there an update for STS 4.5.x users? Or how do I have to modify for STS: osCommerce Google Analytics (beta) module V2.1 for E-commerce? Any suggestions? Regards, Dirk Quote Link to comment Share on other sites More sharing options...
rthsrvek Posted April 17, 2008 Share Posted April 17, 2008 I see there is always the problem in the last release with total price like 1000 Euro. In Google I have 1Euro it's because in oscommerce I have 1,000 Euro and Google seems to not like the ", I apply flom changes (page 11 post 217 by flom) and I'm waiting for Google result. I'm crossing my fingers and my toes! Quote Link to comment Share on other sites More sharing options...
Bill.Dagou Posted April 22, 2008 Share Posted April 22, 2008 I think it's really a useful contribution, but I still have some problem with it. I installed this contribution, but GA still could not get my order information, and the data in GA E-commerce Report always displayed as 0.00% . I'm sure I enabled the E-commerce option in GA. Can you give me some ideas? Quote Link to comment Share on other sites More sharing options...
AlwaysNewbie Posted May 20, 2008 Share Posted May 20, 2008 (edited) I hope I place my question in a right place. I try to install GA_beta_V211. After I installed I realised that it wasn't full module, only an update. I checked previous versions and found out that I didn't copy some other files, and probably didn't do any other changes. For now I only copied analytics.php module in new analytics folder and made changes to footer.php. I try to avoid installation from the scratch and do one by one changes, but it's so hard to understand where is a latest full module. Please, somebody, advice me what changes I should do now to finish the installation. Thanks for any help. P.S. If it makes a difference: I want to install later Supertracker 3.2b - agent, I guess it works with GA fine Edited May 20, 2008 by AlwaysNewbie Quote Computers777dotcom Link to comment Share on other sites More sharing options...
AlwaysNewbie Posted May 22, 2008 Share Posted May 22, 2008 I don't know if that forum still supported, I hope it is. :lol: Ok, talking about my previous post, I found out that I should change checkout_success.php file and I did it (that was yesterday). Now, I went onto Google analytics page and checked the status. It says it can't find analytics :blink: What can I do to check if the "analytics" was added correctly? I checked the report "who's on line" and it shows me the links, I cannot tell for sure if that report looks different of what I had before. I don't even know if it should look different. I guess only Google analytics page should give me info I need. Another thing is: I have STS 4.5.8 and Header Tags SEO 3.03 installed. Should I have had installed GA v211 differently in that case? And one more: I going to install Supertracker v.3.2. Can these two coexist together? Thanks for any help, Mike Quote Computers777dotcom Link to comment Share on other sites More sharing options...
kenyastar Posted June 4, 2008 Share Posted June 4, 2008 Here is the code I developped for the new module, let me know how it works for you: in all top-level files of your site you want to be tracked: after <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> I added the following line (instead of inserting the code repeatedly on every page) <?php require('includes/google_analytics.php'); ?> I DID NOT USED THE HEADER to call it, because the header does not contain the <head> tag, and google wants us to install this between the <head> </head> tags. so this google_analytics file is within the catalog/includes directory contains the following: <script src="https://ssl.google-analytics.com/ga.js"></script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); </script> as you may have noticed, I don't care checking if we are on a secure URL or not: I always call the secure one(https://ssl.google-analytics.com), it works all the time, as opposed to the mysterious unescaped string that we can never see "for real" because of its document.write structure, it looks like it's not working that great. E_COMMERCE TRACKING: in your catalog/checkout_success.php, the e-commerce tracking code is called by <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); include(DIR_WS_MODULES . 'analytics/analytics.php'); ?> <!-- footer_eof //--> here is the new content of the file includes/modules/analytics/analytics.php: (of course you will have to replace the xxxx-x by your account number and names) <?php /* ========================================================== Include Google Analystics module for osCommerce Modified by PIXCLINIC (http://www.pixclinic.com) v. 1.0.0 - 2008/04/07 ========================================================== -------------------------------------------------- osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce -------------------------------------------------- Released under the GNU General Public License */ // ############## Google Analytics - start ############### // Get order id $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); $orders = tep_db_fetch_array($orders_query); $order_id = $orders['orders_id']; // Get order info for Analytics "Transaction line" (affiliation, city, state, country, total, tax and shipping) // Set value for "affiliation" $analytics_affiliation = 'replace by your account name'; // Get info for "city", "state", "country" $orders_query = tep_db_query("select customers_city, customers_state, customers_country from " . TABLE_ORDERS . " where orders_id = '" . $order_id . "' AND customers_id = '" . (int)$customer_id . "'"); $orders = tep_db_fetch_array($orders_query); $totals_query = tep_db_query("select value, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order"); // Set values for "total", "tax" and "shipping" $analytics_total = ''; $analytics_tax = ''; $analytics_shipping = ''; while ($totals = tep_db_fetch_array($totals_query)) { if ($totals['class'] == 'ot_total') { $analytics_total = number_format($totals['value'], 2); $total_flag = 'true'; } else if ($totals['class'] == 'ot_tax') { $analytics_tax = number_format($totals['value'], 2); $tax_flag = 'true'; } else if ($totals['class'] == 'ot_shipping') { $analytics_shipping = number_format($totals['value'], 2); $shipping_flag = 'true'; } } /* Prepare the Analytics "Transaction line" string <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-xxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); pageTracker._addTrans( "1234", // order ID - required "Mountain View", // affiliation or store name "11.99", // total - required "1.29", // tax "5", // shipping "San Jose", // city "California", // state or province "USA" // country ); */ $transaction_string = ' <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-196922-1"); pageTracker._initData(); pageTracker._trackPageview(); pageTracker._addTrans( '; $transaction_string .= '"' . $order_id . '",'; $transaction_string .= '"' . $analytics_affiliation . '",'; $transaction_string .= '"' . $analytics_total . '",'; $transaction_string .= '"' . $analytics_tax . '","'; $transaction_string .= '"' . $analytics_shipping . '",'; $transaction_string .= '"' . $orders['customers_city'] . '",'; $transaction_string .= '"' . $orders['customers_state'] . '",'; $transaction_string .= '"' . $orders['customers_country'] .'"'; $transaction_string .= ');'; /* Get products info for Analytics "Item lines" pageTracker._addItem( "1234", // order ID - required "DD44", // SKU/code "T-Shirt", // product name "Green Medium", // category or variation "11.99", // unit price - required "1" // quantity - required ); pageTracker._trackTrans(); </script> */ $items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name"); while ($items = tep_db_fetch_array($items_query)) { $category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); $item_string = ' pageTracker._addItem('; $item_string .= '"' . $order_id . '",'; $item_string .= '"' . $items['products_id'] . '",'; $item_string .= '"' . $items['products_name'] . '",'; $item_string .= '"' . $category['categories_name'] . '",'; $item_string .= '"' . number_format($items['final_price'], 2) . '",'; $item_string .= '"' . $items['products_quantity'] . '"'; $item_string .= ');'; $item_string .= ' pageTracker._trackTrans();</script>'; }; echo $transaction_string . $item_string; ?> let me know how it goes! (please no PM, posts only. PM will not be answered) Enjoy! Thank you so much for this post it has been very helpful. I have followed it and I am nearly there. My problem is in the end it echo's the data in the browser I can see it via 'view source'. But it is not showing up in analytics. There seems to be a disconnect between gathering the data and getting it to analytics. Any ideas? I've tried everything I can think of so far. KenyaStar Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2008 Share Posted June 4, 2008 Thank you so much for this post it has been very helpful. I have followed it and I am nearly there. My problem is in the end it echo's the data in the browser I can see it via 'view source'. But it is not showing up in analytics. There seems to be a disconnect between gathering the data and getting it to analytics. Any ideas? I've tried everything I can think of so far. KenyaStar I found little bugs since my last post, I will post the corrections shortly. (the e-commerce was not showing up) Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2008 Share Posted June 5, 2008 by the way, below the line /* Prepare the Analytics "Transaction line" string be sure to replace the < by a square bracket in order to have your j.a.v.a.s.cript to work Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted June 6, 2008 Share Posted June 6, 2008 Any fix for the google analytics and Paypal? Paypal transactions do not show up in the google analytic totals. Quote Link to comment Share on other sites More sharing options...
mkosel Posted June 24, 2008 Share Posted June 24, 2008 For anyone who may be trying to install google analytics V2 with STS, give this a try. I just figured it out and thought I'd share. I modified the instructions from arnoldl A SHORT INSTRUCTION FOR GOOGLE ANALYTICS E-COMMERCE WITH STS4 1 - install the google analytics files from the package as discribed. 2 - in checkout_success.php add just before : <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?> </table></form></td> <!-- body_text_eof //--> Add this code: <?php //google analytics require(DIR_WS_MODULES . 'analytics/analytics.php')?> 3 - in your template file (like includes/sts_templates/test/sts_template.html ) add just after : <!--$headcontent--> Add this 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> 4 - don't forget to place this in every template file if you have more 5 - change the xxxxx-x to your ua- code from google 6 - don't thank me , thank the maker of the google analytics module and arnoldl :) Hope this helps Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted June 24, 2008 Share Posted June 24, 2008 Am I the only one that uses this module and also accepts paypal? If you take paypal and use the analytics module, your analytics figures are NOT correct. If you have a fix for this, PM me, I'll pay for a fix for this. It drives me nuts that I can't look at the google analytics ecommerce figures are not correct. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.