Closed Bug 1053817 Opened 10 years ago Closed 9 years ago

Figure out how to make Angular and Optimizely work together

Categories

(Webmaker Graveyard :: Metrics, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: adam, Assigned: adam)

References

Details

(Whiteboard: [metrics][Nov28])

As an initial problem, when I try to edit webmaker.org/signup in optimizely, it shows me the homepage.
The only reason I can think of off the top of my head is that it's not passing the path properly. Angular routes pages based on it ( https://github.com/mozilla/webmaker.org/blob/master/public/js/angular/app.js#L4-L72 )
I think there are some clues in here, but I'll investigate in more detail soon: http://community.optimizely.com/t5/Using-Optimizely/Optimizely-and-AngularJS/td-p/490
CC: Ricardo: just FYI re the test we're talking about for the homepage / footer.
Here's a bit more reading that might help, but it certainly makes it more fiddly to use Optimizely: https://jack.ofspades.com/angular-optimizely/

I've opened a support to ticket with them to see if they have any other ideas.
Depends on: 1054969
See Also: → 1054969
Had a detailed reply from Optimizely. Working with Angular is going to be more complex, but the initial display issue is just an x-frame setting: See Bug 1054969

I will add the notes about Angular in a subsequent comment.
"After that is fixed, there are some things with Angular I'd like to point out - primarily, you will most likely need to manually activate your experiments. This is because Angular.js allows you to bind data within your page dynamically without a new page load.

The issue with these kinds of technologies and Optimizely is that the Optimizely snippet needs to execute for your changes to show. By default Angular.js doesn't reload the page and Optimizely only executes once on the first page load. 

We suggest a couple of ways to get Optimizely to execute your variation code at the appropriate time.

Our recommended solution is to use our manual activation feature [https://help.optimizely.com/hc/en-us/articles/200040225-Activating-an-Optimizely-Experiment-dynamically-after-a-page-has-loaded]. Manual activation allows you to choose when Optimizely executes a particular experiment using an API call. This is especially helpful when you want to run an Optimizely experiment as the result of a user action like a click or a page action like moving from one step of a form to another.

Another workaround is to wrap your variation code in Optimizely with conditional logic or an interval. You can find a code sample for that technique here. [https://help.optimizely.com/hc/en-us/articles/200040635-Modifying-content-that-is-not-immediately-available]"
Whiteboard: [landingpages] [webmakersnippet] [aug22] → [metrics][Sep19]
* Still needed? Should we tackle this for [oct3]?
Whiteboard: [metrics][Sep19] → [metrics][oct3]
Yep, this is still needed. It's more for long-term value than any urgent tasks.

I have some other priorities for the next couple weeks and unpredictable availability so this might jump a couple of trains.
* The [oct3] train has now left the station. So please update the whiteboard with [oct17], or whatever train you're now planning to put this on. Thanks!
Whiteboard: [metrics][oct3] → [metrics][oct17]
* the [oct17] train has now left the station
* so please update with [oct31], [nov14], [nov28], etc.
* [oct17] has passed. Please update the whiteboard.
Whiteboard: [metrics][oct17] → [metrics][Nov14]
Whiteboard: [metrics][Nov14] → [metrics][Nov28]
See Also: → 1112204
We have a workaround for using Optimizely across multiple copies of an angular page. Let's not spend more time on this given the shift from Angular to React.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.