Guest Posted October 11, 2002 Share Posted October 11, 2002 Here is the link to the new release of the User Tracking modifications for your OSC 2.2-CVS stores. This release was built on a mid July version of OSC, so I need help testing this on more recent releases. You can download the file here: http://www.aravia.com/user_tracking-0.2.tar.gz This version should be fully functional and has been tested on over a month worth of traffic on a heavily visited site. However, please submit any bug reports to me at [email protected]. New changes include the purging of data, displaying only 50 user sessions at a time, MUCH MUCH better shopping cart navigation, and a lot of new statistics. Enjoy and good luck! ---------------------------- 1. INTRODUCTION ----------------------------------------------------------------------- This set of modifications will display the activity of each user as they come to your site, the links they clicked, and the time they spent between each page. You also will be able to view the cart contents of their shopping cart historically, and will be able to surf between days to see tracking data historically. You'll need to copy THREE files, and modify slightly FOUR files. 2. TODO ------------------------------------------------------------------------------- Summary statistics: number of users, average time per visit, highest ranked pages, lowest rank pages, most common last pages, most common first pages. Better historical data navigation. Quote Link to comment Share on other sites More sharing options...
jalil Posted October 12, 2002 Share Posted October 12, 2002 Hi nero, Thanks, it's great and it's what I'm looking so far since I'm unable to track it using Pphlogger and Les Visiteurs which produces errors. It work well with snapshot dated September 6, 2002 but I've done it with very limited testing. BTW, will the script would ignore or does not record all tracking done by the googlebot spider or any other search engine spider? Thank you again. Regards, Jalil Quote Please give your rating on OSCommerce at FreebiesCafe.com, a search directory for free scripts, software, services and resources. Link to comment Share on other sites More sharing options...
CC Posted October 12, 2002 Share Posted October 12, 2002 Yep works well at present mate. Well done, very nice mod. Will keep you posted on any issues... CC. Quote Link to comment Share on other sites More sharing options...
OSC-Spain Posted October 13, 2002 Share Posted October 13, 2002 A very nice mod, i'd like to know if there are a TO-DO list and where can we see it. Regards, Fernando. Quote Link to comment Share on other sites More sharing options...
OSC-Spain Posted October 15, 2002 Share Posted October 15, 2002 Hi! How can i see more than 50 visits per day in the user_tracking page? Regards, Fernando. Quote Link to comment Share on other sites More sharing options...
pjones Posted October 16, 2002 Share Posted October 16, 2002 I have this running and it gives good info. I would also like more than 50 records to get the big picture of the days visitors. My real interest is with the first originating URL (which tells me where they came from) and whether they achieve checkout success. I could live without the intermediate info if it meant I could see 24 hours of traffic. Another comment - the idle time indicator reads approx 9mins for every visitor, so is redundant in my case. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2002 Share Posted October 17, 2002 Very nice mod. I have had it running for a few days now and seems to be working well. I did have some install problems but not knowing much about php was able to get it running. I don't know what I did but the text shows up in admin as BOX_TOOLS_USER_TRACKING any idea on how to correct this? It don't seem to hurt the mod from running thanks for a great mod Quote Link to comment Share on other sites More sharing options...
Guest Posted October 18, 2002 Share Posted October 18, 2002 It looks like after I installed this Contribution, the country field is not being shown on the customers order history pages and on the packing/invoice slips. Can anyone else check this out that has installed this contribution? I never made any other changes other than this around the time the problem started... Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2002 Share Posted November 12, 2002 Nero, I'm stumped and maybe you could explain this. I installed your user tracking contribution, and have been using it for weeks and love it. This morning I jumped for joy when I saw a host name of dmoz/editor or something to that nature. When I came back from lunch after refreshing the page, I couldn't find it at all!! Thankfully I knew what pages they looked at, and found the user path he took, but the host name changed to ool-4353a241.dyn.optonline.net . Good thing i checked when I did to see my site was reviewed by DMOZ, but if I would've checked an hour or so later, I never would have seen that. How did it change? I think i've noticed this before because I thought some disappeared, but they probably just changed. Any clues? Quote Link to comment Share on other sites More sharing options...
Guest Posted February 28, 2003 Share Posted February 28, 2003 Just installed this in Loaded5, Ian's value dense snapshot based on MS1. Apparently, I was installing this right in the middle of an order, and I got to see the remaining order path this customer took. All I can say is ... wow!! What great insider information to get! It's like standing behind the customer with a stopwatch, watching their every move and timing them, to boot! This thing is freaking amazing! Thank you !! Everyone should install this! Seriously!! Ahem, now, uh, before I have a cheerleading related coronary... ;) One modification *needed* for the new snapshot, under php 4.3.0, at least... Instead of // user_tracking modifications // if (!$referer_url) { // $referer_url = $HTTP_SERVER_VARS['HTTP_REFERER']; // tep_session_register('referer_url'); // } Use // user_tracking modifications if (!$referer_url) { $referer_url = $HTTP_SERVER_VARS['HTTP_REFERER']; if ($referer_url) { tep_session_register('referer_url'); } } Otherwise you get all those unhappy TEP Stop errors. With this one mod to the instructions, everything works A OK! :D Quote Link to comment Share on other sites More sharing options...
radders Posted February 28, 2003 Share Posted February 28, 2003 Worked perfectly for 1 hour ... tantalising to see someone waiting at the checkout with a pile of goodies :o Any idea what might be causing this error on MS1? Fatal error: input in flex scanner failed in <path>/admin/includes/languages on line 1 Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 1, 2003 Share Posted March 1, 2003 Some layout improvements to the admin interface, including text formatting, inserting links for the referral URLs (so you can check out your search engine rankings! :lol: ), WHOIS link for the IP addresses, table changes, etc. great contribution, nero! Thanks! Replace admin/user_tracking.php with the following: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Modified by Andrew Edmond Sept 14th, 2002 */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $LIMIT_DISPLAY_SESSIONS = 50; // SET to 999999 for unlimited per 24 hour period ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td class="smallText"> <?php if ($purge) { tep_db_query("delete from user_tracking where time_last_click < " . (time() - ($purge * 3600))); echo TEXT_HAS_BEEN_PURGED . "<p>"; } echo EXPLAINATION, "<p>"; // some time routines $time_frame = time(); if ($HTTP_GET_VARS['time']) { $time_frame = $HTTP_GET_VARS['time']; } echo '<b>' . TEXT_SELECT_VIEW .': </b>'; echo '<a href="' . FILENAME_USER_TRACKING . '?time='; echo $time_frame - 86400 . '">' . TEXT_BACK_TO . ' ' . date("M/d/Y", $time_frame - 86400) . '</a> '; echo "<p>" . TEXT_DISPLAY_START . $LIMIT_DISPLAY_SESSIONS . TEXT_DISPLAY_END; echo TEXT_PURGE_START . ' <a href="user_tracking.php?purge=72">'. TEXT_PURGE_RECORDS. '</a> ' . TEXT_PURGE_END. '</font><p>'; if (time() > $time_frame + 86400) { echo '| <a href="' . FILENAME_USER_TRACKING . '?time='; echo $time_frame + 86400 . '">' . TEXT_FORWARD_TO . date("M/d/Y", $time_frame + 86400) . '</a>'; } // we need to slurp all the customer tracking information out of the database $whos_online_query = tep_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url," . " session_id from " . TABLE_USER_TRACKING . " where time_entry > " . ($time_frame - 86400) . " and time_entry < " . $time_frame . " order by time_last_click desc"); $results = 0; while ($whos_online = tep_db_fetch_array($whos_online_query)) { $user_tracking[$whos_online['session_id']]['session_id']=$whos_online['session_id']; $user_tracking[$whos_online['session_id']]['ip_address']=$whos_online['ip_address']; $user_tracking[$whos_online['session_id']]['customer_id']=$whos_online['customer_id']; if ($whos_online['full_name'] != 'Guest') $user_tracking[$whos_online['session_id']]['full_name']=$whos_online['full_name']; $user_tracking[$whos_online['session_id']]['last_page_url'][$whos_online['time_last_click']] = $whos_online['last_page_url']; if (($user_tracking[$whos_online['session_id']]['time_entry'] > $whos_online['time_entry']) || (!$user_tracking[$whos_online['session_id']]['time_entry'])) $user_tracking[$whos_online['session_id']]['time_entry'] = $whos_online['time_entry']; if (($user_tracking[$whos_online['session_id']]['end_time'] < $whos_online['time_entry']) || (!$user_tracking[$whos_online['session_id']]['end_time'])) $user_tracking[$whos_online['session_id']]['end_time'] = $whos_online['time_entry']; $results ++; } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top" align=center><table border="0" width="95%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="5"><?php echo TABLE_HEADING_SESSION_ID ?></td> <td class="dataTableHeadingContent" colspan="1 width="150"><?php echo TEXT_USER_SHOPPING_CART ?></td> </tr> <?php // now let's display it $listed=0; if ($results) while (($ut = each($user_tracking)) && ($listed++ < $LIMIT_DISPLAY_SESSIONS)) { $time_online = (time() - $ut['value']['time_entry']); if ( ((!$HTTP_GET_VARS['info']) || (@$HTTP_GET_VARS['info'] == $ut['value']['session_id'])) && (!$info) ) { $info = $ut['value']['session_id']; } echo ' <tr class="dataTableRowSelected">' . "n"; if ($ut['value']['full_name'] == "") $ut['value']['full_name'] = "Guest"; ?> <td colspan = "5" class="dataTableContent" valign="top"><?php echo '<b>'. $ut['value']['full_name'] . "</b>, " . $ut['value']['session_id']; ?></td> <?php // shopping cart decoding $session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $ut['value']['session_id'] . "'"); if (tep_db_num_rows($session_data)) { $session_data = tep_db_fetch_array($session_data); $session_data = trim($session_data['value']); } else { $session_data = @file(tep_session_save_path() . '/sess_' . $ut['value']['session_id']); $session_data = trim($session_data[0]); } $cart = ""; $referer_url = ""; $num_sessions ++; session_decode($session_data); $contents = array(); if (is_object($cart)) { $products = $cart->get_products(); for ($i=0; $i<sizeof($products); $i++) { $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']); } if (sizeof($products) > 0) { $contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1')); $contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency)); } else { $contents[] = array('text' => ' '); } } $heading = array(); if (tep_not_null($contents)) { echo ' <td rowspan="4" valign="top">' . "n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "n"; } else { echo ' <td rowspan="4" valign="top" class="dataTableContent" align="center">session expired' . "n"; echo ' </td>' . "n"; } ?> </tr> <tr> <td class="dataTableContent" align="right" valign="top"><b><?php echo TABLE_HEADING_IP_ADDRESS ?></b></td> <td class="dataTableContent" valign="top"><a href="http://www.dnsstuff.com/tools/whois.ch?ip=<?php echo $ut['value']['ip_address']; ?>" target="new"><?php echo $ut['value']['ip_address']; ?></a></td> <td class="dataTableContent" colspan=2 rowspan=2 align="center"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="dataTableContent" align="right" valign="top"><b><?php echo TABLE_HEADING_ENTRY_TIME; ?></b></td> <td class="dataTableContent" colspan="2" valign="top"><?php echo date('H:i:s', $ut['value']['time_entry']); ?></td> <td class="dataTableContent" align="right" valign="top"><b><?php echo TEXT_IDLE_TIME ?></b></td> <td class="dataTableContent" colspan="2" valign="top"><?php echo date('H:i:s', (time() - $ut['value']['end_time']+ 28800)); ?></td> </tr> <tr> <td class="dataTableContent" align="right" valign="top"><b><?php echo TABLE_HEADING_END_TIME; ?></b></td> <td class="dataTableContent" colspan="2" valign="top"><?php echo date('H:i:s', $ut['value']['end_time']); ?></td> <td class="dataTableContent" align="right" valign="top"><b><?php echo TEXT_TOTAL_TIME ?></b></td> <td class="dataTableContent" colspan="2" valign="top"><?php echo date('H:i:s', ($ut['value']['end_time'] - $ut['value']['time_entry'] + 28800)); ?></td> </table> </td> </tr> <tr> <td class="dataTableContent" align="right" valign="top"><b><?php echo TABLE_HEADING_HOST ?></b></td> <td class="dataTableContent" valign="top"><?php echo gethostbyaddr($ut['value']['ip_address']); ?></td> </tr> <tr> <td class="dataTableContent" align="right" valign="top"><b><?php echo TEXT_ORIGINATING_URL ?></b></td> <?php $ref_name = chunk_split($referer_url,40,"<br>"); ?> <td class="dataTableContent" align="left" valign="top" colspan=3><?php echo '<a href="'.$referer_url.'">'. $referer_url .'</a>'; ?> </td> </tr> <?php while ($pu = each($ut['value']['last_page_url'])) { ?> <tr> <td class="dataTableContent" colspan="2"></td> <td class="dataTableContent"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="dataTableContent" colspan"1" align="right"><?php echo date('H:i:s', $pu['key']); ?>:</td> <td width=100% class="dataTableContent" colspan"3" align="left"><a href="<?php echo $pu['value']; ?>"><?php echo chunk_split($pu['value'],40,"<br>"); ?></a></td> </tr> </table> </td> </tr> <?php } } ?> <tr> <td class="smallText" colspan="7"><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, tep_db_num_rows($whos_online_query)); echo " Total number of customers: " . $num_sessions . "."; ?></td> </tr> </table></td> <?php /* $heading = array(); $contents = array(); if ($info) { $heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>'); $session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'"); if (tep_db_num_rows($session_data)) { $session_data = tep_db_fetch_array($session_data); $session_data = trim($session_data['value']); } else { $session_data = @file(tep_session_save_path() . '/sess_' . $info); $session_data = trim($session_data[0]); } session_decode($session_data); if (is_object($cart)) { $products = $cart->get_products(); for ($i=0; $i<sizeof($products); $i++) { $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']); } if (sizeof($products) > 0) { $contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1')); $contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency)); } else { $contents[] = array('text' => ' '); } } } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "n"; } */ ?> </tr> </table> </td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> And for those who need it, to change the time to reflect your own timezone, Find: $LIMIT_DISPLAY_SESSIONS = 50; // SET to 999999 for unlimited per 24 hour period And replace with: $LIMIT_DISPLAY_SESSIONS = 50; // SET to 999999 for unlimited per 24 hour period putenv("TZ=US/Eastern"); - Greg Quote Link to comment Share on other sites More sharing options...
mattice Posted March 1, 2003 Share Posted March 1, 2003 Nice, looks a lot better this way! Quote "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
radders Posted March 1, 2003 Share Posted March 1, 2003 That solved it! Somewhat OT In addition to the expected hits by Googlebot I discovered also something called turnitin.com which is an anti-plagiarism spider schools use to check their students' work isn't just copied verbatim from the internet :shock: . Quote Link to comment Share on other sites More sharing options...
kn1ght Posted March 5, 2003 Share Posted March 5, 2003 putenv("TZ=US/Eastern"); Is this changeable? I tried (California): putenv("CA=US/Pacific"); and gives me error Warning: Safe Mode: Cannot set environment variable 'CA' - it's not in the allowed list in /home/virtual/site222/fst/var/www/html/admins/user_tracking.php on line 22 Quote Link to comment Share on other sites More sharing options...
radders Posted March 6, 2003 Share Posted March 6, 2003 I think it should be 'TZ' not 'CA' (time zone) Quote Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2003 Share Posted March 6, 2003 Is there a way you can add target="_blank" so a pop up window appears instead of the whole page switchin to the page url? In admin/user_tracking.php: <td class="dataTableContent" align="left" valign="top" colspan=3><?php echo '<a href="'.$referer_url.'">'. $referer_url .'</a>'; ?> </td> Anywhere i add the target="_blank" next to the referer_url doesnt work. Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 6, 2003 Share Posted March 6, 2003 <td class="dataTableContent" align="left" valign="top" colspan=3><?php echo '<a href="'.$referer_url.'" target="_new">'. $referer_url .'</a>'; ?> </td> shoxuld do the trick. Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 6, 2003 Share Posted March 6, 2003 I have been wanting to see more info about the pages reported on User Tracking. Rather than product_info.php?products_id=##, it'd be useful to be able to see the product name. Same deal with index.php?cPath=## So, I have added a basic text field to my user_tracking table called page_desc and I made the following changes to includes/functions/user_tracking.php: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Modified by Andrew Edmond <[email protected]> September 14th, 2002 */ function tep_update_user_tracking() { global $languages_id, $HTTP_GET_VARS, $customer_id; $skip_tracking['64.91.104.73'] = 1; if (isset($customer_id)) { $wo_customer_id = $customer_id; $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'"); $customer = tep_db_fetch_array($customer_query); $wo_full_name = addslashes($customer['customers_firstname'] . ' ' . $customer['customers_lastname']); } else { $wo_customer_id = ''; $wo_full_name = 'Guest'; } $wo_session_id = tep_session_id(); $wo_ip_address = getenv('REMOTE_ADDR'); $wo_last_page_url = addslashes(getenv('REQUEST_URI')); if ($HTTP_GET_VARS['products_id']) { $page_desc_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'"); $page_desc_values = tep_db_fetch_array($page_desc_query); $page_desc = $page_desc_values['products_name']; } elseif ($HTTP_GET_VARS['cPath']) { $cPath = $HTTP_GET_VARS['cPath']; $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; $page_desc_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $current_category_id . "' and language_id = '" . $languages_id . "'"); $page_desc_values = tep_db_fetch_array($page_desc_query); $page_desc = $page_desc_values['categories_name']; } $current_time = time(); if ($skip_tracking[$wo_ip_address] != 1) tep_db_query("insert into " . TABLE_USER_TRACKING . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, page_desc) values ('" . $wo_customer_id . "', '" . $wo_full_name . "', '" . $wo_session_id . "', '" . $wo_ip_address . "', '" . $current_time . "', '" . $current_time . "', '" . $wo_last_page_url . "', '" . $page_desc . "')"); } ?> That successfully looks up and logs either the product or category/subcategory name into the new field 'page_desc'. Now, I am having trouble getting this info to show on admin/user_tracking.php. Anyone have any ideas how to display it?? Thanks, Greg Quote Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2003 Share Posted March 6, 2003 <td class="dataTableContent" align="left" valign="top" colspan=3><?php echo '<a href="'.$referer_url.'" target="_new">'. $referer_url .'</a>'; ?> </td> should do the trick. Nope ive tried it like that and still no new small window. Weird, maybe im looking in the wrong area to add. Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 6, 2003 Share Posted March 6, 2003 weird... this is currently working for me: <td class="dataTableContent" align="left" valign="top" colspan=3><?php echo '<a href="'.$referer_url.'" target="_new">'. $referer_url .'</a>'; ?> </td> Quote Link to comment Share on other sites More sharing options...
mattice Posted March 6, 2003 Share Posted March 6, 2003 I have been wanting to see more info about the pages reported on User Tracking. Rather than product_info.php?products_id=##, it'd be useful to be able to see the product name. Same deal with index.php?cPath=## So, I have added a basic text field to my user_tracking table called page_desc and I made the following changes to includes/functions/user_tracking.php: [snip] That successfully looks up and logs either the product or category/subcategory name into the new field 'page_desc'. Now, I am having trouble getting this info to show on admin/user_tracking.php. Anyone have any ideas how to display it?? Thanks, Greg Shouldn't it replace $user_tracking[$whos_online['session_id']]['last_page_url'][$whos_online['time_last_click']] ? I have not tested this but looking at the code you posted above I'd say you should fill that var with your new value? (The last_page_url bit) HTH Mattice Quote "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 6, 2003 Share Posted March 6, 2003 I'd rather not replace the last_page_url code, though. As I said, we're only pulling add'l info for products_id and cPath, so the other pages would need a value. I'd prefer to just add another TD to that table and add the page_desc, if it's defined. Initially, I moved the user_tracking call from application_top to footer so that I could call the HEADING_TITLE for the other pages. That works, but generated errors when the HEADING_TITLE contained a ' Perhaps I'll revisit that, but either way, I am lost on $user_tracking[$whos_online['session_id']]['last_page_url'][$whos_online['time_last_click']]. How would I add an additional field that looks just like that one? Thanks, Greg Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 6, 2003 Share Posted March 6, 2003 OK - got it working... <?php while (($pu = each($ut['value']['last_page_url']))&&($du = each($ut['value']['page_desc']))) { ?> <tr> <td class="dataTableContent"></td> <td class="dataTableContent" colspan=2> <table border="1" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="dataTableContent" align="right"><?php echo date('H:i:s', $pu['key']); ?>:</td> <td class="dataTableContent" align="left"><a href="<?php echo $pu['value']; ?>" target="_new"><?php echo $pu['value']; ?></a></td> <td class="dataTableContent" align="left"><a href="<?php echo $pu['value']; ?>" target="_new"><?php echo $du['value']; ?></a></td> </tr> </table> </td> </tr> <?php } } ?> Once I have it all sorted out, I'll post full instructions. Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted March 6, 2003 Share Posted March 6, 2003 OK -- I have completed changes to include a description of each page in the report. If the page is a product or category page, you'll see the product or category/subcategory name. Otherwise, it will show you the HEADING_TITLE for that page. Because we're calling HEADING_TITLE, you'll have to move the call to user_tracking out of application_top and into a file that is called AFTER the language file. footer.php works for me. See readme for install instructions. Here's what it looks like: Here's the link to a zip file: http://www.tibetcollection.com/downloads/u...er_tracking.zip If you have already installed, add a field to your user_tracking table called page_desc, varchar(64) not null. Be sure to move the user_tracking call out of application_top -- see readme! Please let me know if you identify any errors. Thanks, Greg Please check it out and let me know if you have any problems. 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.