Reputation: 77
I am using Google Analytics for AB testing. I recently did a test for using multiple variations for one page without using redirects from this article and it worked well.
I want to use this same test for the menu of my website. It is just some CSS changes and I am planning on using JQuery to change the class of the menu depending on the variation the user gets.
My main concern is whether this is possible to achieve. If I include the GA code to my layout code, should i have a condition to see if the menu is available for that page to run the test? Do I need to add the URL's for the other pages that have the menu? or Do I do my test similar to how the one in the article was like?
If anyone has done a test like this, some advice would be appreciated.
Upvotes: 0
Views: 127
Reputation: 43
Your questions:
If I include the GA code to my layout code, should i have a condition to see if the menu is available for that page to run the test?
Do I need to add the URL's for the other pages that have the menu?
or Do I do my test similar to how the one in the article was like?
Upvotes: 1
Reputation: 1529
Make sure you have equal possibility to display menu for both tested groups (Menu is available for all visitors) - Original variant - Changed menu variant
Create custom dimension in Google Analytics (session scope)
Use Math.random() to reach 50% probability for each variant. Dave this information into cookie and since this time, use this variant for this particular user all time the test is running
ga("set","dimension2","Variant B");
Change your MENU structure/design/behavior
ga("send","pageview")
If you want to capture specific behavior, set event listeners for particular points of your website to track them. Is very useful, if you name this events like:
Category: A/B
Action: Menu Click
Label: Subcategory Best Articles
In Google Analytics set up a conversion goal for your new EVENT (from step 8).
Use your new event and custom dimension to see performance of your experiments.
PS: If you do it for first time, test your mechanism by A/A test. It mean there are technically two variants with 100% same content, but all mechanisms on background are working. After this, run the test.
Upvotes: 0