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

User tracking mod

Views: 183,649

Results 181 to 200 of 861
01 Dec 2006, 23:35
#181
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

User tracking mod

Woody:

The version uploaded is based on the original code contributed by Dave Kennelly at open-operations.com since that is the code both myself and Pinghead started with over a year ago.

The reason it is not based on the PingHead version of the code is because that version did not exist a year ago when we began making additions and improvements to the original contribution. We have, over the last year or so improved and added new features independently of the version of the code Pinghead had been working with.

I did difference the two versions recently when I was told of that version's existance and although they are very different (our version is form based, uses POST to specify a selectable date range rather than just using a fixed GET date, improved database schema, etc.) I could detect very few distinguishable feature improvements between the two because as it turns out we both probably made many of the same bug fixes and feature improvements during that time period.

As I've said previously though, if there is something I missed in the previous version that is important and doesn't exist in this version I'll try to add it, just let me know?

Jeff

02 Dec 2006, 00:13
#182
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

Thanks for repairing your UT so those heading titles show up. Much better. Wondering if you could remove the category title from the product page titles.

So instead of:

"TestCategory 1 TestProduct 1"

would be better if we should see:

"TestProduct 1".

Just my opinion but easier to digest the UT info at a glance if just the product name was displayed. (Hint: That's how it is in the latest pinghead version).

Another questions although this is not really just a UT question.

The default heading_title define for the index page is " Congratulations! You have successfully installed your Zen Cart...".

So that does not display I've edited and removed from /includes/languages/english/index.php

Line #51 : define('HEADING_TITLE', 'Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution.');

Line #55 : define('HEADING_TITLE', 'Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution.'); 

So instead I have:

define('HEADING_TITLE', '');

In this case do you have any suggestions on how to make it so the UT log displays "index" or something relevant instead of a completely blank field when logging clicks on the home page?

If URL =
/shop/index.php
-or-
/shop/index.php?main_page=index
then heading_title = "index"

or something like that.

Woody

02 Dec 2006, 00:29
#183
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

Jeff:

BTW it appears that your UT version runs quite a bit faster than previous versions. It may have something to do with running your UT on v.1.36 versus running older UT on a v.1.27 shop. But running on the same server right now I am noticing a larger performance diff. A more honest comparison will have to wait for the new shop to go love and for the UT table to fill up to appx same number of entries as the current shop. Thought you would want to know. Good work!

Woody

02 Dec 2006, 02:31
#184
john95051 avatar

john95051

New Zenner

Join Date:
Jun 2005
Posts:
34
Plugin Contributions:
0

Re: User tracking mod

Need help here.
I have admin_profile installed on zc 1.36 and just installed this user_track MOD. Somehow I do not see any thing under User tracking config. I have been read through all 19 pages and seems can't find answer. Any clue?

02 Dec 2006, 23:12
#185
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

john95051:

Need help here.
I have admin_profile installed on zc 1.36 and just installed this user_track MOD. Somehow I do not see any thing under User tracking config. I have been read through all 19 pages and seems can't find answer. Any clue?

Which admin menu are you seeing "User tracking Config"? Configuration or Tools?

Look in an optional folder bundled with Admin Profiles. Apply that fix. Then follow a_berezin's workaround in his last post in this thread. That fixed it for me.

Woody

04 Dec 2006, 20:31
#186
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: User tracking mod

Woody:

I have made the category output optional via a configuration switch now in the archive version posted previously in this thread. To edit an existing version to add this switch, follow the below instructions:

In the file includes/functions/extra_functions/user_tracking.php

Locate the line which says:

		if ($_GET['cPath']) {

And replace this line with:

		if ($_GET['cPath'] && ZEN_CONFIG_SHOW_USER_TRACKING_CATEGORY == 'true') {   // JTD:12/04/06 - Woody feature request

Then execute the following in the patch tool:

INSERT INTO configuration VALUES ('', 'User Tracking (Show Product Category when tracking product clicks)', 'ZEN_CONFIG_SHOW_USER_TRACKING_CATEGORY', 'true', 'Show Product Category when tracking product clicks', 999, 60, '2006-12-05 11:19:26', '2006-12-05 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');

The category name is still 'On' by default but now you can turn it 'Off' in the User Tracking Config settings.

As for what I would suggest on the home page, try this:

In the file includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php

Find:

<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

Replace with:

<h1 id="indexDefaultHeading"></h1>

Then in the file includes/languages/english/YOUR_TEMPLATE/index.php

define('HEADING_TITLE','Home Page');

or whatever you want the listing output to indicate.

The reason this version runs much faster than previous versions is that we have eliminated the call to gethostbyaddress() that was made for each ip address during the report listing. This produced extreme overhead since this call is effectively a DNS server query for each and every address and instead added the resolved host name to the record itself, since we already have that for each connection.

Hope this helps!
Jeff

08 Dec 2006, 23:25
#187
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

As for what I would suggest on the home page, try this:

In the file includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php

Find:

<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1> ``` > > Replace with: > ``` <h1 id="indexDefaultHeading"></h1> ``` > > Then in the file includes/languages/english/YOUR_TEMPLATE/index.php > ``` define('HEADING_TITLE','Home Page'); ``` > or whatever you want the listing output to indicate.

I'm just "testing" the UT mod update on fresh 1.36 install. For some reason the default ZC 1.36 HEADING_TITLE below was not appearing in User Tracking log when the home page was navigated to. As reported would kust show up blank.

define('HEADING_TITLE', 'Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution.');

So I just edited the define to something short and it now shows up fine in the UT log. Go figure.

I do appreciate the alternative recommends.

Woody

09 Dec 2006, 02:14
#188
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

Jeff-

Couple items for the UT wishlist:

  1. Although there is plenty of white space before the right edge of the table/grid, the URL's in the UT log are prematurely wrapping to a second line. For example:

/mytestshopcart/index.php?main_page=inde
x&cPath=1

  1. Thanks for the new option in configuration to disable displaying the category title for product pages. However that fix causes blank titles to display when navigating the top level category and subcategory product listing pages.

Maybe test to see if URL is a product_info page. If so then don't display the category title. But if not a product_info page then display the category title.

Or something like that ;-)

Thanks,
Woody

09 Dec 2006, 03:59
#189
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

Woodymon:

  1. Although there is plenty of white space before the right edge of the table/grid, the URL's in the UT log are prematurely wrapping to a second line. For example:

Discovered 40 characters are allowed per line before a break tag is inserted.

In /admin/user_tracking.php
On line appx line 371

Change the 40 to 50 or whatever number of characters you prefer ...

<td class="dataTableContent" width=100% align="left"><a href="<?php echo $pu['value']; ?>" target="_new"><?php echo chunk_split($pu['value'],40,"<br>"); ?></a></td>

But I then tried removing the break:

<td class="dataTableContent" width=100% align="left"><a href="<?php echo $pu['value']; ?>" target="_new"><?php echo $pu['value']; ?></a></td>

Removing the hard break allows each log entry to display on one line. I do like this better.

But if your URL's are very long (e.g. if you have many levels of product subcategories, or if you are tracking admin logins w/ session id's, or are using SEO URL's) then you will likely often see a horizontal scrollbar at the bottom of your browser window, if you make this change. Your choice.

-Woody

23 Dec 2006, 16:13
#190
inksale avatar

inksale

Zen Follower

Join Date:
Jan 2005
Location:
Gold Country CA
Posts:
265
Plugin Contributions:
0

Re: User tracking mod

1.3.6.1
I just tried to install and am getting an sql error. I dropped the table several times and tried to install the patch via both Myphp and the Zen tool with the same result.

Get the same error on 2 sites. Both are 1.3.6 zen and 1.3.6.1 of the mod.

I will also assume this is the reason there is no options under cinfig for this mod.

SQL query:

INSERT INTO configuration_group( configuration_group_id , configuration_group_title , configuration_group_description , sort_order , visible )
VALUES ( 999, 'User Tracking Config', 'User Tracking', 31, 1 ) ;

MySQL said: Documentation
#1062 - Duplicate entry '999' for key 1

Im a database dummy and need a little guidance as to whether its an error in the supplied sql or if its me.

24 Dec 2006, 10:00
#191
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: User tracking mod

inksale:

1.3.6.1
I just tried to install and am getting an sql error. I dropped the table several times and tried to install the patch via both Myphp and the Zen tool with the same result.

Get the same error on 2 sites. Both are 1.3.6 zen and 1.3.6.1 of the mod.

I will also assume this is the reason there is no options under cinfig for this mod.

SQL query:

INSERT INTO configuration_group( configuration_group_id , configuration_group_title , configuration_group_description , sort_order , visible )
VALUES ( 999, 'User Tracking Config', 'User Tracking', 31, 1 ) ;

MySQL said: Documentation
#1062 - Duplicate entry '999' for key 1

Im a database dummy and need a little guidance as to whether its an error in the supplied sql or if its me.
I'm in the same club as you when it comes to databases :D but I vaguely remember coming across this issue somewhere in the old archives.

I think another mod you have installed is already using 999. Possibly the old Admin Levels? I know there are issues between those two if you are using the olds version.

It had something to do with the way the original User Tracking Code was written.

Please don't quote me on this! As nobody else has replied yet I thought I may as well post as it gives you something to go on.

24 Dec 2006, 12:47
#192
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: User tracking mod

Use this sql-path to install user tracking

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(128) 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(254) NOT NULL default '',
  referer_url varchar(254) NOT NULL default '',
  page_desc varchar(64) NOT NULL default '',
  KEY session_id (session_id),
  KEY time_entry (time_entry)
) TYPE=MyISAM;

SET @t4=0;
SELECT (@t4:=configuration_group_id) as t4 
FROM configuration_group
WHERE configuration_group_title= 'User Tracking Configuration';
DELETE FROM configuration WHERE configuration_group_id = @t4;
DELETE FROM configuration_group WHERE configuration_group_id = @t4;

INSERT INTO configuration_group VALUES (NULL, 'User Tracking Configuration', 'Set User Tracking Options', '1', '1');
UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

SET @t4=0;
SELECT (@t4:=configuration_group_id) as t4 
FROM configuration_group
WHERE configuration_group_title= 'User Tracking';

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 (NULL, 'User Tracking Visitors', 'ZEN_CONFIG_USER_TRACKING', 'true', 'Check the Customers/Guests behaviour? (each click will be recorded)', @t4, 1, now(), now(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
(NULL, 'User Tracking (ADMIN)', 'ADMIN_CONFIG_USER_TRACKING', 'true', 'Check the ADMINs behaviour? (each click will be recorded)', @t4, 2, now(), now(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
(NULL, 'User Tracking (exclude IP-Addresses)', 'CONFIG_USER_TRACKING_EXCLUDED', 'your IPs', 'Do NOT record these IP Addresses<br />(like webmaster/owners/company IPs)<br /><br />Examples:<br />192.168.1.1<br />192.168.1.0/255.255.255.0<br />192.168.1.0/24<br /><br />Or any combination of these separated with a comma:<br />192.168.1.1<b>,</b>192.168.2.0/255.255.255.0<b>,</b>192.168.3.0/24<b>,</b>192.168.1.2<br /><br />', @t4, 10, now(), now(), NULL, NULL),
(NULL, '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 your space !', @t4, 15, now(), now(), NULL, NULL),
(NULL, 'User Tracking (your favorite WHOIS URL)', 'USER_TRACKING_WHOIS_URL', 'http://www.dnsstuff.com/tools/whois.ch?ip=', 'Enter your favorite WHOIS tracking site<br />(the IP will follow automatically after this url)', @t4, 50, now(), now(), NULL, NULL),
(NULL, 'User Tracking (HostLookup)', 'CONFIG_USER_TRACKING_HOST_LOOKUP', 'true', 'Check the hostname of each IP address? (may cause slower display of UT data)', @t4, 20, now(), now(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),');
25 Dec 2006, 01:55
#193
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: User tracking mod

The sql is written to be used in the patch tool only. You would need to edit the sql and add the table prefix you are using to execute in PHPMyAdmin. The error you are seeing is probably okay as this would happen if the configuration group already exists which indicates you execute the sql twice.

You should see the config options under the Configuration menu. You didn't say if everything else is working so I'll assume it is working okay for you? Let us know if not and we will try to help?

Happy holidays!
Jeff

25 Dec 2006, 03:05
#194
inksale avatar

inksale

Zen Follower

Join Date:
Jan 2005
Location:
Gold Country CA
Posts:
265
Plugin Contributions:
0

Re: User tracking mod

I used the SQL listed above and did not get any installation errors, however, it is still not working.

With the original SQL as well as this new one the configuration tool has no options to choose from.

On the user tracking page I am now getting this message.

1054 Unknown column 'customers_host_address' in 'field list'
in:
[select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, page_desc, session_id, referer_url, customers_host_address from user_tracking where time_entry > 1166936400 and time_entry < 1167022800 order by time_last_click desc]
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.

25 Dec 2006, 03:16
#195
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: User tracking mod

It appears that you have an older version of the user_tracking table and a newer version of the user tracking code installed. Please download the user tracking contrib again and execute the SQL for creating the user_tracking table which looks like:

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 ''
) TYPE=MyISAM;

This should correct the problem. Let us know if not?

Good Luck!
Jeff

25 Dec 2006, 04:43
#196
inksale avatar

inksale

Zen Follower

Join Date:
Jan 2005
Location:
Gold Country CA
Posts:
265
Plugin Contributions:
0

Re: User tracking mod

Just to keep this straight,
I dropped the table I had installed,
DL the contribution
Re-installed all the files by over righting them.
Installed the SQL included with the contribution.

The included SQL still gave me the original errors and there are no options in the config.

I dropped the table and reinstalled using the SQL listed above By Jeff.

The tracking now works but there are still no options in the configuration tool.

25 Dec 2006, 11:54
#197
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: User tracking mod

That is very odd that you would get the same SQL error (I assume you mean duplicate key 999) since the SQL if executed properly deletes this key?

DELETE FROM configuration where configuration_group_id = '999';

Can you clarify this?

Also, when you say:

still no options in the configuration tool

Are you saying the Configuration->User Tracking Config menu choice is missing?

-or-

Do you mean when you select Configuration->User Tracking Config there are not six configuration switches listed?

Let me know and I will help?

Jeff

26 Dec 2006, 13:36
#198
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: User tracking mod

If you'd like a more "collision proof" approach, you could use:

DELETE FROM configuration where configuration_group_id = '999';
DELETE FROM configuration_group where configuration_group_id = '999';
DELETE FROM configuration_group where configuration_group_title like '%User Tracking%';
DELETE FROM configuration where configuration_title like '%User Tracking%';
INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('', 'User Tracking Config', 'User Tracking', 31, 1);

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

INSERT INTO configuration VALUES ('', 'User Tracking (ADMIN)', 'ADMIN_CONFIG_USER_TRACKING', 'true', 'Check the ADMINs behaviour ? (each click will be recorded)', @gid, 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 ('', 'User Tracking (exclude this IP-Address)', 'CONFIG_USER_TRACKING_EXCLUDED', 'your IP', 'Do NOT record this IP Address<br>(like webmaster/owners/Beta-testers)', @gid, 10, '2003-03-04 23:08:38', '2003-02-09 21:20:07', NULL, NULL);
INSERT INTO configuration 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 !', @gid, 15, '2003-03-03 11:19:13', '2003-02-09 21:20:07', NULL, NULL);
INSERT INTO configuration 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)', @gid, 50, '2003-03-03 11:19:13', '2003-03-11 11:40:01', NULL, NULL);
INSERT INTO configuration VALUES ('', 'User Tracking Visitors', 'ZEN_CONFIG_USER_TRACKING', 'true', 'Check the Customers/Guests behaviour ? (each click will be recorded)', @gid, 1, '2003-03-03 11:19:26', '2003-02-09 21:20:07', NULL, 'zen_cfg_select_option(array(''true'', ''false''),');

That will actually let the database decide on the next Configuration Group ID number, then copy that number to a variable "gid" and use that in place of hardcoding 999.

26 Dec 2006, 13:55
#199
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: User tracking mod

Cancel that. It looks like UserTracking code uses a hardcoded 999 for the user_tracking_config.php file. You would need to change a lot of the hardcoding in the php code to set this variable properly.

26 Dec 2006, 14:42
#200
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

@inksale: I had the same/similar issues as you report (I reported my solutions previously in the thread).

Originally the mod was designed to display "User Tracking Configuration" under Configuration menu. However during the later development history for the mod, the SQL was revised to display BOTH "User Tracking" and "User Tracking Configuration" under the Tools menus, which I think is the cause of many issues, with those who have installed a previous version and with thosw who have installed Admin Profiles mod.

Note that the Admin Profiles mod (from Kuroi) plays funny with User Tracking (or vice versa). In Kuroi's latest versions of Admin Profiles he provides some patch code and instructions to install to help if you have Admin Profiles installed. But I found that workaround did not solve my issue completely.

Then DrByte posted to this thread some work-arounds for the User Tracking Configuration menu issue, but that too was not a complete solution for me as I still had some issues of the User Tracking Configuration menu item sometimes not displaying, depending on which admin menu page I was viewing (dynamic disappearing ghost menus).

After all that my solution was to install the SQL patch from Andrew (a_berezin). The result of that is "User Tracking Configuration" correctly displays under the "Configuration" menu, just as the original User Tracking mod was designed to do. And most importantly all the menu items correctly show up fine on the User Tracking Configuration page.

Also be sure to edit your Admin Profiles "permissions" to allow display of the "User Tracking Configuration" menu items for whichever admin user you want the menu displayed.

P.S. You might want to also check out the Admin Profiles support thread. I believe there was some discussion of this issue there also.

Woody