This repository was archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
This repository was archived by the owner on Sep 28, 2023. It is now read-only.
Define a type property and value when creating an experiment #12
Copy link
Copy link
Open
Description
A recent change to the required properties on the Experiment JSON object has broken the ability to create experiments. See https://developers.optimizely.com/x/rest/v2/#Experiment_ there is now a property named type that is required and the plugin doesn't take this into account.
The experiment data payload is defined here
wordpress-optimizely-x/includes/class-ajax-metabox.php
Lines 358 to 383 in ef3a6c1
| // Build the data array for the experiment. | |
| $experiment = array( | |
| 'metrics' => array( | |
| array( | |
| 'aggregator' => 'unique', | |
| 'event_id' => absint( $event_id ), | |
| 'scope' => 'visitor', | |
| ), | |
| ), | |
| 'name' => sprintf( | |
| /* translators: 1: post ID, 2: post title */ | |
| esc_html__( | |
| 'WordPress [%1$d]: %2$s', | |
| 'optimizely-x' | |
| ), | |
| absint( $post->ID ), | |
| esc_html( $post->post_title ) | |
| ), | |
| 'project_id' => absint( $project_id ), | |
| 'status' => 'paused', | |
| 'variations' => $this->generate_variations( | |
| $variations, | |
| $targeting_id, | |
| $post | |
| ), | |
| ); |
type property. The value should be defined based on how many variations were created by the user.
Three or fewer variations should be an a/b value (2 variations and the original) else it should be multivariate.
Metadata
Metadata
Assignees
Labels
No labels