Can Optimizely run on hybrid mobile apps (Phonegap / Cordova)?
Are you aware of some integration of Optimizely in a PhoneGap/Cordova app?
Google and this forum does not seem to have any reference, so I guess this is not very common.
From the few hours I had to test Optimizely I can see the following possible difficulties to my use case:
- It seems that the website URL is verified by Optimizely. Hybrid apps run on localhost: would it work?
- How to create the experiments and variations without a publicly accessible page?
Any pointer would be highly appreciated, thanks!
Solved! Go to Solution.
PhoneGap is unfortunately something we don't support at the moment! Some of our users have tried using Optimizely and Adobe Test & Target in a PhoneGap app, and it didn't work out of the box for two main reasons:
PhoneGap doesn't support cookies natively, which is a huge issue for our bucketing logic. You'd need to use the localStorage API to persist data across app sessions and restarts.
You'd need to account for offline states. Optimizely for Web doesn't do a great job handling offline web applications – essentially the experiment just won't run if the snippet can't be downloaded.
I hope this is helpful. Let me know if you have any other question!
It's been a long time since this issue last came up. @_DerekHammond you mentioned: "not out of the box".
Does that mean there is a workaround? Is it because of the cookies? can't we just rely on localStorage?
Thanks in advance!
Hey, @simsim, thanks for the reply! By "not out of the box", I mean that one may potentially need to completely copy all the Optimizely cookies into localStorage for every interaction, then additionally parse the localStorage data on each load before the Optimizely snippet runs - just to start. From there, it may take even more work to bring this into parity with full web experiments. Because it would involve essentially gaming and rewriting parts of the Optimizely snippet (which may be updated with future product releases), this approach isn't recommended. I'm sorry I don't have an easier solution but hope that's helps clarify. Let me know if you have any other questions. Thanks!