Rich-text Reply

JS setDimensionValue for PHP REST API created dimensions

hemang 11-10-15

JS setDimensionValue for PHP REST API created dimensions

Hi 

 

 

I am using optimizely and it is working as per expectations 

 

I have  some questions 

 

 

1.Can I use setDimensionvalue javascript API function for the custom dimensions which are created using PHP REST API?

 

2.Can I create custom dimensions using Javascript API ?

 

 

 

Thanks

Hemang

 

 

 

 

Level 2

Re: JS setDimensionValue for PHP REST API created dimensions

Hi Hemang,

 

Can you give me some more information on where you're creating these custom dimensions? Is this a script of your own? If you'd like to push a value that is generated on your page as a dimension to Optimizely, in theory this should be possible using the setDimensionValue (see here), as long asthe value is generated before you're setting it in Optimizely.

 

If you're looking to create new dimensions using API calls, you should be able to do that using the REST API instead of the Javascript API, for example by using the create dimension REST API call.

 

Does this help you?


Best,
Nils

hemang 11-16-15
 

Re: JS setDimensionValue for PHP REST API created dimensions

Hi 

 

@Nils_van_Kleef

 

 

Thanks for your reply. 

 

 

I am using Optimizely's PHP wrapper class to create dimensions. It is working properly and creating dimension and I can see it on optimizely dashboard. Only problem is that I am not able to set value using JS API to that PHP created dimensions.  My complete process is as below 

 

1.Created a custom dimension called "ABC" by PHP REST API and passing parameters like name, description and client api name . 

 

2.I can see this dimension on optimizely dashboard 

 

3.Created a target audience using this custom dimension value condition. condition is that custom dimension "ABC" has value "DEF"

 

4.Now in my site header I called setDimesion value if user is logged in and set "ABC" dimension value to "DEF"

 

 

5.After lots of try reload I am not seeing experiments. Same thing is working if I create dimension from optimizely dashboard 

 

 

Please let me know what's wrong ?  And main question is that is it possible to call JS setdimensions value on PHP API created dimension ?

 

 

Thanks 

Hemang

Level 2