Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Tutorial for setting up A/B testing with Google Analytics?

Tutorial for setting up A/B testing with Google Analytics?

Hi, I just purchased the component and I was looking for a tutorial regarding A/B testing but did not find anything.

Is there any instruction available on how to set up a simple Template A vs Template B test (allocated randomly to each visitor but hopefully remembering what the same past visitor got to avoid confusion) with reporting through Google Analytics?

Thanks

genegun
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Tutorial for setting up A/B testing with Google Analytics?

Hi,

sorry that there is no tutorial for this.

Here's a quick rundown:

1 - put Google Analytics code into each template, with some variable or code which will indicate to GA which template is being used. Here's an example of an additional custom variable being added. This needs to go in the GA code directly after the _setAccount statement:

    _gaq.push(['_setCustomVar',
      1,
      'Template',
      'my_template_name'
   ]);

Obviously, you need to set a different name in each template so you can track this.

2 - In Chameleon, set up the 1st rule. In this rule, we will detect a cookie if it has been set, and change the template accordingly.
- set "detect session variable A" in the left column, then in the Succeed Action, select your 1st template from the dropdown.

3 - In Chameleon, set up the 2nd rule. In this rule, we will detect a cookie if it has been set to indicate the alternative template, and change the template accordingly.
- set "detect session variable B" in the left column, then in the Succeed Action, select your alternative template from the dropdown.

4 - In Chameleon, set up the 3rd rule. Here, use the random number generator to 50 if you want a 50/50 split.
In the Succeed action, "set permanent cookie A" and select the 1st template from the dropdown, then in the Fail action, "set permanent cookie B" and set the alternative template in the dropdown.


Finally, make sure that in rules 1 and 2, in the succeed action you have "stop processing", and in the fail action you have "continue to next rule".

So how does this work?

- client requests 1st page
- rule 1 is checked. Cookie A is not set, so Fail action is run. This simply continues to next rule.
- rule 2 is checked. Cookie B is not set, so Fail action is run. This simply continues to next rule.
- rule 3 is checked. A random number is generated with 50% probability. The rule then randomly succeeds or fails.
-- if it succeeds, cookie A is set and the first template is set
-- if it fails, cookie B is set and the alternative template is set.

- client requests next page
- rule 1 is checked. If cookie A had been set previously, then the 1st template is set, and the rule chain stops immediately.
- if cookie A had not been set, then rule 2 is checked, which looks for Cookie B. If this is found, then the alternative template is set and the rule chain stops immediately.


This may look like a lot of steps but it's all quite logical. It ensures that users only get the random thing done once, and the cookies ensure that they continue to get the same template on subsequent visits.
I'll leave the interpretation of the GA up to you!

Please don't hesitate to write back if you need more help with this.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Tutorial for setting up A/B testing with Google Analytics?

Thanks a lot for this detailed answer. I will try to implement this and report once this is done.

genegun
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Tutorial for setting up A/B testing with Google Analytics?

Hello,

is it possible to setup an A/B test based on different URLs and not on different templates?

I mean: divide all visitors that click on a link in two groups (50%). One group use the default page, other group is redirected to a different page?

Is this possible?

Thanks,
Mario

manburg6
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Tutorial for setting up A/B testing with Google Analytics?

Hi Mario,

That's a good question, but I think you need to think very carefully about what you are trying to achieve and how you will go about it. I'm not an A/B testing expert – all I can try to do is to help you set up Chameleon to do what you're setting out to do, if it makes sense.

How to organise the Google part of it: I am not sure, if the 2 groups are going to be redirected onto different URLs. I think from memory you can set up your JS to send Google different "events" for the different pages.
But for the general thing about setting up Chameleon to send people onto different pages randomly, and keep a track of which ones you are sending to where:

Rule 1: detect permanent cookie A. If found, send people to page 1
Rule 2: detect permanent cookie B. If found, send people to page 2
Rule 3: detect random probability of 50%. If found, set cookie A and send people to page 1. If not found, set cookie B and send people to page 2.

You could put your JS tracking code onto the pages themselves in some way (e.g. in an article), OR in each of the rules, use the succeed or fail actions to add the code to the page, so that the code used depends on which cookie has been set. Or put another couple of rules BEFORE the 3 rules above, that detect the cookies AND which page the person is on, and if they are cookied and on certain pages then add the JS to the page.

I hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Tutorial for setting up A/B testing with Google Analytics?

Thanks for the answer.

I wen more in deep with the issue and found a quick solution usin meta mod pro too.

Two different joomla pages can be tested quickly.
Two different menù link and a custom module pubblished in before head tag customizing template adding a new module position.
I use meta mod to pubblish module containing google script only in page to be tested. Google experimente do the rest of works.

Now I will try to test the experiment in Virtuemart 1.1.9 too. In this case meta mod in fundamental. I paste my post from virtuemart forum.

First of all I need two different pages for the same products. I believe this is not possible. So I create two different products (two different sku) related to same product and manage the quantity by myself.

Original product: pubblished in its own category
Test product: pubblished ander test category, test category NOT pubblished.

I this way "test product" is not available from stanradr virtuemart navigation.

Then I pubblish google experiment script in head using a custom module and template customization in header. In order to pubblish the script only in "original product" page I can use some free extension as: metamod.

Thanks,
Mario

manburg6
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Tutorial for setting up A/B testing with Google Analytics?

Hi, I'm not sure I followed all that exactly, but I'm very glad you found a way to do it, and that MetaMod helped!

Just 1 thing to note: you can use Chameleon to add JS to HEAD scripts, and that might be easier than using MetaMod to do it. But if MM works for you – great!

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10789
Newest User:
parus6
Members Online:
1
Guests Online:
167

Online: 
parus6

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked