Random Sorting and A/B Split Testing in MODX

Aug 2, 2011

Quick note: when using snippets like getResources and FileLister (yes, GR uses Hungarian notation thing and FL does not - don't ask me why) you can add: &sortBy=`RAND()` as a parameter to randomize the output, oftentimes, even if it's not in the documentation for the snippet!

It works with some other snippets too, I just can't remember them all at the moment. I also don't know the behind-the-scenes details of why this works, but I'm glad it does :P

If you know something I don't know, why don't you comment below? :)

**UPDATE: getResources

Just in case you haven't seen the getResources official documentation the property is specified: &sortby=`RAND()` with lowercase "b" in "sortby". I know it seems knit-picky to post an update about this but the property key is snippet-specific and won't work if you use the wrong one :)

***ANOTHER UPDATE: Easy A/B Split Testing in MODX!

You can call the FirstChildRedirect snippet with &sortBy=`RAND()` to get Random redirection within the container. RandomChildRedirect. Fun!!! This is good for split testing, for example, to see which of a set of landing pages performs better :P You'd have to of course perform some kind of tracking and collect analytics on the target pages.

***UPDATE[Sept/14]: Other A/B Testing Options for MODX