- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Logged and unlogged users to view same variation
Logged and unlogged users to view same variation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
We are looking to display a variation of a particular page to half the users whether logged into their account or not. However, logged in users view this page at a different URL than unlogged users. Also the buttons do different things on the logged vs. unlogged versions of the page. The issue with this is, we don't want an unlogged user to see the original view and then see the variation after they either log in or sign up, given that there would be a 50% chance of this happening. After some time researching, it looks like doing a Multipage experiment would be the answer to this, where we can include the logged and unlogged pages along with the variations of each. However, I'd like to know if is there another approach to this while keeping the experiment type as an A/B test. Can anyone make a suggestion? I hope what I've explained makes sense! Thanks.
Re: Logged and unlogged users to view same variation
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
If I'm undetstanding correctly:
URL1 - Anonymous users
-- Variation A
-- Variation B
URL2 - Remembered/Authenticated users
-- Variation A
-- Variation B
Your concern is that users seeing "URL1 Variation A" are switched to variation B when they log in?
Solution: This is an A/B Test with two URLs for targeting and two variations.
-- Inside Variation A: do nothing, because they see the current content.
-- Inside Variation B: place code that alters both URL1 and URL2 (whichever URL the user happens to be on)
By creating this as a single experiment that runs on both URLs, you can rest assured that users will not switch between variations when they log in.
Since the guest vs logged in users see different URLs, we can use that to tell Optimizely which code to run on each specific page. (This can be any element that distinguishes the two pages from each other, but for this example, URL works nicely.)
For this example, let's presume your URLs are like:
https://www.mysite.com/account/guestUsers
https://www.mysite.com/account/loggedInUsers
To accomplish Variation B, your code would look like this:
try { if (window.location.pathname == "/account/guestUsers") { //They are NOT logged in, alter the guest page } else { //They must be logged in, alter the logged in page } } catch(e) { }
edit: removed [code] tag and used the "insert code" button
Re: Logged and unlogged users to view same variation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report

Re: Logged and unlogged users to view same variation
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Thanks so much, this has been a huge help!