Optimizely Web Experimentation on Single Page Applications

 


Introduction
Most of the modern web applications are built as Single Page applications (SPA) which provides a quick and smooth experience to the end user without causing full refresh of the pages. However this dynamic nature of the applications does pose some challenges when it comes to personalization and experimentation.

Optimizley Web Experimentation tackle's this challenge via activation triggers and conditions. This basically helps indicate when the Web Page is Ready for Optimization / Personalization. These triggers ensure the experiments run at the right time and on the correct context.

In this bog, we will quote some real use cases in order to understand each trigger type. This would help developers / marketers or product owners in choosing the right trigger for your scenario.

  
Activation Triggers

  • Immediate
    • Scenario
      • E.g. Home page with a banner and other static content
    • Trigger Point
      • Optimizely snippet loads
    • Suitable for ?
      • Landing pages
  • URL Change
    • Scenario
      • E.g. Navigating from User Profile to Billing History
    • Trigger Point
      • On any change of the URL 
    • Suitable for ?
      • SPAs which are having Client Routing 
  • DOM Change
    • Scenario
      • A user selects a service type from Contact us page and form fields dynamically appear based on the service type selected 
    • Trigger Point
      • Any Change to DOM
    • Suitable for ?
      • Dynamic rendering
  • Callback
    • Scenario
      • After getting data from API for a personalized page
    • Trigger Point
      • When Javasript calls activate()
    • Suitable for ?
      • Asynchronous calls
  • Polling
    • Scenario
      • Waiting for Pay now CTA button to appear after the bill data loads
    • Trigger Point
      • Every 50 ms until the condition is true
    • Suitable for ?
      • Slow loading or third party widgets
  • Manual
    • Scenario
      • Multi step request flow 
    • Trigger Point
      • Push activation via API
    • Suitable for ?
      • Fine grained control over activation timing 

Conditions

  • URL Match
    • current URL matches the Rule
  • Element is present
    • CSS selector is present in the DOM
  • Javascript Condition
    • Java script function returns true

Summary

Optimizley Web Experimentation has activation triggers and conditions that enable creating personalized experiences on dynamic SPAs. The activation scenarios mentioned here are specific however the core principles of choosing the right activation trigger based on the use case would remain same across verticals.  

I hope you had a great learning experience .

Comments