If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / User tracking mod

User tracking mod

Started by pinghead on 10 May 2006, 12:06 PM · Views: 184,890

Results 161 to 180 of 861
29 Nov 2006, 5:09 PM
#161
jeffd avatar

jeffd

Totally Zenned

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

User tracking mod

With regard to the behavior changes that cause the tracking data to fail to change session id when the admin, logged in as a user, logs off...

I have found a way to support this with some stipulations:

  1. This probably won't work with a shared certificate
  2. It assumes you are using SESSION_RECREATE == 'True'

To implement this change, edit the file includes/modules/pages/logoff/header_php.php

Locate the line that says:

  zen_session_destroy();

and just before this line add:

  if (SESSION_RECREATE == 'True') {
    zen_session_recreate();
  }

This will force the session_id to change at logoff and subsequently allow the user tracking data to show this in the report.

Hope this helps!

Jeff

30 Nov 2006, 2:26 PM
#162
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

This will force the session_id to change at logoff and subsequently allow the user tracking data to show this in the report.

Before I try this out would you be aware of any negative side effects that might be encountered? Any other Zen Cart functionality that might be impacted? Thanks,

Woody

30 Nov 2006, 3:34 PM
#163
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: User tracking mod

First off, thanks for updating!

Okay, I am a real novice at these things. This is my first install of the user tracking. I added the files and went to upload the sql and got the following errors:

Error: Cannot create table zen_user_tracking because it already exists
Error: Cannot execute because table zen_configuration does not exist. CHECK PREFIXES!

They are listed 3 times each in a row

Anyone know what I need to do? Should I have uploaded the sql first instead of last?


30 Nov 2006, 4:33 PM
#164
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

thebeveragegourmet:

First off, thanks for updating!

Okay, I am a real novice at these things. This is my first install of the user tracking. I added the files and went to upload the sql and got the following errors:

Error: Cannot create table zen_user_tracking because it already exists
Error: Cannot execute because table zen_configuration does not exist. CHECK PREFIXES!

They are listed 3 times each in a row

Anyone know what I need to do? Should I have uploaded the sql first instead of last?

Little birdie says hold off on updating UT. New version of UT coming very soon.

Sounds if you possibly ran the UT sql patch previously or at least more than once during your current install attempt (or UT was installed previously)?

It appears you do not have a prefix appended to your zen cart DB tables.

If you want to proceed installing the current version of UT it is easiest to re-run the patch via phpmyadmin. Depending on the verison of phpmyadmin you have installed the steps are as fiollows:

  1. back-up your DB ;-)
  2. open the UT sql patch file in a text editor and copy the entire file contents to your clipboard;
  3. launch phpmyadmin;
  4. select the shop database;
  5. click the SQL tab;
  6. click in the "run sql query" edit box and choose paste from the browser menu;
  7. click go.

If you see a success message then you are good. If you see errors post back to this thread. You will likely again see "Error: Cannot create table zen_user_tracking because it already exists" again which is no big deal. If you want, just drop the zen_user_tracking table using phpmyadmin and run the query again.

If using phpmyadmin you will not need to edit the sql patch file to add zen_ prefix to each table entry in the sql file (the sql patch tool built in to Zen Cart requires proper prefix appended to your named db tables).

Look for the following define in both of your configure files.
define('DB_PREFIX', '');

If you see it empty as above that indicates no prefix is assigned.

Woody

30 Nov 2006, 4:53 PM
#165
jeffd avatar

jeffd

Totally Zenned

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

Re: User tracking mod

thebeveragegourmet:

The latest version has the sql errors corrected, sorry about that! I think from your email you got the problems straightened out, but if not post problems here, tks.

Woody:

As far as I know there should be no problems with the proposed changes so long as the version of PHP you are using does not have issues with the recreate sessions code in ZC. I refined mine a bit referencing the post by dwno in the code suggestions forum http://www.zen-cart.com/forum/showthread.php?t=51744 but I doubt these changes have impact. I tested it here quite a bit under PHP 5.x and had no problems. All I can say is try it on a test store first.

The only caveat I saw was the admin logout from the user account is recorded under the admin session rather than the user session but this would be very difficult to fix so it will have to do.

I just now updated the archive at the previously posted link and uploaded the latest version to the ZC downloads area so it should be available there shortly or at the above link now.

Please let me know if you find any issues?

Thanks,
Jeff

30 Nov 2006, 5:58 PM
#166
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

The only caveat I saw was the admin logout from the user account is recorded under the admin session rather than the user session...

Thanks for the info and the update Jeff. Yes will test on test store (always) running PHP 4.4.

Can you explain the statement above? My head is still a little fogged up and not sure if I understand.

Woody

30 Nov 2006, 6:12 PM
#167
jeffd avatar

jeffd

Totally Zenned

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

Re: User tracking mod

When you as an admin, login as a user and then log out, the logout event is recored under the admin session that has just begun rather than under the user session that just ended. Does this make sense?

If you try a session or two I believe you will see clearly what I am indicating...

Jeff

30 Nov 2006, 8:38 PM
#168
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

When you as an admin, login as a user and then log out, the logout event is recored under the admin session that has just begun rather than under the user session that just ended. Does this make sense?

If you try a session or two I believe you will see clearly what I am indicating...

Hey Jeff-

Sorry if I was unclear and I don't mean to be a pest and none of these 'issues' I observe are hugely significant. I submitted my previous inquiry since the user tracking logging behavior which I understood was suppose to happen following the upgrade to the latest version of UT was not the behavior I was observing. Let me provide more detail...

Scenario: Running Firefox2, I am logged in as admin in one window with the user tracking page open.

In another window I am browsing the shop catalog as a guest. Then I log in to the shop with customer account and browse the catalog some more, and then log off from customer account, so I am back to the guest account. Then I navigate the catalog some more.

When I refresh user tracking in admin I observe that my admin menu navigations clicks display in their own single session under my admin account name which is good!

However both my guest clicks and logged in customer account navigation clicks show up together in another session listing (under the customer account login name). Even my clicks which occur after I logged out of the customer account (so I should be a guest) display under the logged in customer account name session.

Is this the behavior to be expected after the upgrade?

On another note the User Tracking log is not displaying the name of product pages. Instead UT shows a blank entry for the page name and the URL /shop/index.php?main_page=product_info&cPath=2&products_id=2 (for example). Is not the product name suppose to appear in UT for the page name?

And clicks on admin configuration menu entries shows HEADING_TITLE within user tracking. For example the URL /shop/admin/configuration.php?gID=10 shows with HEADING_TITLE as the page name. So in this instance unless I memorize the gID orders of the config menus I am out of luck with being able to quickly identify which config menu was navigated.

Also "User Tracking" displays as the page name within User Tracking when visiting some other admin pages. For example Tools > Email Welcome, shows "User Tracking" and the URL /shop/admin/user_tracking.php?time=1164873600&viewsession=5315f5f1f5e47
f398c863adf3b6f2993.

However most other admin pages are identified in User Tracking correctly. I am pretty sure the page names were displaying correctly with the previous User Tracking version (pinghead).

Again not major issues of the day. Just trying to provide some end-user/store-owner feedback which may assist in future mod development. And at the same time I'm attempting to find out if I have something misconfigured somewhere. "Operator error" is my middle name.

Woody

30 Nov 2006, 9:18 PM
#169
jeffd avatar

jeffd

Totally Zenned

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

Re: User tracking mod

Woody:

First let me clarify something... the newest version of the UT tool is no different than any previous version in they way which it logs. It simply writes out followed links to a db table based on session and since nothing in that area has ever changed there is no difference between the way the new version of the tool and any previous version logs clicks as I made no changes to the user_logging functions themselves.

That being said, any loging behavior changes are due to changes in Zencart code, not it UT code. Some minor changes were made in the way logout/timeout and handled and I suspect this is what you are seeing with regard to UT tracking. If in doubt here, revert to a previous version and see for yourself.

As far as product pages and names, the version of the code that I started with was probably not the latest version Pinghead uploaded but rather one about a year old so if these were features added in the last year this version would need to be merged with any newer version to gain these benefits as this version has never displayed this info. If you want to send me a version with that support as soon as I have time I will see about merging the two.

Thanks,
Jeff

30 Nov 2006, 10:54 PM
#170
m8trixdg avatar

m8trixdg

New Zenner

Join Date:
Nov 2006
Posts:
10
Plugin Contributions:
0

Re: User tracking mod

Hi 2 questions.
First: Has anyone ever used the Admin Control Mod with the User Tracking Mod?

When I enable aadmin access for an Admin User_Tracking_Control Edit Page has no name under Admin Control so when I check it off it does not stay checked.

Second: When I goto User Tracking it does not list any info except how many clicks there were in that period of time. No details... What am I missing?

Thanks

30 Nov 2006, 11:18 PM
#172
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

m8trixdg:

Hi 2 questions.
First: Has anyone ever used the Admin Control Mod with the User Tracking Mod?

When I enable aadmin access for an Admin User_Tracking_Control Edit Page has no name under Admin Control so when I check it off it does not stay checked.

See a_berezin's post previously in this thread (a week ago or so). His three step solution workaround repairs the admin menu issues when Admin Profiles and User Tracking are both installed.

Second: When I goto User Tracking it does not list any info except how many clicks there were in that period of time. No details... What am I missing?
Can you provide a screenshot? Should show much more that that. Sounds like some files were not uploaded. And you are certain you patched the database and followed the part in the readme where it says:

File Modifications: 2

add the following to the end of /includes/templates/ YOUR TEMPLATE /common/tpl_footer.php

<?php if (ZEN_CONFIG_USER_TRACKING == 'true') { zen_update_user_tracking(); } ?>

add if you want to track admin pages viewed add the following to the end of /admin/includes/footer.php

<?php if (ADMIN_CONFIG_USER_TRACKING == 'true') { zen_update_user_tracking(); } ?>

And in admin see Configuration > User Tracking Config to ensure settings are to your liking.

30 Nov 2006, 11:23 PM
#173
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

If in doubt here, revert to a previous version and see for yourself.

As far as product pages and names, the version of the code that I started with was probably not the latest version Pinghead uploaded but rather one about a year old so if these were features added in the last year this version would need to be merged with any newer version to gain these benefits as this version has never displayed this info. If you want to send me a version with that support as soon as I have time I will see about merging the two.

Yes I reverted back to pinghead's latest version (released 08-31-06) which is available via the downloads area.

Woody

1 Dec 2006, 1:14 AM
#174
m8trixdg avatar

m8trixdg

New Zenner

Join Date:
Nov 2006
Posts:
10
Plugin Contributions:
0

Re: User tracking mod

This what I get. It just lists the number of page visits, but I cant get anything else. I see all the DB entries and it seems fine.

I fixed the admin_profile issue by going into the database and adding the page to my admins profile automatically.

1 Dec 2006, 2:33 PM
#175
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: User tracking mod

I just got the user mod installed yesterday and go to see who was looking this morning. On the admin home page, the hit counter showed about 400 more hits than it did last evening. But when I go into tools/user tracking, it says that there have been 0 page views in the last 24 hours. Huh? I checked the config to make sure I had it set up correctly and it looks okay. Anyone know what I might need to do?

Thanks so much


1 Dec 2006, 2:38 PM
#176
jeffd avatar

jeffd

Totally Zenned

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

Re: User tracking mod

You didn't by chance forget this step from the readme did you?

File Modifications: 2

add the following to the end of /includes/templates/ YOUR TEMPLATE /common/tpl_footer.php

<?php if (ZEN_CONFIG_USER_TRACKING == 'true') { zen_update_user_tracking(); } ?>

add if you want to track admin pages viewed add the following to the end of /admin/includes/footer.php

<?php if (ADMIN_CONFIG_USER_TRACKING == 'true') { zen_update_user_tracking(); } ?>

Or perhaps you modified the wrong footer file(s)...

That's about the only thing I can think of that would keep the logging from occuring. Let me know?

Jeff

1 Dec 2006, 3:33 PM
#177
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: User tracking mod

I bet that's it! THANKS


1 Dec 2006, 3:52 PM
#178
jeffd avatar

jeffd

Totally Zenned

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

Re: User tracking mod

There is an updated version of User Tracking found here:


user_tracking.zip

This version now properly displays the product name when tracking a product page (as per Woody's report) and also now properly tracks page names on the admin side in all instances.

As these were minor changes I will probably wait until more major changes are added before uploading this version to the downloads area but you can access for now from the above link.

Please let me know if you find any issues?

Thanks,
Jeff

1 Dec 2006, 10:38 PM
#179
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

There is an updated version of User Tracking found here:


user_tracking.zip

Jeff-

Is your latest version based on the last version of pinghead's UT release as is available in the downloads area?m His last version was released Aug. 05, 2006 with a sql patch update released on Aug 31, 2006.

Author: PingHead
Version: 20060805
Zen Cart Version: v1.3.0
Update added on 08/31/2006

The reason I'm asking is because I'm wondering if all the functionality and improvements included pinghead's last few releases are also included in your most recent version. I see a few posts back you stated your current release was based on a previous Use Tracking mod version from a year ago. (But I am not sure why).

Thanks for the update.

Woody

1 Dec 2006, 11:26 PM
#180
woodymon avatar

woodymon

Totally Zenned

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

Re: User tracking mod

JeffD:

There is an updated version of User Tracking found here:


user_tracking.zip

Hi Jeff-

Just now installing your latest update for testing. When posting future UT "beta" or "micro" updates is it possible you could report which files are changed from previous version and if sql patch is required? Also including a version number in the zip archive filename, even if just appending b04 (for beta 04) would be helpful in not getting these updates mixed up. Pinghead was appending the date to his previous versions so that might be a good naming nomenclature to maintain (e.g. user_tracking_120106.zip or user_tracking_061201). Just some suggestions. ;-)

Woody