ECMS A/B Split Testing
From NewHaven Software Wiki
Malcolm lee (Talk | contribs) (Created page with 'If you want to do split testing in eCMS one of the cleanest ways to do it is with a promo or customer group code set via the URL. http://www.example.com/checkout_shipping/?p=pag…') |
|||
(13 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | If you want to do split testing in eCMS one of the cleanest ways to do it is with a promo or customer group code set via | + | If you want to do split testing in eCMS using [https://www.google.com/webmasters/tools/home?hl=en|Google Webmaster Tools] one of the cleanest ways to do it is with a promo or customer group code set via a [[ECMS URL Parameters|URL parameter]]. '''(To use a promo code you must first set one up in a customer group rule [[Promo_Codes|as described here].)''' The advantage of using this method is that it does not mess up any forms redirection and keeps the URLs the same, sans the snippet at the beginning setting the promo/customer group. |
+ | An example of the two URLs for use in [https://www.google.com/webmasters/tools/home?hl=en|Google Webmaster Tools] would be something similar to the two below: | ||
+ | <pre> | ||
http://www.example.com/checkout_shipping/?p=pageb | http://www.example.com/checkout_shipping/?p=pageb | ||
and | and | ||
http://www.example.com/checkout_shipping | http://www.example.com/checkout_shipping | ||
- | + | </pre> | |
- | Then in the checkout_shipping template just do a simple test: | + | Then in if you wanted to test variations in the the checkout_shipping template just do a simple test: |
- | + | <pre> | |
{if $promo.code == 'pageb'} | {if $promo.code == 'pageb'} | ||
Do this..... | Do this..... | ||
Line 12: | Line 14: | ||
Do something else..... | Do something else..... | ||
{/if} | {/if} | ||
- | + | </pre> | |
- | You will also need to | + | You will also need to add a test condition to the _meta.tpl, something like this: |
- | + | <pre> | |
{if $view == 'checkout_thanks'} | {if $view == 'checkout_thanks'} | ||
{literal} | {literal} | ||
Line 21: | Line 23: | ||
<!-- End of Google Website Optimizer Tracking Script --> | <!-- End of Google Website Optimizer Tracking Script --> | ||
{/literal} | {/literal} | ||
+ | --~~~~ | ||
{/if} | {/if} | ||
- | {if $view == 'checkout_shipping' && $promo.code == ' | + | {if $view == 'checkout_shipping' && $promo.code == 'pageb'} |
{literal} | {literal} | ||
<!-- Google Website Optimizer Tracking Script --> | <!-- Google Website Optimizer Tracking Script --> | ||
Line 38: | Line 41: | ||
{/literal} | {/literal} | ||
{/if} | {/if} | ||
- | + | </pre> | |
I tested this in Website Optimizer and it works. Two things to note: | I tested this in Website Optimizer and it works. Two things to note: | ||
- | * If you try to manually navigate to a checkout page you will be | + | * If you try to manually navigate to a checkout page you will be redirected to viewcart or the index page so you will have to manually upload the HTML for the pages for Google's validation service to work. Pretty trivial process and you would likely have to do this with any cart. |
- | redirected to viewcart or the index page so you will have to manually | + | |
- | upload the HTML for the pages for Google's validation service to work. | + | |
- | Pretty trivial process and you would likely have to do this with any | + | |
- | cart. | + | |
- | * If you set the promo code via the URL you may have this overwritten by | + | * If you set the promo code via the URL you may have this overwritten by a customer using a promo code. This could potentially skew your statistics a bit. There may be a way to compensate for this with proper setup in GWO. The other option is the use the customer group via URL feature. Similar to promo codes, ?c=CUSTGROUP. |
- | a customer using a promo code. This could potentially skew your | + | |
- | statistics a bit. There may be a way to compensate for this with proper | + | |
- | setup in GWO. The other option is the use the customer group via URL | + | == Newer Method (03/27/2013) == |
- | feature | + | You can use any generic URL parameter provided it's not already in use and then simply set a session var for the parameter. Then you can test against that var in your code by using <code>{$smarty.session.var_name}</code>. |
- | + | ||
- | + | This would be in your _top.tpl template: | |
- | + | <code><pre> | |
- | + | {if $smarty.get.ver} | |
- | + | {php} | |
+ | $_SESSION['version'] = $_GET['ver']; | ||
+ | {/php} | ||
+ | {/if} | ||
+ | |||
+ | <body class="{$smarty.session.version}"> | ||
+ | </pre></code> | ||
+ | |||
+ | And this could be used in your CSS: | ||
+ | |||
+ | <code><pre> | ||
+ | //Normal pages | ||
+ | .wrapper div.version-b { | ||
+ | display:none; | ||
+ | } | ||
+ | |||
+ | //To display the first div under the element .wrapper (just an example). | ||
+ | .version-b .wrapper > div { | ||
+ | display:none; | ||
+ | } | ||
+ | .version-b .wrapper > div.version-b { | ||
+ | display:block; | ||
+ | } | ||
+ | </pre></code> | ||
+ | |||
+ | Or a template: | ||
+ | |||
+ | <code><pre> | ||
+ | {if $smarty.session.version === 'version-b'} | ||
+ | ...do something | ||
+ | {else} | ||
+ | ...do something else | ||
+ | {/if} | ||
+ | </pre></code> | ||
+ | --[[User:Mboyanton|Malcolm Boyanton]] 15:19, 27 March 2013 (UTC) |
Current revision as of 15:19, 27 March 2013
If you want to do split testing in eCMS using Webmaster Tools one of the cleanest ways to do it is with a promo or customer group code set via a URL parameter. (To use a promo code you must first set one up in a customer group rule [[Promo_Codes|as described here].) The advantage of using this method is that it does not mess up any forms redirection and keeps the URLs the same, sans the snippet at the beginning setting the promo/customer group.
An example of the two URLs for use in Webmaster Tools would be something similar to the two below:
http://www.example.com/checkout_shipping/?p=pageb and http://www.example.com/checkout_shipping
Then in if you wanted to test variations in the the checkout_shipping template just do a simple test:
{if $promo.code == 'pageb'} Do this..... {else} Do something else..... {/if}
You will also need to add a test condition to the _meta.tpl, something like this:
{if $view == 'checkout_thanks'} {literal} <!-- Google Website Optimizer Tracking Script --> ....code for confirmation page..... <!-- End of Google Website Optimizer Tracking Script --> {/literal} --~~~~ {/if} {if $view == 'checkout_shipping' && $promo.code == 'pageb'} {literal} <!-- Google Website Optimizer Tracking Script --> .....Code for Page B...... <!-- End of Google Website Optimizer Tracking Script --> {/literal} {elseif $view == 'checkout_shipping'} {literal} <!-- Google Website Optimizer Control Script --> ....Code for default page..... <!-- End of Google Website Optimizer Tracking Script --> {/literal} {/if}
I tested this in Website Optimizer and it works. Two things to note:
- If you try to manually navigate to a checkout page you will be redirected to viewcart or the index page so you will have to manually upload the HTML for the pages for Google's validation service to work. Pretty trivial process and you would likely have to do this with any cart.
- If you set the promo code via the URL you may have this overwritten by a customer using a promo code. This could potentially skew your statistics a bit. There may be a way to compensate for this with proper setup in GWO. The other option is the use the customer group via URL feature. Similar to promo codes, ?c=CUSTGROUP.
Newer Method (03/27/2013)
You can use any generic URL parameter provided it's not already in use and then simply set a session var for the parameter. Then you can test against that var in your code by using {$smarty.session.var_name}
.
This would be in your _top.tpl template:
{if $smarty.get.ver}
{php}
$_SESSION['version'] = $_GET['ver'];
{/php}
{/if}
<body class="{$smarty.session.version}">
And this could be used in your CSS:
//Normal pages
.wrapper div.version-b {
display:none;
}
//To display the first div under the element .wrapper (just an example).
.version-b .wrapper > div {
display:none;
}
.version-b .wrapper > div.version-b {
display:block;
}
Or a template:
{if $smarty.session.version === 'version-b'}
...do something
{else}
...do something else
{/if}
--Malcolm Boyanton 15:19, 27 March 2013 (UTC)