Zen Cart Logo
Forums / All Other Contributions/Addons / User tracking mod

User tracking mod

Views: 183,764

Results 621 to 640 of 861
2 Dec 2013, 3:44 PM
#621
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

User tracking mod

I implemented this code change from previous post:```php
/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($page_desc, -1), '\') !== false) {
$page_desc = substr($page_desc, 0, -1);
}
/* End - User tracking v1.4.3b modification*/

$wo_last_page_url = substr($wo_last_page_url, 0, 253);
/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($wo_last_page_url, -1), '\\') !== false) {
    $wo_last_page_url = substr($wo_last_page_url, 0, -1);    
}

$referer_url = substr($referer_url, 0, 253);

while (strpos(substr($referer_url, -1), '\\') !== false) {
    $referer_url = substr($referer_url, 0, -1);    
}
/* End - User tracking v1.4.3b modification*/
Monitoring the log file and will report back if anything shows up. So far, so good. Thanks for the update.
2 Dec 2013, 4:02 PM
#622
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

BlessIsaacola:

I implemented this code change from previous post:```php
/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($page_desc, -1), '\') !== false) {
$page_desc = substr($page_desc, 0, -1);
}
/* End - User tracking v1.4.3b modification*/

$wo_last_page_url = substr($wo_last_page_url, 0, 253);
/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($wo_last_page_url, -1), '\\') !== false) {
    $wo_last_page_url = substr($wo_last_page_url, 0, -1);    
}

$referer_url = substr($referer_url, 0, 253);

while (strpos(substr($referer_url, -1), '\\') !== false) {
    $referer_url = substr($referer_url, 0, -1);    
}
/* End - User tracking v1.4.3b modification*/
> Monitoring the log file and will report back if anything shows up. So far, so good. Thanks for the update.

Thanks for your patience, and my apologies for the mixup that I thought both $wo_last_page_url and $referer_url were being truncated, when it was only the first one that actually was and really the second one is the one more likely to be long. (internal links are not likely to be 254 characters, not to say that they can't be.)

Hopefully the "lost" data does not cause heartache, otherwise will have to implement a way to capture the entire string, probably in parts so that it can be formatted properly and then stored in the database.  A thought is to split the URL up into parts short enough that if a majority of the characters needed to be escaped that the resulting string would still be parseable to add the slashes, then recombine the entire string to go into the table.  Thing is at the moment, the table is setup with a finite length for the string, and therefore would either need the string length increased, or to split the referrer_url field off into it's own table so that the page load associated with referer_url can effectively have any length of string desired.  (Remember, these things take up space on the server and each read/write to the database may also be counted by the host, so this all would be something of a concern, but doable.)

And thank you for being the guinea pig.. :)  At least the one reporting back on the issues. :)

Once you have had some good runtime, I will post the code with the above incorporated, also will post the two versions that were discussed earlier, one with a new geoIP.dat and geoIP.inc file with possibly new smaller flags, and one that just has the code and a reference to how to get/where to store/how to name the additional data that is captured in the other file.  Still trying to think of a name for the files, maybe one that has the word full and one that has CodeOnly or something like that...  Still working on that part. :)
3 Dec 2013, 1:20 AM
#623
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

To prevent the early demise of the previous edit, see below. As I said it is unlikely for an internal link to be greater than 254 characters; however, the original code went a step further and considered 128 as the maximum (see the declaration for the table and the current table length for the last url field). This is one of the downfalls of hard coding something that is dependent on something else. I'd like to implement a define that will the first time pull from the database, and thenon the next run through don't load it again as it would be defined. That would then be used to truncate the strings to the length of the table's field(s).

Towards the end of YOURSTORE/includes/functions/extra_functions/user_tracking.php

have the code look something like this:

    /* Start - User tracking v1.4.3b modification*/
    while (strpos(substr($page_desc, -1), '\\') !== false) {
        $page_desc = substr($page_desc, 0, -1);    
    }
    /* End - User tracking v1.4.3b modification*/

    $wo_last_page_url = substr($wo_last_page_url, 0, 127);
    /* Start - User tracking v1.4.3b modification*/
    while (strpos(substr($wo_last_page_url, -1), '\\') !== false) {
        $wo_last_page_url = substr($wo_last_page_url, 0, -1);    
    }

    $referer_url = substr($referer_url, 0, 253);

    while (strpos(substr($referer_url, -1), '\\') !== false) {
        $referer_url = substr($referer_url, 0, -1);    
    }
    /* End - User tracking v1.4.3b modification*/
4 Dec 2013, 2:27 AM
#624
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: User tracking mod

mc12345678:

Thanks for your patience, and my apologies for the mixup that I thought both $wo_last_page_url and $referer_url were being truncated, when it was only the first one that actually was and really the second one is the one more likely to be long. (internal links are not likely to be 254 characters, not to say that they can't be.)

Hopefully the "lost" data does not cause heartache, otherwise will have to implement a way to capture the entire string, probably in parts so that it can be formatted properly and then stored in the database. A thought is to split the URL up into parts short enough that if a majority of the characters needed to be escaped that the resulting string would still be parseable to add the slashes, then recombine the entire string to go into the table. Thing is at the moment, the table is setup with a finite length for the string, and therefore would either need the string length increased, or to split the referrer_url field off into it's own table so that the page load associated with referer_url can effectively have any length of string desired. (Remember, these things take up space on the server and each read/write to the database may also be counted by the host, so this all would be something of a concern, but doable.)

And thank you for being the guinea pig.. :) At least the one reporting back on the issues. :)

Once you have had some good runtime, I will post the code with the above incorporated, also will post the two versions that were discussed earlier, one with a new geoIP.dat and geoIP.inc file with possibly new smaller flags, and one that just has the code and a reference to how to get/where to store/how to name the additional data that is captured in the other file. Still trying to think of a name for the files, maybe one that has the word full and one that has CodeOnly or something like that... Still working on that part. :)

Thank you so much for all your work on this. I didn't experience any issue until later today. This is what was in the log:> [03-Dec-2013 12:17:46 America/New_York] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's+Science+Club%3A+Moonscope+%26+Sky+Gazers+Activity+Journal&qscrl=1&tbm=shop&tbs' at line 1 :: insert into user_tracking (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, referer_url, page_desc, customers_host_address) values ('0', 'Guest', 'af49e4a11455e29d1459dfe2f76dff34', '98.254.12.98', '1386091066', '1386091066', '/index.php?main_page=product_info&products_id=86403&gclid=CObKws3HlLsCFUtp7Aodgl0AGQ', 'https://www.google.com/webhp?sourceid=toolbar-instant&hl=en&ion=1&qscrl=1&rlz=1T4ADFA_enUS478US479#hl=en&q=Nancy+B's+Science+Club%3A+Moonscope+%26+Sky+Gazers+Activity+Journal&qscrl=1&tbm=shop&tbs=vw:l', 'Nancy B's Science Club MoonScope and Star Gazer's Activity Jo', 'OFFICE_IP_TO_HOST_ADDRESS') in /includes/classes/db/mysql/query_factory.php on line 120

IMHO, I think you should keep the mod into one package. This thing have been around for ages and nobody has complain about the size being an issue. Unless someone is on dial up I don't really think the size is that big of an issue. It will simply end up causing more headache which is not worth the marginal gain of small file size.

4 Dec 2013, 2:30 AM
#625
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: User tracking mod

mc12345678:

To prevent the early demise of the previous edit, see below. As I said it is unlikely for an internal link to be greater than 254 characters; however, the original code went a step further and considered 128 as the maximum (see the declaration for the table and the current table length for the last url field). This is one of the downfalls of hard coding something that is dependent on something else. I'd like to implement a define that will the first time pull from the database, and thenon the next run through don't load it again as it would be defined. That would then be used to truncate the strings to the length of the table's field(s).

Towards the end of YOURSTORE/includes/functions/extra_functions/user_tracking.php

have the code look something like this:

/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($page_desc, -1), '\\') !== false) {
    $page_desc = substr($page_desc, 0, -1);    
}
/* End - User tracking v1.4.3b modification*/

$wo_last_page_url = substr($wo_last_page_url, 0, 127);
/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($wo_last_page_url, -1), '\\') !== false) {
    $wo_last_page_url = substr($wo_last_page_url, 0, -1);    
}

$referer_url = substr($referer_url, 0, 253);

while (strpos(substr($referer_url, -1), '\\') !== false) {
    $referer_url = substr($referer_url, 0, -1);    
}
/* End - User tracking v1.4.3b modification*/

I applied the above and will report back if I experienced any issues. Thanks!
4 Dec 2013, 3:55 AM
#626
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

Thanks for your patience, and my apologies for the mixup that I thought both $wo_last_page_url and $referer_url were being truncated, when it was only the first one that actually was and really the second one is the one more likely to be long. (internal links are not likely to be 254 characters, not to say that they can't be.)

Hopefully the "lost" data does not cause heartache, otherwise will have to implement a way to capture the entire string, probably in parts so that it can be formatted properly and then stored in the database. A thought is to split the URL up into parts short enough that if a majority of the characters needed to be escaped that the resulting string would still be parseable to add the slashes, then recombine the entire string to go into the table. Thing is at the moment, the table is setup with a finite length for the string, and therefore would either need the string length increased, or to split the referrer_url field off into it's own table so that the page load associated with referer_url can effectively have any length of string desired. (Remember, these things take up space on the server and each read/write to the database may also be counted by the host, so this all would be something of a concern, but doable.)I wonder if changing from "varchar(256)" to "text" would work?
It would certainly sort out url length problems.
And as this is not accessed a lot, any slowdown on access would probably not be noticeable
Just thinking out loud here!

6 Dec 2013, 2:03 PM
#627
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

gilby:

I wonder if changing from "varchar(256)" to "text" would work?
It would certainly sort out url length problems.
And as this is not accessed a lot, any slowdown on access would probably not be noticeable
Just thinking out loud here!

I'm sorry that I'm not in front of a computer to do a knowledgeable search for the use of varchar(256), but I am assuming that is in reference to the table construct. Ie, if the table had a "limitless" text field then wouldn't have to worry about truncation. While this is true, it would go against one of the factors originally considered for this plugin: to maintain the referencing uri/last page looked at while minimizing database storage volume. For those that don't have a concern about database storage capacity a change such as this would allow maintaining the uri unchanged: however, also wouldn't directly correct the current problem at hand.

The current problem is cleaning up the information so that when sent to SQL doesn't include an unescaped single quote. Apparently addslashes() when provided the original information did not correct the ' that led up to +B' I began a search for a more appropriate function(s) to handle this situation. Expansion of the data to include a string instead of varchar. Trying not to give a short answer by truncating the string at the end of the host URI but provide some information that might still be relevant.

9 Dec 2013, 2:12 AM
#628
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

Sorry for what will become a long post... I have submitted version 1.5 of User Tracking... This version includes a rewrite of the data capture portion of UT. This is the portion that Blessisaacola has been describing as an issue. This does not address the other portion of data capture desired to be changed, but specifically the potential of information being supplied to UT that would cause errors to be captured. While I could possibly list individual changes made, the majority of the functional changes are in the catalog side of the program. First is the list of information submitted tonight for review (probably too late to be posted this weekend).

The below code partially addresses item one below; however, it is the most significant revision and should be implemented at one's earliest convenience. Items 2 and 3 can be found using links previously posted in this forum. Item 4 was simply to bring the code more into ZC standard.

Updated 12/08/2013 Version 1.5

  1. Corrected a long standing issue with capturing data from the URL. The URLs are still truncated; however, they are now sent through for cleansing using Zen Carts db class prior to being sent to the SQL. This should reduce the occurrences of/prevent the SQL statement failure.
  2. Incorporated a new GeoIP.dat file (recent as of: Dec-05-2013. Similar updates can be obtained from: http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz.
  3. Incorporated a new geoip.inc file to accompany the GeoIP.dat file. The geoip.inc file can be obtained from: https://raw.github.com/maxmind/geoip-api-php/master/src/geoip.inc.
  4. Incorporated zen_href_link to generate links.

UPDATING INSTRUCTIONS:
For SQL statements: If updating from version 1.4.2, then: Use the UPDATE_VER.sql after any other SQL statements (This will update the version number of User Tracking)
otherwise same instructions as applicable from the 11/10/2013 update.

Files Updated from Version 1.4.4:
includes/functions/extra_functions/user_tracking.php
YOUR_ADMIN/user_tracking.php
YOUR_ADMIN/user_tracking_config.php
YOUR_ADMIN/includes/GeoIP.dat
YOUR_ADMIN/includes/geoip.inc
YOUR_ADMIN/includes/functions/extra_functions/user_tracking.php

Added UPDATE_VER.sql

Below is the entire code of shop/includes/functions/extra_functions/user_tracking.php which should be used to replace the previous version of this function. Update of the other files is not considered quite as crucial. Do not copy this code as written to any other file, the admin version of this is different.

<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: usertracking 2004-12-1 [email protected] http://open-operations.com
function zen_update_user_tracking()
  {
    global $db;
    global $customer_id, $languages_id, $_GET;
    
    foreach(explode(",", CONFIG_USER_TRACKING_EXCLUDED) as $skip_ip) {
    $skip_tracking[trim($skip_ip)] = 1;
    }
    if ($_SESSION['customer_id']) {
      $wo_customer_id = $customer_id;
    $customer = $db->Execute("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . "'");
    $wo_full_name = $db->prepare_input($customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']);
    }
    else {
    $wo_customer_id = '';
    $wo_full_name = $db->prepare_input('Guest');
    }
    $wo_session_id = $db->prepare_input(zen_session_id());
    $wo_ip_address = getenv('REMOTE_ADDR');
    $wo_last_page_url = addslashes(getenv('REQUEST_URI'));
    $referer_url = ($_SERVER['HTTP_REFERER'] == '') ?  $wo_last_page_url : $_SERVER['HTTP_REFERER'];
        if (($_GET['products_id'] || $_GET['cPath'])) {
                if ($_GET['cPath'] && ZEN_CONFIG_SHOW_USER_TRACKING_CATEGORY == 'true') {   // JTD:12/04/06 - Woody feature request
                        $cPath = $_GET['cPath'];
                        $cPath_array = zen_parse_category_path($cPath);
                        $cPath = implode('_', $cPath_array);
                        $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
                        $page_desc_values = $db->Execute("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $current_category_id . "'");
                        $page_desc = $db->prepare_input($page_desc_values->fields['categories_name'] . ' - ');
                }
        if ($_GET['products_id']) {
                $page_desc_values = $db->Execute("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $_GET['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
                $page_desc .= $db->prepare_input($page_desc_values->fields['products_name']);
            }
        }
        else {
                $page_desc = $db->prepare_input(HEADING_TITLE);
                if ($page_desc == "HEADING_TITLE")
                        $page_desc = $db->prepare_input(NAVBAR_TITLE);
        }
        $current_time = $db->prepare_input(time());
       $current_time = $current_time;
    if ($skip_tracking[$wo_ip_address] != 1) {
    // JTD:05/15/06 - Query bug fixes for mySQL 5.x
        $wo_ip_address = $db->prepare_input($wo_ip_address);
        
        $cust_id = $_SESSION['customer_id'];
        if ($cust_id == NULL) {
            $cust_id = 0;
        }

    $cust_id = $db->prepare_input($cust_id);
    
     $customers_host_address = $_SESSION['customers_host_address']; // JTD:11/27/06 - added host address support
    $customers_host_address = $db->prepare_input($customers_host_address);

    $page_desc = substr($page_desc, 0, 63);
    /* Start - User tracking v1.4.3b modification*/
    /*while (strpos(substr($page_desc, -1), '\\') !== false) {
        $page_desc = substr($page_desc, 0, -1);    
    }*/
    /* End - User tracking v1.4.3b modification*/
    $wo_last_page_url = $db->prepare_input($wo_last_page_url);
    
    $wo_last_page_url = substr($wo_last_page_url, 0, 125);
    /* Start - User tracking v1.4.3b modification*/
    /*while (strpos(substr($wo_last_page_url, -1), '\\') !== false) {
        $wo_last_page_url = substr($wo_last_page_url, 0, -1);    
    }*/

    $referer_url = $db->prepare_input($referer_url);

    $referer_url = substr($referer_url, 0, 253);

    /*while (strpos(substr($referer_url, -1), '\\') !== false) {
        $referer_url = substr($referer_url, 0, -1);    
    }*/
    $user_track_array = array();
    $user_track_array[] = array('fieldName'=>'customer_id', 'value'=>$cust_id, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'full_name', 'value'=>$wo_full_name, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'session_id', 'value'=>$wo_session_id, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'ip_address', 'value'=>$wo_ip_address, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'time_entry', 'value'=>$current_time, 'type'=>'date');
    $user_track_array[] = array('fieldName'=>'time_last_click', 'value'=>$current_time, 'type'=>'date');
    $user_track_array[] = array('fieldName'=>'last_page_url', 'value'=>$wo_last_page_url, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'referer_url', 'value'=>$referer_url, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'page_desc', 'value'=>$page_desc, 'type'=>'string');
    $user_track_array[] = array('fieldName'=>'customers_host_address', 'value'=>$customers_host_address, 'type'=>'string');
    
    /* End - User tracking v1.4.3b modification*/
    $db->perform(TABLE_USER_TRACKING, $user_track_array);
//    $db->Execute("insert into " . TABLE_USER_TRACKING . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, referer_url, page_desc, customers_host_address) values ('" . $cust_id . "', '" . $wo_full_name . "', '" . $wo_session_id . "', '" . $wo_ip_address . "', '" . $current_time . "', '" . $current_time . "', '" . $wo_last_page_url . "', '" . $referer_url . "', '" . $page_desc . "', '" . $customers_host_address . "')");
    }
  }
?>
3 Jan 2014, 10:25 AM
#629
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

And just when I thought that the plugin was working properly through and through I received the following in a private message:

After a few complaints from some of our customers who installed your latest version, your latest release seems to fail on PHP 5.4. Not sure the issue but the tracker works but for some reason the config page is blank. We have not had a chance to look into this deeply to figure the reason yet, even though all tables are inserted into the database as they should but maybe you may want to just in case it is something out of the ordinary.

I have identified the following "quick" fix for any affected by it. My understanding is that the configuration area does not work on a PHP 5.4 system, but everything else about the plug-in does. In further review of the files and the history of their generation, it appears that developers thought that a unique configuration file was necessary instead of the ZenCart default configuration system/path. Unfortunately, the differences were observed in the latest review/update, but were not incorporated because there was no reported issue with it and the observed behavior was that after making the first selection the configuration file seemed to work correctly. At any rate, the following SQL will revert the User Tracking Config selection to the Configuration area and will default to using the ZC file used for typical configuration. A future update installation file will correct/address this appropriately.

Running the following SQL inside of the admin area after installation should restore configuration functionality for those that have been receiving a "blank" screen when selecting the User Tracking Config menu option. The effect is that the User Tracking Config menu option will be moved to the Configuration menu area and that the ZC default configuration menu routine will be used instead of a User Tracking Configuration menu routine.

SELECT @UserTrackgID := configuration_group_id 
FROM configuration_group where configuration_group_title LIKE '%User Tracking Config%';

UPDATE admin_pages SET `page_params`= CONCAT('gID=', @UserTrackgID), `menu_key`='configuration', `main_page`='FILENAME_CONFIGURATION' WHERE `page_key`='UserTrackingConfig';
18 Feb 2014, 8:41 AM
#630
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

A new update is expected soon. I've incorporated IP Blocker for Zen Cart 1.5.0+ into the code of user tracking. Have also cleaned up the html a little, and changed most of the gets into posts. Works a little differently than before, but still works, with ot without IP Blocker. Trying to see if can still track access to the special blocked response page or similar.think just need to add the notifier code to the appropriate file(s)/location(s)

10 Mar 2014, 8:24 AM
#631
cefyn avatar

cefyn

New Zenner

Join Date:
May 2007
Posts:
87
Plugin Contributions:
1

Re: User tracking mod

I've just installed the updated version of this,no problems.But the previous version had a feature that let you clear the cache past the last 72 hrs of data. Any way I could put that back in ? The user tracking database table grows alarmingly fast. Talking of which,and this might be the wrong place to post this question ,so please point me to the right thread if you don't want to discuss this here - as I write I can see in my user tracking, about 800 single hits in the last hour from various i.p.'s ,all with the same originating url - a site which is outside my site and nothing to do with my site and has no legitimate link to my site.Whats going on with that kind of thing ?

10 Mar 2014, 11:58 AM
#632
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

cefyn:

I've just installed the updated version of this,no problems.But the previous version had a feature that let you clear the cache past the last 72 hrs of data. Any way I could put that back in ? The user tracking database table grows alarmingly fast. Talking of which,and this might be the wrong place to post this question ,so please point me to the right thread if you don't want to discuss this here - as I write I can see in my user tracking, about 800 single hits in the last hour from various i.p.'s ,all with the same originating url - a site which is outside my site and nothing to do with my site and has no legitimate link to my site.Whats going on with that kind of thing ?

Don't know from what version you upgraded, but the delete option is still present, check the configuration panel for User Tracking, the delete option probably has beeen set to default off. If the configuration window is not present then there is a patch above to make it reappear and under the configuration menu option.

As for the various hits, welcome to the new version of User Tracking that prevents the potential abuse by making the SQL queries of incoming data safer. Basically, that has probably been happening (check your server logs) for a while now, and it is only because of the rewrite that you are now observing the action.

It was discovered by those that had newly installed an older version of User Tracking that there would often or occassionally be an error generated by an outside visitor with information logged. Review of the logged information showed that the SQL query/page to visit had incorrect information/was formatted with a purpose. The web address being visited often had a single quote ' in it. When was the last time you went to a webpage that had a single quote in it's title? Anyways, that single quote caused some issues. As a result the method of capturing outside data was revised. Also, to support the growth of other users being given access to the site, an option was added in to allow/disallow various actions through the configuration menu.

11 Mar 2014, 5:26 PM
#633
cefyn avatar

cefyn

New Zenner

Join Date:
May 2007
Posts:
87
Plugin Contributions:
1

Re: User tracking mod

Thanks,thats what it was.And thanks for the explanation.

12 Mar 2014, 10:57 PM
#634
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

cefyn:

Thanks,thats what it was.And thanks for the explanation.

Welcome, and with that said, if your host is now using PHP 5.4, you more than likely will need to run a patch that is a page or two back to default to using the ZC installed configuration file instead of the originally provided User Tracking admin configuration file. The older version uses code that is no longer supported by PHP 5.4 and the additional config file has become obsolete/unnecessary for newer versions of ZC.

17 Jun 2014, 7:34 PM
#635
mycoolhats avatar

mycoolhats

New Zenner

Join Date:
Mar 2014
Location:
Utah
Posts:
23
Plugin Contributions:
0

Re: User tracking mod

Hello, I am having two problems with this new install. I am currently using ZenCart v1.5.1 and using User Tracking Version 1.4.4. I have the menu working great under "User Tracking Config", but I am not getting any tracking results. I have verified the lines

#1. Under my "User Tracking" Screen I get this (it would appear that I a missing a language file, but I gone through each file and uploaded all one by one to make sure they were in the appropriate folders).
*
User Tracking Start: * Hide SpidersShow Spiders Update Report
This tool allows for you to see the click patterns of the users through your site, organized by sessions. This data can be very valuable to those looking for how to improve your site by watching how customers actually use it. You can surf back and forth through the days by using the link below.
Idle time is calculated from the current date/time and is based off of the last action taken during the session.
SELECT VIEW: Back to Jun 16, 2014

Now displaying the latest CONFIG_USER_TRACKING_SESSION_LIMIT sessions of this 24 hour period. You can also purge all records past the last 7 day(s) of data.

Delete all info from IP-Address CONFIG_USER_TRACKING_EXCLUDED purge all records

There have been 0 page views in this 24 hour period. Total number of users: 0. Total number of spiders: 0.
There have been 0 page views in this 24 hour period. Total number of users: 0. Total number of spiders: 0.*

#2. The second issue I am having is an error in my logs: ```php
[17-Jun-2014 13:09:11] PHP Fatal error: 1136:Column count doesn't match value count at row 1 :: INSERT INTO configuration VALUES (0, 'User Tracking Visitors', 'ZEN_CONFIG_USER_TRACKING', 'true', 'Check the Customers/Guests behaviour ? (each click will be recorded)', @UserTrackgID, 1, '2003-03-03 11:19:26', '2003-02-09 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),'); in /home1/mycoolha/public_html/catalog/includes/classes/db/mysql/query_factory.php on line 120


I have tried to go this forum thread and to be honest I am confused by all the changes and different sql patches. I apologize if I am referring to an issue you have already cleared up. Any help would be greatly appreciated. Obviously I have done something wrong.:frusty: Thank you!
17 Jun 2014, 8:04 PM
#636
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

MyCoolHats:

Hello, I am having two problems with this new install. I am currently using ZenCart v1.5.1 and using User Tracking Version 1.4.4. I have the menu working great under "User Tracking Config", but I am not getting any tracking results. I have verified the lines

#1. Under my "User Tracking" Screen I get this (it would appear that I a missing a language file, but I gone through each file and uploaded all one by one to make sure they were in the appropriate folders).
*
User Tracking Start: * Hide SpidersShow Spiders Update Report
This tool allows for you to see the click patterns of the users through your site, organized by sessions. This data can be very valuable to those looking for how to improve your site by watching how customers actually use it. You can surf back and forth through the days by using the link below.
Idle time is calculated from the current date/time and is based off of the last action taken during the session.
SELECT VIEW: Back to Jun 16, 2014

Now displaying the latest CONFIG_USER_TRACKING_SESSION_LIMIT sessions of this 24 hour period. You can also purge all records past the last 7 day(s) of data.

Delete all info from IP-Address CONFIG_USER_TRACKING_EXCLUDED purge all records

There have been 0 page views in this 24 hour period. Total number of users: 0. Total number of spiders: 0.
There have been 0 page views in this 24 hour period. Total number of users: 0. Total number of spiders: 0.*

#2. The second issue I am having is an error in my logs: ```php
[17-Jun-2014 13:09:11] PHP Fatal error: 1136:Column count doesn't match value count at row 1 :: INSERT INTO configuration VALUES (0, 'User Tracking Visitors', 'ZEN_CONFIG_USER_TRACKING', 'true', 'Check the Customers/Guests behaviour ? (each click will be recorded)', @UserTrackgID, 1, '2003-03-03 11:19:26', '2003-02-09 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),'); in /home1/mycoolha/public_html/catalog/includes/classes/db/mysql/query_factory.php on line 120

> 
> I have tried to go this forum thread and to be honest I am confused by all the changes and different sql patches. I apologize if I am referring to an issue you have already cleared up. Any help would be greatly appreciated. Obviously I have done something wrong.:frusty: Thank you!

The first issue (what looks like a missing definition) is actually a missing database install (SQL). That is/would be included in one of the unfortunately not well put together sets of files.  Or so it would seem to me as the one that. Packaged it and somehow lead you down this path.  

The second item, I am not sure why there is something different about that statement compared to what is in your database, but it appears that the number of columns between the two do not match.  Version of ZC? 

I have been working on packaging this better, but have gotten distracted with other things.  May need to finish it off in the short term.  Had a few other minor improvements as well. Was making progress on incorporating the ip blocker developed by lat9 until it got fundamentally changed. :)
17 Jun 2014, 8:17 PM
#637
mycoolhats avatar

mycoolhats

New Zenner

Join Date:
Mar 2014
Location:
Utah
Posts:
23
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

The first issue (what looks like a missing definition) is actually a missing database install (SQL). That is/would be included in one of the unfortunately not well put together sets of files. Or so it would seem to me as the one that. Packaged it and somehow lead you down this path.

The second item, I am not sure why there is something different about that statement compared to what is in your database, but it appears that the number of columns between the two do not match. Version of ZC?

I have been working on packaging this better, but have gotten distracted with other things. May need to finish it off in the short term. Had a few other minor improvements as well. Was making progress on incorporating the ip blocker developed by lat9 until it got fundamentally changed. :)

The version of zencart 1.5.1 and I understand you are busy. Just let me know when you have a package put together and I will try again. Until then any suggestions are welcome. I don't which SQL to use that came in the download. I have tried them all and uninstalled sql - every option I can think off. I usually get a duplicate error or the column count doesn't match. I think it may be due to me using 1.5.1???

17 Jun 2014, 8:28 PM
#638
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

MyCoolHats:

The version of zencart 1.5.1 and I understand you are busy. Just let me know when you have a package put together and I will try again. Until then any suggestions are welcome. I don't which SQL to use that came in the download. I have tried them all and uninstalled sql - every option I can think off. I usually get a duplicate error or the column count doesn't match. I think it may be due to me using 1.5.1???

I can say this, no it's not because of using zC 1.5.1.

Placing the entire code of the new install sql into the instaall sql patches window of the admin should install all of the sql at once. It will not work if put in one line at a time.

17 Jun 2014, 8:31 PM
#639
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

Also just looked, the most recent version is 1.5.

17 Jun 2014, 8:48 PM
#640
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

There is a difference in the formatting of the new user and update sql statements regarding how the calls are made to the sql database. The new install sends on as if the number of columns in the sql statement is exactly correct. Have you added any plugins to your cart, and if so which?

I know one of the things to modify in the new user sql is to instead just insert into the table, inform the database what the following assignments relate to.

Take a look at the update_user_tracking.sql. The first insert statement inserts into the configuration table and has a parenthetical list of fields. If you copy that parenthetical list and paste it between configuration and VALUES in the new_install_user_tracking.sql file (where it is not currently), that should resolve the issues found at the first insert to the configuration table.

Then I think now that I look at the new_install and update sqls, that the update sql is to be run after the new_install.

Sorry, it appears that the full new install sql didn't get the new features added to it. :/ thank you for identifying this. All the more reason to put together the installer I was working on so that the instructions will be very easy. :) it is easier to do than to document. :) I will do better though.