Optimizely Web to change API call within react component
Here is what I'm trying to create an experiment on Optimizely Web.
Homepage search loads to a JSP which will render a react component to render the result of the page.
Would I be able to change the end point of the API which I called within the react component?
Is this something doable within optimizely web or I'm better off to do it through Full Stack?
It sounds like you want to alter script execution within a file so this would be a Fullstack use case.
Some options that might work if Full Stack is not an option for you:
You could have Optimizely set a window scoped variable
window.optimizelyUseNewSearchEndpoint = true
With that, based on timing, your DEVs might be able to alter the Search Results page so that it - based on the existence and value of that new variable - uses the current react component with the current endpoint vs a new component that uses the new endpoint (or something similar).
If the issue is that the Search Results page loads with the component already predetermined server-side, perhaps IT could use that variable to alter the URL of the Search Results page to include a query string parameter which the JSP recognizes as instructions to load the new component instead of the current one.
Analytics and Testing Guru