Rich-text Reply

Multi-goal experiment, how to track pageviews of only people who are bucketed into the experiment?

mkstvnsn 11-01-16

Multi-goal experiment, how to track pageviews of only people who are bucketed into the experiment?

I know that pageviews is a goal, but how do I set up Optimizely so it only tracks pageviews of people that are bucketed into the experiment? 

Level 2

robertchan 11-02-16
 

Re: Multi-goal experiment, how to track pageviews of only people who are bucketed into the experimen

I would suggest looking at and adjusting the following code to suit your needs:

 

var doNotSendPageviewTracking = true;
window['optimizely'] = window['optimizely'] || [];
window['optimizely'].push(["bucketVisitor", experimentId, variationId, doNotSendPageviewTracking]);

This is from https://developers.optimizely.com/classic/javascript/reference/index.html under the Bucket Visitor section.

Robert Chan

Experimentation Hero
mkstvnsn 11-02-16
 

Re: Multi-goal experiment, how to track pageviews of only people who are bucketed into the experimen

Thanks, Robert. Always very helpful. I'm a little confused on how this relates, though. I have a web page that anyone can access, but I don't want Optimizely to count any pageviews except for people that are in the experiment.

That code appears to manually assign users to a variation in an experiment which is useful, but I don't see how I can use that for my purpose?
Level 2
robertchan 11-03-16
 

Re: Multi-goal experiment, how to track pageviews of only people who are bucketed into the experimen

Anytime, and my apologies as I've provided information for an experiment's variant. It appears that Optimizely tracks pageview events for any page the Optimizely snippet is installed on in an experiment's raw data form. To counter this, I would say one approach could be to drop a cookie with a script similar to what I provided you in another response, and have that cookie exist in each experiment variant. Next, write a condition that says that if a user has this cookie (which therefore means they're in your experiment), push an Optimizely event goal for every visit. Essentially what you're doing is creating a cookie counter. Your counter starts at 0 and a cookie is dropped then. For every visit, that counter increases, but instead of an actual counter, you'll be pushing your conversion as a custom goal in Optimizely. Obviously there are implications such as a user clearing their cookies, etc. But this is the most straightforward approach. You can see an example of a cookie counter here:

http://www.htmlgoodies.com/legacy/beyond/javascript/cookiecountexplanation.html

Otherwise, you can also do an AJAX call for every visit.
Robert Chan

Experimentation Hero