Rich-text Reply

Integrate with php symfony

Pezcoder 04-21-16

Integrate with php symfony

From what i read till now, optimizely is more of a client side way of swirching thing, showing & hinding the versions you want.
For my use case, i have a symfony framewok in frontend & using a rest api to get data. We have to release a new feature which is going to have different template(twig) & api calls too.. & i want to decide if a particular user belongs to variation1or 2 before rendering..
I m trying to use the rest apis optimizely provide but they are kind of disconnected.
I want to know these things:
1. This is not just a view related stuff so can optimizely do something in this.
2. Do i have to detect if a client is unique for that particular session & send the client id? ... But do opti.izely have something that can return the client's variation & can return just the variation so that i can display that particular variation to that paryicular client.
U have apia for craeting audience variations user clients but please tell me a way to interconnect them...
Thanks
Level 1

Re: Integrate with php symfony

Hi Pezcoder,

 

Thanks for posting your question here! Optimizely indeed works client-side to change code on your website for your visitors. You can get.

 

1. This is not just a view related stuff so can optimizely do something in this.

 

I'm not quite sure what you're looking for here. Optimizely can execute code client-side, so also change things there. But only client-side.

 

2. Do i have to detect if a client is unique for that particular session & send the client id? ... But do opti.izely have something that can return the client's variation & can return just the variation so that i can display that particular variation to that paryicular client.

U have apia for craeting audience variations user clients but please tell me a way to interconnect them...

 

I see you're not looking to use Optimizely to create the changes, but looking to create the changes yourself and then showing different visitors the different variations? You can use the bucket visitor JavaScript API call to bucket your visitors in a certain experiment. This buckets them manually into this experiment into a specific variation. You'll have to call this before the Optimizely snippet, or in your Project JavaScript. Then you can set the Traffic Allocation to 0% for the experiment to make sure that you only let in your manually bucketed visitors. And you set the rest (URL targeting, Audiences) up normally.

 

Please note that using bucketVisitor buckets a visitor in the experiment regardless of the targeting conditions, so please make sure you're only using it when you're really sure from your end that you want to bucket that visitor.

 

So in your case I'd add logic above the Optimizely snippet or the to check whether the cookie is set for the visitor, and bucket the visitor in the variation you want if that's the case.

 

Does this answer your questions?

 

Best wishes,

Nils