You are here:  » Randomising the order of same price merchants


Randomising the order of same price merchants

Submitted by support on Sat, 2014-06-14 12:16 in

Hi everyone,

Just wanted to share something that I'm trying out on my own sites; which is to randomise the order in which the same lowest price merchants are displayed on product pages. I've implemented it on a single product page on the demo site and the effect can be seen on the following page:

http://www.webpricecheck.co.uk/product/Panasonic-TX-65AX802B.html

To implement this mod, look for the following code at line 59 of products.php:

  usort($rows,"cmp");

...and REPLACE with:

  usort($rows,"cmp");
  $cheapestPrice = $rows[0]["price"];
  $rows1 = array();
  $rows2 = array();
  foreach($rows as $row)
  {
    if ($row["price"]==$cheapestPrice)
    {
      $rows1[] = $row;
    }
    else
    {
      $rows2[] = $row;
    }
  }
  shuffle($rows1);
  $rows = array_merge($rows1,$rows2);

The theory being that it will even out the distribution of clicks in the first instance and then once stabilised EPC (Earnings Per Click) data can be used to feedback into a combination of this and the merchant priority mod, so that subsequently same price merchants can be randomised with weighting, automatically maximising the the profitability of every product page. I'll follow up with more details and code as the experiment develops.

Cheers,
David
--
PriceTapestry.com