TAG | User Tracking Interface
It’s mainly bug fix release. Update is STRONGLY recommended.
Changelog:
- Changed file name of includes/auto_loaders/config.utis.php.php to includes/auto_loaders/config.utis.php
- uti_install.sql missed some inserts
- Fix to: [DELETE FROM uti_attributes WHERE uti_row_id = ? AND name IN () ]
- UTI tables now use DB_PREFIX
You can download it from: Current version of UTI.
It seems that I’ve forgotten to add installation commands to the sql installation file and there are no options under ‘UTI Variables’ in Configuration Menu. To Go to Admin->Tools->Install SQL patches and execute following commands:
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order) VALUES(‘[Recent Products] Max recent products to show’, ‘UTI_RECENT_PRODUCTS_MAX’, ‘5′, ‘How many recent products should be displayed in sidebox?’, @group_id, 1);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order) VALUES(‘[Recent Searches] Max recent searches to show’, ‘UTI_RECENT_SEARCHES_MAX’, ‘5′, ‘How many recent search results should be displayed in sidebox?’,@group_id, 2);
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.
I’ve created User Tracking Interface (UTI) module for Zen Cart v1.3.8 which recognizes visitors (even if they are not logged in or don’t have account) and stores simple bits of information about them in database. You can use UTI to store such information as favorite currency of each visitor, recently viewed products by particular visitor or recently searched products. The best thing is that even if the visitor will leave Your site and will come back later UTI will recognize him/her and will set site to his/hers preferences.
You can test it Yourself on demo store here:
www.data-diggers.com/contribs/uti/demo-stores/with-uti/
How to test it
- View some products (4-6). The module will remember which items You viewed and will present them in sidebox.
- Search for some stuff like “mouse”, “unreal”, “mary”. The module will remember what You searched for and will present links to previous searches in sidebox.
- Change currency. The module will remember Your last currency and when You’ll be back next day/week/month the site will display with Your currency set.
- Close down Your browser and switch to different one. Visit above site again. The system will recognize You and adjust site to Your preferences.
What UTI is really for
Recently viewed products, recent search terms and user default currency are nice features, but they are just examples of use of UTI. UTI is simple class which developers can use to make user aware contributions. UTI takes care of recognizing users and storing/retrieving information about them in/from database. UTI attaches itself to Zen Cart on each request and creates $uti variable which developers can use to store simple information about visitors in database.
How to use UTI
UTI has very simple interface. Developer should use only two methods:
- $uti->get($attribute) - retrieves visitors value for $attribute from database
- $uti->set($attribute, $value) – store visitors value for $attribute in database
Developer does not have to worry about creating $uti object. $uti object will automatically recognize user and will retrieve all information about him from database.
What UTI can be used for
UTI is tool which can be used to create very simple contributions, for example:
- remembering language of given visitor. On his next visit site can be automatically switched to preferred language.
- presenting recommendations to visitor based on his previous purchases (even if visitor isn’t logged in).
- many more.
What I need from You
Please test above site and report any bugs. You can also install current version of UTI on Your site and report any bugs. You can download current version of UTI here:
www.data-diggers.com/contribs/uti/downloads/uti-current.zip
Installation instructions are in uti-current.zip
