Category Archive:

UTI v1.5 released

1

New version of User Tracking Interface (1.5) has been released.  Changes:

  • performance improvements
  • uti table size improvements
  • IP is stored as INT, not as VARCHAR(15)
  • few minor bug fixes
  • support for uti merge functions ( I’m going to write about this feature within few days)

UTI v1.5 has been tested with Zen Cart 1.3.8a but it should also work with newer versions. Update instructions for v1.1 users are included in .zip package.

Download UTI v1.5.

Posted in: UTI, Utils

Continue Reading

UTI 1.5 is coming.

0

User Tracking Interface version 1.5 will be released next week. There are few important bug fixes, some performance improvements and new features. In nutshell:

  • IP is no longer stored in database as VARCHAR(15) but as INT, so each UTI record takes less space
  • uti table prune is no longer triggered on catalog activity. Prune is triggered by admin activity and is executed only once per day.
  • some indexes on uti table might be changed
  • support for custom uti attributes merge functions (I’ll elaborate on it on UTI 1.5 release)

Continue Reading

How to create custom impression detection function for Randomized Tests

2

Randomized Tests version 1.3 introduces new feature – custom impression functions. It allows You to decide who and under what conditions participates in A/B split test. In this post I would like to show You how to create custom impression detection function and how to use it to speed up experiments.

The need for custom impression detection functions

Let’s assume that You want to change Your registration page. You hope that new version will ease process of registration and more customers will register/order. You want to include in experiment only those visitors that actually viewed ‘Register’ page and remove from experiment those visitors that never intended to register / make purchase and never visited ‘Register’ page. Why? Because You can get more accurate results more quickly. Let me show it to You on example.

Example

Let’s assume that Your site gets 1000 visits daily (excluding bots). Of those 1000 visitors only 100 intend to buy anything ( other visitors are just surfing, comparing prices or doing anything else – they are not customers). Those 100 visitors get to ‘Register’ page where You  already set up A/B split test with two versions of the page.  You know – from Google Analytics or anywhere else – that old version of the page (version A or control group) has  20% conversion rate. You expect new version of the page to have 40% conversion rate. How quickly will You know that the new page is better? Here’s comparison of default IDF vs custom IDF:

  • Default impression detection function (all visitors are included in the experiment)

Group Visitors Impressions Conversions Conv. Rate Duration
Group #A 500 500 10 2% 6.41 days
Group #B 500 500 20 4%
  • Custom impression detection function (impression occurs only when visitor views ‘Register’ page for the first time)

Group Visitors Impressions Conversions Conv. Rate Duration
Group #A 500 50 10 20% 5.66 days
Group #B 500 50 20 40%

As You can see from this simple example there’s 15% decrease in duration of experiment. In other scenarios improvement may be even better.

How to create IDF (Impression Detection Function)

Randomized Tests can make use of any function that:

  • is located in ‘includes/functions/extra_functions’ directory
  • ends with ‘_rt_idf’ string (e.g. my_custom_rt_idf())
  • takes five arguments in following order:
    • $experimentRowID – ID of row in rt_experiments table representing current experiment
    • $experimentID – ID of current experiment You created (e.g. ‘login_test’)
    • $groupRowID – ID of row in rt_experiments_groups table representing group to which customer has been assigned
    • $groupID – ID above group (e.g. ‘control_group’, ‘test_group’)
    • $newlyAssigned – TRUE if visitor has just been assigned to group (e.g. it’s his first visit to Your store)
  • returns:
    • TRUE – if impression occured
    • FALSE – otherwise

Ok, so let’s create such function and upload it to /includes/functions/extra_functions:

function visited_register_page_rt_idf($e_row_id, $eid, $g_row_id, $gid, $new) {
        global $uti;
        global $current_page_base;</p>
        if($current_page_base == ‘create_account’) {
                $flag = $uti->get(‘visited_create_account_page’);
                if($flag === FALSE || $flag == ‘FALSE’) {
                        $uti->set(‘visited_create_account_page’, ‘TRUE’);
                        return(TRUE);
                }
        }
        return(FALSE);
}

First, function checks if currently visited page is ‘create_account’ page – We want impression to occur only on registration form page (which in Zen Cart is ‘create_account’ page). Impression should occur only once per visitor so function checks using UTI if visitor already viewed ‘create_account’ page. If he didn’t function does two things:

  • saves information that visitor viewed ‘create_account’ page in UTI
  • return TRUE – impression occured

If visitor already visited ‘create_account’ page impression does not occur and function returns FALSE.

Now upload the function to includes/functions/extra_functions and create experiment that uses it to detect impression.

Modify ‘Create Account’ page

Let’s modify ‘Create Account’ page. We just want to test two versions of ‘Create Account’ page so I used ‘Standard Groupset’ (Admin->Tools->[RT] Groupsets) as groupset. Standard Groupset has two groups: control group (id ‘cg’) and test group (id ‘tg’).

if(!isset($exp) || $exp->groupID == ‘cg’) {
        // control group
        // display old ‘Create Account’ page
} else {
        // test group
        // display new version of ‘Create Account’ page
}

If visitor has been assigned to control group (‘cg’) old version of page is displayed. In other case new ‘Create Account’ page is used.

How to use IDF in experiment

Go to Admin->Tools-> [RT] Experiments page. Create new experiment as usually. In ‘Impression Detection Function‘ box paste name of Your impression detection function: ‘visited_create_account_page_rt_idf’  (without braces). Click on ‘Create’. That’s it!

Test that Your IDF works

Visit Your site and check that impression only occurs on first visit to ‘Create Account’ page.

That’s it. If anything isn’t clear please post comment.


Continue Reading

User Tracking Interface v1.1

8

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: UTI v1.1


Continue Reading

Bug in User Tracking Interface 1.0

0

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:

SELECT (@group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title LIKE ‘UTI Variables’;
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);
Posted in: UTI, Utils

Continue Reading

User Tracking Interface v1.0 Released

3

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.


Continue Reading

Need Testers For User Tracking Interface Module

0

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

  1. View some products (4-6). The module will remember which items You viewed and will present them in sidebox.
  2. 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.
  3. 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.
  4. 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


Continue Reading

Social Stuff

Donate

If You like Query Cache, Query Log or Randomized Tests please make a $5 donation.

Search the blog