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

User tracking mod

Views: 183,764

Results 661 to 680 of 861
5 Sep 2014, 8:36 PM
#661
mc12345678 avatar

mc12345678

Totally Zenned

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

User tracking mod

jjone:

The above sql is not working in zen cart 1.5.3

Thanks.

Please elaborate. The ZC version does not affect the operability of a sql statement. Perhaps if a table doesn't exist or aa specific field doesn't exist any longer, but there hasn't been anything so drastic in the change of ZC versions in the 1.5.x series.

How was the above sql attempted to be applied, what was the system response, what error logs were generated in the logs folder?

6 Sep 2014, 11:12 PM
#662
jjone avatar

jjone

New Zenner

Join Date:
Oct 2008
Posts:
10
Plugin Contributions:
1

Re: User tracking mod

I executed uninstall sql and then i copied your above sql for new install.

This is the error i got, WARNING: An Error occurred, please refresh the page and try again.

6 Sep 2014, 11:41 PM
#663
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

jjone:

I executed uninstall sql and then i copied your above sql for new install.

This is the error i got, WARNING: An Error occurred, please refresh the page and try again.

And as a result of that error, an error log would be generated. Please provide the resulting error log that can be found in the logs folder for ZC >= 1.5.1 or in the cache folder for ZC <=1.5.0 if the sql was placed in the sql patches area of the ZC admin.

7 Sep 2014, 12:03 AM
#664
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

mc12345678:

And as a result of that error, an error log would be generated. Please provide the resulting error log that can be found in the logs folder for ZC >= 1.5.1 or in the cache folder for ZC <=1.5.0 if the sql was placed in the sql patches area of the ZC admin.

I have tested it again this time in ZC 1.5.3. The SQL statements themselves are not an issue, but the comments that were added using // are... Haven't identified what if any acceptable commenting is available. So much for trying to provide assistive comments to make the SQL easier to troubleshoot. I just need to package this to do autoinstallation and do away with the manual install and complications that can occur from the SQL part..

Soooo.. For those that have joined us on installing this user_tracking modification, until a new version is posted, the above new_install sql found at: http://www.zen-cart.com/showthread.php?35081-User-tracking-mod&p=1254683#post1254683
should omit any line that begins with // as it will generate an error at least in ZC 1.5.3...

7 Sep 2014, 12:13 AM
#665
gilby avatar

gilby

Totally Zenned

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

Re: User tracking mod

For single line comments

-- Also for single line, must be followed by space/control character

/*
C-style multiline comment
*/

7 Sep 2014, 1:40 AM
#666
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

gilby:

For single line comments

-- Also for single line, must be followed by space/control character

/*
C-style multiline comment
*/

Gilby,

Thank you for the sliver of glimmering light to my day today.

Take three...

Below is the new_install.sql SQL that should be used modified from the downloaded package. It includes comments (correctly formatted thanks to Gilby) to help if/when issues arise while running it.

# If this script has been run before, this line is likely to cause an error. Check logs folder (ZC V >=1.5.1) or cache folder (ZC V <= 1.5.0)  If this is the SQL command that caused an error, it may be removed or commented.
INSERT INTO admin_pages (page_key, language_key, main_page, menu_key, display_on_menu, sort_order) VALUES ('UserTracking', 'BOX_TOOLS_USER_TRACKING', 'FILENAME_USER_TRACKING', 'tools', 'Y', 10000);

# If this script has been run before, this line is likely to cause an error. Check logs folder (ZC V >=1.5.1) or cache folder (ZC V <= 1.5.0)  If this is the SQL command that caused an error, it may be removed or commented.
INSERT INTO configuration_group (`configuration_group_title`, `configuration_group_description`, `visible`) VALUES ('User Tracking Config', 'User Tracking', 1);

# Do not remove these SQL lines.  They are needed for further processing.
SELECT @UserTrackgID := configuration_group_id
FROM configuration_group where configuration_group_title = 'User Tracking Config';
UPDATE configuration_group SET sort_order = @UserTrackgID WHERE configuration_group_id = @UserTrackgID AND configuration_group_id != 0;

# If this script has been run before, this line is likely to cause an error. Check logs folder (ZC V >=1.5.1) or cache folder (ZC V <= 1.5.0)  If this is the SQL command that caused an error, it may be removed or commented.
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_CONFIGURATION', CONCAT('gID=', @UserTrackgID), 'configuration', 'Y', @UserTrackgID);

# DROP TABLE IF EXISTS user_tracking;  
/* The above line is not necessary on a new install as there is no expectation of another plugin
 naming the table the same.  If however, the below line is a problem, then either the above DROP TABLE should be uncommented
 or the below CREATE TABLE should be commented using double forward slashes.  This will depend on whether the table exists by running this previously or if another application has created this table. */
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;

# DELETE FROM configuration where configuration_group_id = @UserTrackgID and @UserTrackgID != 0;  
/* The above line is not necessary for a new installation as this information is not already entered in the database; however, if while attempting to run this query, there may be an error at the insert below and therefore this may need to be uncommented to move forward with it.  Be advised, this will remove all options that are currently on the User Trackings configuration menu. */

# If this script has been run before, one or more of the below lines are likely to cause an error. Check logs folder (ZC V >=1.5.1) or cache folder (ZC V <= 1.5.0). The line(s) below up to the SQL command that caused the error may be removed or commented out.

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('User Tracking Visitors', 'ZEN_CONFIG_USER_TRACKING', 'true', 'Check the Customers/Guests behaviour? (each click will be recorded)', @UserTrackgID, 1, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('User Tracking (ADMIN)', 'ADMIN_CONFIG_USER_TRACKING', 'true', 'Check the ADMINs behaviour? (each click will be recorded)', @UserTrackgID, 2, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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 of days to delete data greater than 3 days before today.<br/>', @UserTrackgID, 30, NOW(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('User Tracking (Purge Units)', 'CONFIG_USER_TRACKING_PURGE_UNITS', '1440', 'Pick the units associate with the periodicity to allow purging data.<br/>', @UserTrackgID, 31, NOW(), NULL, 'zen_cfg_select_option(array(array(''id''=>''60'', ''text''=>''Hours''), array(''id''=>''1440'', ''text''=>''Days''),array(''id''=>''10080'', ''text''=>''Weeks''),array(''id''=>''43200'', ''text''=>''Months (Based on 30 days)'')),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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 referal. 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, NOW(), NULL, 'zen_cfg_select_option(array(''1'', ''2'',''3''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('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, NOW(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('User Tracking (Version Installed)', 'CONFIG_USER_TRACKING_VERSION', '1.5', 'Shows the version number associated with user tracking and should be updated with each upgrade', @UserTrackgID, 1000, NOW(), NULL, 'zen_cfg_select_option(array(''CONFIG_USER_TRACKING_VERSION''),');
7 Sep 2014, 1:57 PM
#667
jjone avatar

jjone

New Zenner

Join Date:
Oct 2008
Posts:
10
Plugin Contributions:
1

Re: User tracking mod

perfect! i executed uninstall sql first and then executed your above sql again. It worked !. Thank you.

12 Sep 2014, 3:54 PM
#668
captainfacepalm avatar

captainfacepalm

New Zenner

Join Date:
Oct 2013
Location:
Andover
Posts:
13
Plugin Contributions:
0

Re: User tracking mod

Hi I have been trying to get this plugin to work I installed in but could not get it to work with the new SQL so I went to un install and put the uninstall SQL and got the following error
1146 Table 'smlhygie_admin.admin_pages' doesn't exist
in:
[DELETE FROM admin_pages WHERE page_key = 'UserTracking';]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

12 Sep 2014, 4:50 PM
#669
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

CaptainFacePalm:

Hi I have been trying to get this plugin to work I installed in but could not get it to work with the new SQL so I went to un install and put the uninstall SQL and got the following error
1146 Table 'smlhygie_admin.admin_pages' doesn't exist
in:
[DELETE FROM admin_pages WHERE page_key = 'UserTracking';]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

The sqlis written to be run from the ZC admin through sql install interface. If run from myphpadmin, will need to include the table prefix if thereis one.

12 Sep 2014, 5:19 PM
#670
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

If that doesn't correct the problem, please post more information about the problem(s) identified and the method(s) taken to cause the problem(s).

15 Sep 2014, 9:05 AM
#671
captainfacepalm avatar

captainfacepalm

New Zenner

Join Date:
Oct 2013
Location:
Andover
Posts:
13
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

If that doesn't correct the problem, please post more information about the problem(s) identified and the method(s) taken to cause the problem(s).

Hi I am installing via the admin side of our website. Just selecting insert SQL and then clicking run.

Also I have found for some reason I have 4 lots of the configure User Tracking in our drop down.

18 Sep 2014, 2:04 PM
#672
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: User tracking mod

I noticed that the user tracking page can attempt to process a script from the links sounds like a security issue ant way to fix?
Attachment 14529

18 Sep 2014, 3:27 PM
#673
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

ShopVille:

I noticed that the user tracking page can attempt to process a script from the links sounds like a security issue ant way to fix?
Attachment 14529

Could you please elaborate on the issue? I have two interpretations in mind, not sure which if either is what is meant.

  1. The link that is internally processed is activated by the code through processing.
  2. If the linkis clicked the action taken at/by the destination is activated and it is that action desired to prevent?
    Is it either of those or neither and whatever the case, please explain further and how the attached image is relevant.
18 Sep 2014, 3:30 PM
#674
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: User tracking mod

This happens just by loading the user tracking page without clicking any links

  1. If the linkis clicked the action taken at/by the destination is activated and it is that action desired to prevent?
    Maybe

Some of the links in the page that might be causing the script:

cPath=23_41_63&number_of_uploads=2&action=notify&zenid=48bc9128a261160f2d52a07de1dd1c80?%3E%3CSCRIPT%3Ealert(%27SAINT%27)%3C/SCRIPT%3E
18 Sep 2014, 3:44 PM
#675
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

ShopVille:

This happens just by loading the user tracking page without clicking any links

Maybe

Some of the links in the page that might be causing the script:

cPath=23_41_63&number_of_uploads=2&action=notify&zenid=48bc9128a261160f2d52a07de1dd1c80?%3E%3CSCRIPT%3Ealert(%27SAINT%27)%3C/SCRIPT%3E


I see that there are still a few cases of links being created straight from the supplied data instead of the more preferred method of using zen_href_link functionality. That additional processing would be one way to reduce that likelihood.  I was also working on a POST instead of GET method of transferring/processing data, but haven't completed that effort.
3 Dec 2014, 8:20 PM
#676
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: User tracking mod

Where has this plugin been all the years using ZC?! Now I can track users without having to refresh Who's Online every 5 seconds. It's great! Is there a way to display the User Agent? This is really helpful for knowing if the user is on a computer, phone, or tablet...

3 Dec 2014, 8:29 PM
#677
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

pricediscrimination:

Where has this plugin been all the years using ZC?! Now I can track users without having to refresh Who's Online every 5 seconds. It's great! Is there a way to display the User Agent? This is really helpful for knowing if the user is on a computer, phone, or tablet...

Believe it or not it's been here for a really long time, starting off with Dr. Byte. It seemed to lingerdormant for a while and when I too saw it's ability and after asking if it would be okay to continue on with it, I have tried to make improvements. Currently it does need a little bit of an overhaul in the data capture aspect to come into line a little more with how who's online captures and stores the data as evidence from a few posts back. But, yes that cappability could be added. If so, I would think it should be made into a switchable data set to capture to try to minimize the database storage amount. I also planned to incorporate the ability to autodelete history beyond a certain point so that the database usage could further be limited.

But, as all plugins, if someone has made or is willing to make improvements, then they can be submitted forincorporation and public use. :)

5 Dec 2014, 5:23 PM
#678
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

Believe it or not it's been here for a really long time, starting off with Dr. Byte. It seemed to lingerdormant for a while and when I too saw it's ability and after asking if it would be okay to continue on with it, I have tried to make improvements. Currently it does need a little bit of an overhaul in the data capture aspect to come into line a little more with how who's online captures and stores the data as evidence from a few posts back. But, yes that cappability could be added. If so, I would think it should be made into a switchable data set to capture to try to minimize the database storage amount. I also planned to incorporate the ability to autodelete history beyond a certain point so that the database usage could further be limited.

But, as all plugins, if someone has made or is willing to make improvements, then they can be submitted forincorporation and public use. :)

Thanks for the reply. It's truly a great plugin and very useful. Wondering if anyone is experiencing a weird issue where if the customer has something in their cart, it shows that item listed on the right in every session's "User Shopping Cart" section...

5 Dec 2014, 5:34 PM
#679
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: User tracking mod

pricediscrimination:

Thanks for the reply. It's truly a great plugin and very useful. Wondering if anyone is experiencing a weird issue where if the customer has something in their cart, it shows that item listed on the right in every session's "User Shopping Cart" section...

Yes. It's a known issue. Have to try to match the cart info to the session. This is one area of who's online that needs to be split out from this module.

24 Feb 2015, 7:47 PM
#680
phil_s avatar

phil_s

New Zenner

Join Date:
Mar 2008
Posts:
49
Plugin Contributions:
0

Re: User tracking mod

I updated to 1.5.4 and reinstalled this and now I'm not being told where my visitors are coming from. Every Originating URL is showing as having come from one of my store pages with the only exception being traffic from Google.

I had posted a link to a special in one of the forums I subscribe to and when I went in and edited the link by adding src=wxyz.com, that showed up in the originating URL.

Has something changed since I used this in 1.3?