javasegmentoptimizely

optimizely server side experiments tracking the events


I’m performing a server side experiment where our results are A/B tested on a small fraction of users before launching to everyone.We use optimizely sdk library for java .we have experiment setup in optimizely ui and we call activate method for that experiment and user id to get the variations .since this the server side setup , we don’t see the metrics like products added ,add to cart being tracked in optimizely ui . How to get those metrics logged in optimizely ui? Any suggestions will be helpful.


Solution

  • You need to specifically call Optimizely.track at the point where you have add to cart or purchase events. If those events are recorded server side, you could record it when the call is made to the server to update the cart. If the events are only persisted on the webpage, you would use the Optimizely JavaScript SDK to fire the track event in the browser when the user hits "add to cart". The two SDKs would use the same project ID since you are running the experiment across server side and client side. https://docs.developers.optimizely.com/full-stack/docs/track-events