Data-Diggers.com | Zen Cart Optimization, Performance and A/B Split Testing Modules for Zen Cart

Jul/09

10

User Tracking Interface v1.0 Released

UTI is tiny module that tracks visitors to Zen Cart site even if they aren’t logged in or even never created any account. It allows developers to keep in UTI memory small amounts of information about each visitor. For example, UTI can be used to store list of recently viewed products by any particular user. UTI will remember this information and when the visitor will come back to Zen Cart store week later UTI will recognize him and present list of previously viewed products.

UTI takes care of:

  • recognizing visitors – even if they never created any account
  • storing and retrieving information about them in database

UTI does not store any personal information in visitors browser.

How to use UTI

UTI is very simple class. It creates global $uti object that contains all information about current visitor. From developer point of view UTI class has four methods:

  • $uti->set($name, $value) - stores in database $value as value for attribute $name
  • $uti->get($name) – retrieves from database value for attribute $name. If there’s no such attribute method returns FALSE.
  • $uti->has($name) – checks if current $uti object has attribute $name set
  • $uti->delete($name) – deletes attribute.

$uti is automatically instantiated through auto_loaders/ mechanism. Developer can use it in any function/class since it’s global variable.

To show how easy it is to use UTI and what it can be used for I’ve created simple contributions that:

  • records and displays in sidebox list of products visitor viewed recently.
  • records and displays in sidebox list of searches visitor performed recently.
  • records when visitor changes currency and saves it as his/hers default. When visitor comes back to Zen Cart contribution automatically switches currency to most recent one.

Example contributions are included in UTI package. You can download it here: current version of UTI.

In next blog post I’ll describe how I’ve created one of those contributions using UTI.

RSS Feed

3 Comments for User Tracking Interface v1.0 Released

Future contributions for Zen Cart 1.3.8 - Data-Diggers.com | November 29, 2009 at 22:06

[...] to track user with cookie (even if he/she is not logged in). [Done, see:  User Tracking Interface] [...]

Raine | February 10, 2010 at 18:30

Just one thing to note: most of your modules, when you define table name you missed DB_PREFIX, this will cause the table names to not have prefix attached correctly

Author comment by admin | February 10, 2010 at 20:45

Thanks! I’ll keep that in mind and fix it in new releases.

Leave a comment!

Spam protection by WP Captcha-Free

<<

>>

Find it!

Theme Design by devolux.org