Rich-text Reply

Javascript Code Execution Finish Event

guavapass 02-13-17

Javascript Code Execution Finish Event

Hi Optimizely,


I was wondering if there was a JS event that told me when the Optimizely experiment code finished running?


Similar to this thread, but that was asking for Initialization.


I'm looking for this callback because we have elements that are "visibility":"hidden" across multiple pages.


I would like to make those elements "visibility":"visible" after the experiment code finishes without having to include that line in every experiment.

Brian_Abad 02-15-17

Re: Javascript Code Execution Finish Event

Thanks for reaching out with your question. Optimizely variation code will run on the page when the identified element is present. Is the concern that the changes won't be made when the variation code is ran? Are you looking to change the visibility through Optimizely or natively on your site after Optimizely is done running?
Brian Abad
Manager, Technical Support
Customer Success
guavapass 02-16-17

Re: Javascript Code Execution Finish Event

Hi Brian,


Thanks for the reply.


  • The goal is to change visibility after Optimizely is done running (hence the callback).
  • We wanted it to run across all experiments

There was an experiment wide JS code section, but there's no all-experiments wide code section.


This caused us to write the natively on our side.