GuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Custom code and utility functions

This is the documentation for Performance Edge. If you'd like access, please reach out to your Optimizely account manager.

In Performance Edge, you can write arbitrary JavaScript and CSS that is executed for some or all variations of an experiment. Code executed for all variations is called Shared Code; per-variation code is called Variation Code. Custom code in Performance Edge works much like it does in Web.

Three things to be aware of when writing custom code for Performance Edge experiments:

  • jQuery: jQuery is not bundled in Performance Edge projects. If you wish to use jQuery in your custom code, you must ensure it is loaded on the page outside of Optimizely, above the

  • The JavaScript API: Unlike Web, whose JavaScript API is exposed via window.optimizely, Performance Edge uses window.optimizelyEdge. See the Performance Edge API Reference.

  • The availability of Optimizely-provided utility functions: In traditional Web experimentation, optimizely.get(‘utils’) provides access to utilities like waitForElement, observeSelector, poll, and waitUntil, all of which are documented here. On a page running Performance Edge a reduced set of utilities is available, on window.optimizelyEdge.get('utils'). The utilities available in Performance Edge are documented in the Performance Edge API Reference.