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

User tracking mod

Views: 183,751

Results 541 to 560 of 861
29 Aug 2013, 10:21 PM
#541
petro avatar

petro

New Zenner

Join Date:
Aug 2013
Location:
Houston, Texas
Posts:
35
Plugin Contributions:
0

User tracking mod

ok for some reason after re-uploading those two files my site has gone blank lol OK I reuploaded both "admin" and "Included" folder back into their spots and its up again, but still no tracking.

29 Aug 2013, 10:33 PM
#542
petro avatar

petro

New Zenner

Join Date:
Aug 2013
Location:
Houston, Texas
Posts:
35
Plugin Contributions:
0

Re: User tracking mod

Ok for some reason having this code in my template footer is not working... anyways I added the code to the bottom of my header and its tracking guests and such now....

29 Aug 2013, 10:46 PM
#543
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

petro:

ok for some reason after re-uploading those two files my site has gone blank lol OK I reuploaded both "admin" and "Included" folder back into their spots and its up again, but still no tracking.

May need to clear your cache, sessions, and/or cookies in order to see changes. (Or use a different browser, that sometimes works for me in a quick pinch.)

29 Aug 2013, 10:49 PM
#544
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

petro:

Ok for some reason having this code in my template footer is not working... anyways I added the code to the bottom of my header and its tracking guests and such now....

You may have a problem in your footer or before it that is preventing getting to that line of code... Should verify that all of your footer content is appearing as expected and that there are no error messages associated with it.

Also, there are multiple header type files, so you will "lose" some tracking as guests go to the header files that you haven't added the code to; however, there is only one footer file for them all, which is partially why the code is captured in the footer. In development of using the observers, I tried to use the code associated with the headers; however, on multiple occasions I received odd location information about the user, so gave up and went back to the footer file in hopes that one day the notifier for the footer might be added to the core code.

29 Aug 2013, 11:26 PM
#545
petro avatar

petro

New Zenner

Join Date:
Aug 2013
Location:
Houston, Texas
Posts:
35
Plugin Contributions:
0

Re: User tracking mod

After messing around with the files in my template im not so sure its even using the footer in my template folder ugh.... Ive changed things around in it, deleted it etc and it doesnt change the footer on the site.... I clear cache and cookies before each refresh

29 Aug 2013, 11:38 PM
#546
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

petro:

After messing around with the files in my template im not so sure its even using the footer in my template folder ugh.... Ive changed things around in it, deleted it etc and it doesnt change the footer on the site.... I clear cache and cookies before each refresh

Well, if not mistaken that could cause problems with various browsers, because I thought there was HTML code that closes out the view of the webpage in it.

I would suggest that you either seek out more help in a new thread or hire someone to help.

30 Aug 2013, 12:01 PM
#547
petro avatar

petro

New Zenner

Join Date:
Aug 2013
Location:
Houston, Texas
Posts:
35
Plugin Contributions:
0

Re: User tracking mod

mc, ill take it to another thread. It looks like I have a tpl_top_html.php that looks just like the footer that my site is calling to not the footer.... wierd

6 Nov 2013, 4:09 PM
#548
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: User tracking mod

A couple issues with the install sql

  1. CREATE TABLE user_tracking... TYPE=MyISAM
    should be ENGINE=MyISAM

That should fix mod related errors which show up in the logs
( includes/classes/db/mysql/query_factory.php on line 120).

  1. And the sort value should be 999 (not 31) for
    INSERT INTO configuration_group (configuration_group_id,.....

(and the uninstall sql posted to this thread adjusted accordingly).

  1. Also the readme should say User Tracking Config now shows up in Tools menu (previously appeared in the Configuration menu)

Appreciate the updates to the mod to hide/show spider crawls.

6 Nov 2013, 5:16 PM
#549
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

Woodymon:

A couple issues with the install sql

  1. CREATE TABLE user_tracking... TYPE=MyISAM
    should be ENGINE=MyISAM

That should fix mod related errors which show up in the logs
( includes/classes/db/mysql/query_factory.php on line 120).

  1. And the sort value should be 999 (not 31) for
    INSERT INTO configuration_group (configuration_group_id,.....

(and the uninstall sql posted to this thread adjusted accordingly).

  1. Also the readme should say User Tracking Config now shows up in Tools menu (previously appeared in the Configuration menu)

Appreciate the updates to the mod to hide/show spider crawls.

  • Item 1 is being corrected in an update.
  • Item 2 an the update is going to use the next number instead of forcing to 999 (suggestion posted ages ago by Dr. Byte, as such I have tried to go through the entire readme to pull in any suggestions/hints/tips to incorporate into the next update, these will be added as well.)
  • Item 3 noted and will update that in the documents. Last couple of updates were to specifically target some changes and did not include any form of comprehensive review.

This leads to the last non-bulleted item. During the comprehensive review it was identified that the code already partially hid spider crawls, the addition made is supposed to effectively hide them now, but the resulting "show spider crawls" does not truly show all of the spider crawls. This is an area that I would like to expand on and add some additional administrative controls to allow a store "reviewer" to be only allowed to do as permitted by the store owner. (Ie., may not be able to delete records, Hide from the reviewer the admin's activity or the activity of a particular individual (again would be logged, but not visible until the config switch was flipped allowing it to be seen), perhaps some other similar controls.) In review of the forum, there was guidance provided about what to enter into the footer to track various types of information, but have now seen that those hints were not incorporated, so would like to offer an admin switch to change the logging "preferences" as well.

I possibly could push out an interim update; however, have been wanting to not cycle the users of it, though I guess at least the SQL for a new install should be updated to help those newly coming on-board.

7 Nov 2013, 1:20 PM
#550
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

Woodymon:

A couple issues with the install sql

  1. And the sort value should be 999 (not 31) for
    INSERT INTO configuration_group (configuration_group_id,.....

(and the uninstall sql posted to this thread adjusted accordingly).

Been thinking about this particular comment and trying to understand. I took a look through my cart's database and found that in some cases the sort_id followed the configuration_group_id; however, in some cases not. Where is there information associated with the way this should go as a "general programming" option? I've already modified the preliminary update to reflect the same sort_id as the configuration_group_id (whatever it may end up being based on the user's cart), but when I changed the setting in my own cart's database nothing changed in my admin panel.

Further related to the config section, I am not sure why it was changed to be in the area of the Tools menu and was also "confused" about why. It would seem to me that it should fall into the configuration menu and that the User Tracking Log potentially stay where it is. Anyone have design input while moving forwards with additional updates either from a usage side or to meet ZC standards? (I realize this could be a can of worms, but if making changes, should consider the larger audience than my own "little world".)

11 Nov 2013, 8:36 AM
#551
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

Just submitted an update to this plugin, may not be "available" until next weekend:

  1. Added settings to Admin Config:
    1.1) User visiting the User tracking page ability to delete log entries.
    1.2) Ability to modify how much history to keep when purging/deleting entries using standard units of measure (hours, days, weeks, months (determined using 30 days)
    1.3) Added option of data to submit into log based on user forum input.
    1.4) Added a version field to the configuration utility.
  2. Modified English Language File to show the duration and units of the record(s) being kept/purged.
  3. Updated the shop's class.user_tracking observer to support logging of visits based on entries of the Zen-Cart user forum.
  4. Changed the Update SQL file to reflect only those changes applicable with this upgrade (I.e. old update SQL which was only really applicable to upgrading older versions of User Tracking to an earlier version.
  5. Added the number of unique visitors and spiders to the beginning of the list of sessions, so that it is now at top and bottom.
  6. Hid all options to delete information if the admin has set the delete option to false, which means not only does it not display, but also that should not be able to use a get statement to delete the old data. The ability to delete all of the items overrides the inability to delete any one item. (ie., if delete all is on and delete IP set to off then delete IP will still be possible.)
  7. Added uninstall_user_tracking.sql file.

Have not modified the logging/tracking to show more of the spiders that have been worked out of the log data. There are a few other improvements yet considered (such as an auto-installer) that have not been incorporated; however, there have been issues in the installation process that have been addressed in the forum but not incorporated into the files. A majority of that has been done.

14 Nov 2013, 10:09 AM
#552
blessisaacola avatar

blessisaacola

Totally Zenned

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

Re: User tracking mod

Thank you so much for the update. I tried to give this mod another try but failed with the SQL install. The following is the error message I received:> [14-Nov-2013 05:03:35 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 '. '.php', '', 'tools', 'Y', 10000)' at line 1 :: /* Tables need to be ensured to include the prefix if it exists. */ INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING' . '.php', '', 'tools', 'Y', 10000); in /includes/classes/db/mysql/query_factory.php on line 120

Here are the two lines from the previous sql install:

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', '', 'tools', 'Y', 10000); 

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG', '', 'tools', 'Y', 10001);

Here are the two lines from the current sql install:

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING' . '.php', '', 'tools', 'Y', 10000); 

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG' . '.php', '', 'tools', 'Y', 10001);

Not sure why the modification in the current install but definitely causing issue.

14 Nov 2013, 11:00 AM
#553
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

BlessIsaacola:

Thank you so much for the update. I tried to give this mod another try but failed with the SQL install. The following is the error message I received:

Here are the two lines from the previous sql install:

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', '', 'tools', 'Y', 10000);

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG', '', 'tools', 'Y', 10001);

> 
> Here are the two lines from the **current** sql install:
> 
> ```
INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING' . '.php', '', 'tools', 'Y', 10000); 

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG' . '.php', '', 'tools', 'Y', 10001);

Not sure why the modification in the current install but definitely causing issue.

Thank you for the detailed feedback. The change was made, because the assignment of the filename in the associated define file was not standard to ZC. (It previously included the extension.) That said, I did not properly format the SQL statement to concatenate the two strings. I'll have to provide an update.

In the meantime, and because I have not tested this statement, try replacing 'FILENAME_USER_TRACKING_CONFIG' . '.php' with:
CONCAT('FILENAME_USER_TRACKING_CONFIG', '.php')
And report back the result.
And the same thing with the one without CONFIG on the end.

14 Nov 2013, 12:59 PM
#554
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

mc12345678:

Thank you for the detailed feedback. The change was made, because the assignment of the filename in the associated define file was not standard to ZC. (It previously included the extension.) That said, I did not properly format the SQL statement to concatenate the two strings. I'll have to provide an update.

In the meantime, and because I have not tested this statement, try replacing 'FILENAME_USER_TRACKING_CONFIG' . '.php' with:
CONCAT('FILENAME_USER_TRACKING_CONFIG', '.php')
And report back the result.
And the same thing with the one without CONFIG on the end.

Yeah, it really pays to test all aspects of a change...

So the SQL statement for adding the two menu options of tracking and user tracking config should not have been changed. I wrongly assumed that because I had changed the Define for the filename that I would have to append '.php' to the sql statement. So, yes an update will still be necessary to the install SQL to restore those two lines back to what they were:

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', '', 'tools', 'Y', 10000);

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG', '', 'tools', 'Y', 10001);
14 Nov 2013, 2:50 PM
#555
blessisaacola avatar

blessisaacola

Totally Zenned

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

Re: User tracking mod

mc12345678:

Yeah, it really pays to test all aspects of a change...

So the SQL statement for adding the two menu options of tracking and user tracking config should not have been changed. I wrongly assumed that because I had changed the Define for the filename that I would have to append '.php' to the sql statement. So, yes an update will still be necessary to the install SQL to restore those two lines back to what they were:

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', '', 'tools', 'Y', 10000);

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG', '', 'tools', 'Y', 10001);


Thank you for looking into this. Do you want me to test with the previously suggested modification or do you want me to test by replacing the two lines from the previous sql install so the new install sql looks like this:

/* Tables need to be ensured to include the prefix if it exists. */

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', '', 'tools', 'Y', 10000);

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG', '', 'tools', 'Y', 10001);

DROP TABLE IF EXISTS user_tracking;
CREATE TABLE user_tracking (
customer_id int(11) default NULL,
click_id int(11) default NULL,
full_name varchar(64) NOT NULL default '',
session_id varchar(32) NOT NULL default '',
ip_address varchar(15) NOT NULL default '',
time_entry varchar(14) NOT NULL default '',
time_last_click varchar(14) NOT NULL default '',
last_page_url varchar(128) NOT NULL default '',
referer_url varchar(254) NOT NULL default '',
page_desc varchar(64) NOT NULL default '',
customers_host_address varchar(64) NOT NULL default ''
) ENGINE=MyISAM;

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

DELETE FROM configuration where configuration_group_id = @UserTrackgID;
/* DELETE FROM configuration where configuration_group_id = '999'; Desire is to replace 999 with the next configuration_group_id; however, this may require revision to the base code to support*/
INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('', 'User Tracking Config', 'User Tracking', '', 1);

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

UPDATE configuration_group SET 'sort_order' = @UserTrackgID WHERE 'configuration_group_id' = @UserTrackgID;

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''),');
INSERT INTO configuration VALUES (0, 'User Tracking (ADMIN)', 'ADMIN_CONFIG_USER_TRACKING', 'true', 'Check the ADMINs behaviour ? (each click will be recorded)', @UserTrackgID, 2, '2003-03-03 11:19:26', '2003-02-09 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration VALUES (0, 'User Tracking (exclude this IP-Address)', 'CONFIG_USER_TRACKING_EXCLUDED', 'your IP', 'Do NOT record this IP Address<br>(like webmaster/owners/Beta-testers)', @UserTrackgID, 10, '2003-03-04 23:08:38', '2003-02-09 21:20:07', NULL, NULL);
INSERT INTO configuration VALUES (0, 'User Tracking (Session Limit)', 'CONFIG_USER_TRACKING_SESSION_LIMIT', '50', 'Displaying the latest # sessions of this 24 hour period.<br>(SET to 999999 for unlimited per 24 hour period)<br>NOTE:<BR>Watch you space !', @UserTrackgID, 15, '2003-03-03 11:19:13', '2003-02-09 21:20:07', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE', 'true', 'Allow Record Deletion to be Active?<br/>Setting this to true will override ENTRY and SESSION purges.<br/>Default <b>true</b><br/>', @UserTrackgID, 25, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete Historical Data)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE_RECORDS', 'false', 'Allow Record Deletion of records older than now - the purge duration set below.<br/>This value is ignored if Admin User Can Delete is set to true. Otherwise set this to true to allow deletion of visits.<br/>Default <b>false</b>.<br/>', @UserTrackgID, 26, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete SESSIONS)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE_SESSIONS', 'false', 'Allow SESSION Deletion to be Active?<br/>This setting is ignored if Admin User Can Delete is set to true.<br/>Default <b>false</b><br/>', @UserTrackgID, 27, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete IP)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE_IP', 'false', 'Allow Deletion of records that match the identified IP address?<br/>This setting is ignored if Admin User Can Delete is set to true.<br/>Default <b>false</b><br/>', @UserTrackgID, 28, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Purge this Number)', 'CONFIG_USER_TRACKING_PURGE_NUMBER', '3', 'What is the number associated with purging before the current date/time?<br/><br/>An example would be to choose 3 here and units associated with days to delete data greater than 3 days before today.<br/>', @UserTrackgID, 30, '2013-11-09 23:08:38', '2013-11-09 23:08:38', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Purge Units)', 'CONFIG_USER_TRACKING_PURGE_UNITS', '1440', 'Pick the units associate with the periodicity to allow purging data.<br/><br/>60) Hours<br/>1440) Days<br/>10080) Weeks<br/>43200) Months (Based on 30 days)<br/>', @UserTrackgID, 31, '2013-11-09 23:08:38', '2013-11-09 23:08:38', NULL, 'zen_cfg_select_option(array(''60'', ''1440'',''10080'',''43200''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Type of User Interaction to Record)', 'CONFIG_USER_TRACKING_TRACK_TYPE_RECORD', '1', 'Type of user tracking to record?<br/><br/>1 - All visitors.<br/>2 - Visitors views where sessions have been started.<br/>3 - All users except bots/spiders ( requires Configuration->Sessions->Prevent Spider Sessions->true) (Don't know if this works with Zen-Cart versions older than 1.2.6d)<br/><br/>Related to above: If you set Force Cookie Use->true, then at the first user entry, sessions do not start!!! And in variants 2 and 3, user-tracking will not have started. In this case you lose one click and do not log the refferal. But if this user is a returning user and has an old/previous zen cookie the session started and your tracking system will collect this info. So, the result beforehand is not logged or will not be known.<br/>', @UserTrackgID, 40, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''1'', ''2'',''3''),');
INSERT INTO configuration VALUES (0, 'User Tracking (your favorite WHOIS URL)', 'USER_TRACKING_WHOIS_URL', 'http://www.dnsstuff.com/tools/whois.ch?ip=', 'Put here you favorite WHOIS tracking site<br>(the IP will follow automaticly after this url)', @UserTrackgID, 50, '2003-03-03 11:19:13', '2003-03-11 11:40:01', NULL, NULL);
INSERT INTO configuration VALUES (0, 'User Tracking (Show Product Category when tracking product clicks)', 'ZEN_CONFIG_SHOW_USER_TRACKING_CATEGORY', 'true', 'Show Product Category when tracking product clicks', @UserTrackgID, 60, '2006-12-05 11:19:26', '2006-12-05 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration VALUES (0, 'User Tracking (Version Installed)', 'CONFIG_USER_TRACKING_VERSION', '1.4.3', 'Shows the version number associated with user tracking and should be updated with each upgrade', @UserTrackgID, 1000, '2013-11-10 04:19:26', '2013-11-18 04:19:26', NULL, NULL);

14 Nov 2013, 3:10 PM
#556
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: User tracking mod

Thanks for the mod updates.

The current UT mod package, which includes the country flag gif images images, is appx 675K. Is it possible to strip out and place the country flag images into a separate download archive? Having to download the large archive just to fetch simple code updates is an inefficient use of resources.

The contents of the flags directory has not changed for ages, and likely won't change in the near future, that is unless the Maldives sinks into the ocean or Antarctica becomes a new country.

14 Nov 2013, 4:02 PM
#557
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

BlessIsaacola:

Thank you for looking into this. Do you want me to test with the previously suggested modification or do you want me to test by replacing the two lines from the previous sql install so the new install sql looks like this:

/* Tables need to be ensured to include the prefix if it exists. */

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', '', 'tools', 'Y', 10000);

INSERT INTO admin_pages (page_key, language_key, main_page, page_params, menu_key, display_on_menu, sort_order) VALUES ('UserTrackingConfig', 'BOX_TOOLS_USER_TRACKING_CONFIG', 'FILENAME_USER_TRACKING_CONFIG', '', 'tools', 'Y', 10001);

DROP TABLE IF EXISTS user_tracking;
CREATE TABLE user_tracking (
customer_id int(11) default NULL,
click_id int(11) default NULL,
full_name varchar(64) NOT NULL default '',
session_id varchar(32) NOT NULL default '',
ip_address varchar(15) NOT NULL default '',
time_entry varchar(14) NOT NULL default '',
time_last_click varchar(14) NOT NULL default '',
last_page_url varchar(128) NOT NULL default '',
referer_url varchar(254) NOT NULL default '',
page_desc varchar(64) NOT NULL default '',
customers_host_address varchar(64) NOT NULL default ''
) ENGINE=MyISAM;

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

DELETE FROM configuration where configuration_group_id = @UserTrackgID;
/* DELETE FROM configuration where configuration_group_id = '999'; Desire is to replace 999 with the next configuration_group_id; however, this may require revision to the base code to support*/
INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('', 'User Tracking Config', 'User Tracking', '', 1);

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

UPDATE configuration_group SET 'sort_order' = @UserTrackgID WHERE 'configuration_group_id' = @UserTrackgID;

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''),');
INSERT INTO configuration VALUES (0, 'User Tracking (ADMIN)', 'ADMIN_CONFIG_USER_TRACKING', 'true', 'Check the ADMINs behaviour ? (each click will be recorded)', @UserTrackgID, 2, '2003-03-03 11:19:26', '2003-02-09 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration VALUES (0, 'User Tracking (exclude this IP-Address)', 'CONFIG_USER_TRACKING_EXCLUDED', 'your IP', 'Do NOT record this IP Address<br>(like webmaster/owners/Beta-testers)', @UserTrackgID, 10, '2003-03-04 23:08:38', '2003-02-09 21:20:07', NULL, NULL);
INSERT INTO configuration VALUES (0, 'User Tracking (Session Limit)', 'CONFIG_USER_TRACKING_SESSION_LIMIT', '50', 'Displaying the latest # sessions of this 24 hour period.<br>(SET to 999999 for unlimited per 24 hour period)<br>NOTE:<BR>Watch you space !', @UserTrackgID, 15, '2003-03-03 11:19:13', '2003-02-09 21:20:07', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE', 'true', 'Allow Record Deletion to be Active?<br/>Setting this to true will override ENTRY and SESSION purges.<br/>Default <b>true</b><br/>', @UserTrackgID, 25, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete Historical Data)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE_RECORDS', 'false', 'Allow Record Deletion of records older than now - the purge duration set below.<br/>This value is ignored if Admin User Can Delete is set to true. Otherwise set this to true to allow deletion of visits.<br/>Default <b>false</b>.<br/>', @UserTrackgID, 26, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete SESSIONS)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE_SESSIONS', 'false', 'Allow SESSION Deletion to be Active?<br/>This setting is ignored if Admin User Can Delete is set to true.<br/>Default <b>false</b><br/>', @UserTrackgID, 27, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Admin User Can Delete IP)', 'CONFIG_USER_TRACKING_ADMIN_CAN_DELETE_IP', 'false', 'Allow Deletion of records that match the identified IP address?<br/>This setting is ignored if Admin User Can Delete is set to true.<br/>Default <b>false</b><br/>', @UserTrackgID, 28, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Purge this Number)', 'CONFIG_USER_TRACKING_PURGE_NUMBER', '3', 'What is the number associated with purging before the current date/time?<br/><br/>An example would be to choose 3 here and units associated with days to delete data greater than 3 days before today.<br/>', @UserTrackgID, 30, '2013-11-09 23:08:38', '2013-11-09 23:08:38', NULL, NULL);
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Purge Units)', 'CONFIG_USER_TRACKING_PURGE_UNITS', '1440', 'Pick the units associate with the periodicity to allow purging data.<br/><br/>60) Hours<br/>1440) Days<br/>10080) Weeks<br/>43200) Months (Based on 30 days)<br/>', @UserTrackgID, 31, '2013-11-09 23:08:38', '2013-11-09 23:08:38', NULL, 'zen_cfg_select_option(array(''60'', ''1440'',''10080'',''43200''),');
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (0, 'User Tracking (Type of User Interaction to Record)', 'CONFIG_USER_TRACKING_TRACK_TYPE_RECORD', '1', 'Type of user tracking to record?<br/><br/>1 - All visitors.<br/>2 - Visitors views where sessions have been started.<br/>3 - All users except bots/spiders ( requires Configuration->Sessions->Prevent Spider Sessions->true) (Don't know if this works with Zen-Cart versions older than 1.2.6d)<br/><br/>Related to above: If you set Force Cookie Use->true, then at the first user entry, sessions do not start!!! And in variants 2 and 3, user-tracking will not have started. In this case you lose one click and do not log the refferal. But if this user is a returning user and has an old/previous zen cookie the session started and your tracking system will collect this info. So, the result beforehand is not logged or will not be known.<br/>', @UserTrackgID, 40, '2013-11-09 11:19:26', '2013-11-09 11:19:26', NULL, 'zen_cfg_select_option(array(''1'', ''2'',''3''),');
INSERT INTO configuration VALUES (0, 'User Tracking (your favorite WHOIS URL)', 'USER_TRACKING_WHOIS_URL', 'http://www.dnsstuff.com/tools/whois.ch?ip=', 'Put here you favorite WHOIS tracking site<br>(the IP will follow automaticly after this url)', @UserTrackgID, 50, '2003-03-03 11:19:13', '2003-03-11 11:40:01', NULL, NULL);
INSERT INTO configuration VALUES (0, 'User Tracking (Show Product Category when tracking product clicks)', 'ZEN_CONFIG_SHOW_USER_TRACKING_CATEGORY', 'true', 'Show Product Category when tracking product clicks', @UserTrackgID, 60, '2006-12-05 11:19:26', '2006-12-05 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration VALUES (0, 'User Tracking (Version Installed)', 'CONFIG_USER_TRACKING_VERSION', '1.4.3', 'Shows the version number associated with user tracking and should be updated with each upgrade', @UserTrackgID, 1000, '2013-11-10 04:19:26', '2013-11-18 04:19:26', NULL, NULL);


I am not able to do a code comparison at the moment; however, if the only change between the above code and the original New_Install.sql is the removal of the . '.php' portion of the two SQL statements that have a page_key of UserTracking and UserTrackingConfig, then yes the original issue identified a few posts back will be resolved.  (My statement about paying to test all changes was directly in relation to that issue.)  No testing is required with the CONCAT feature/operation as it does not work.  ZenCart code apparently is able to strip excess .php statements from the defined FILENAME variable if such is included.  I state this because the previous version assigned the filename with .php included and I have removed that additional text from the define and the SQL that adds the menu item has not required any changes to work.  So, again if the above only incorporates the change to the two lines, it would be what I would suggest using.
14 Nov 2013, 4:07 PM
#558
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

Woodymon:

Thanks for the mod updates.

The current UT mod package, which includes the country flag gif images images, is appx 675K. Is it possible to strip out and place the country flag images into a separate download archive? Having to download the large archive just to fetch simple code updates is an inefficient use of resources.

The contents of the flags directory has not changed for ages, and likely won't change in the near future, that is unless the Maldives sinks into the ocean or Antarctica becomes a new country.

It is possible; however, there is the question of "easability?" of installation? Asking new users to download two products, while existing users only need the "one?" Where/What else uses those files so that this and perhaps another package could be "joined"?

Primarily addressing the way that packages are handled here on ZenCart and providing them/ensuring that provided to the operators in a sensical, understandable way... It is also a reason I have ensured to provide indication of the changed files so that at least one does not have to upload all of the contents each time.

Suggestions welcome...

14 Nov 2013, 4:54 PM
#559
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: User tracking mod

Uncompressed, the flag gifs account for 178K. I don't recall where the flags were sourced.

The bigger issue is the GeoIP.dat that accounts for 914KB uncompressed. And that data is dated, from 2006.

The geoip data comes from Maxmind
http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz

Have to pay for the GeoIP data, but GeoLite2 data is free. But then need to employ a Maxmind API to access/utilize the proprietary GeoLite2 mmdb data.

I don't know how often Maxmind updates their GeoLite2 country databases, but I suspect the current GeoLite2 mmdb data (1.5MB uncompressed) is much more up to date than the 2006 data provided in current User Tracking mod.

I don't know if the mmdb can be read or is compatible with the API code built into the current UT mod. Or the older GeoIP.dat was converted to a different format supported by the UT mod.

But if it is doable I suggest placing the geoip data and flags in a separate archive and explain in readme where to fetch and where to install. Or two separate mods, one with and one sans the geoip data and flags.

Just suggestions.

14 Nov 2013, 5:00 PM
#560
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: User tracking mod

Don't mean to be a Dannie Downer...but I have to ask what are the security issues regards to installing a large proprietary binary file, sourced from who knows where, in ones admin/includes directory? Is that big DAT file screened for malware before packaged into the mod archive?