This topic describes how to:
Find the required IDs for the Event API and REST API for Optimizely Web Experimentation and Optimizely Feature Experimentation projects.
When using the Optimizely Experimentation APIs you will need several identifiers found in the Optimizely Experimentation application.
For example:
- creating the JSON object you use to send information to the Optimizely Experimentation Event API.
- exporting Enriched Events Export data using the Optimizely Experimentation Authentication API.
Depending if you are using an Optimizely Web Experimentation or Optimizely Feature Experimentation project, the information is found in different locations within the Optimizely Experimentation application.
Optimizely Web Experimentation projects
Account ID
Go to Account Settings > Plan. The Account ID (account_id
) is found at the top of the page to the right of the Account Information section.
Campaign ID, Experiment ID, Variation IDs, Entity IDs and keys
Go to the project you will be sending events for. Click Experiments > [your experiment name] > API Names.
Event API variable |
Name on page |
Where to find in the UI |
---|---|---|
campaign_id |
Campaign ID |
Under the Experiment Details section. |
experiment_id |
Experiment ID |
Last ID in the Experiment Details section. |
variation_id |
[your variation names] |
In the Variations section. The |
entity_id |
[your event names] |
In the last section, named Events. The |
key |
Events > API Name |
In the last section, named Events.
|
The following screenshot highlights each ID shown on the API Names page.
Optimizely Feature Experimentation projects
You will find the IDs you need for the Optimizely Experimentation APIs inside your project's datafile, which is a JSON file.
Account ID in Optimizely Feature Experimentation
Account ID is available in your datafile and in the Account Settings within the Optimizely Experimentation application.
Go to Account Settings > Plan. The Account ID (account_id
) is found at the top of the page to the right of the Account Information section.
Campaign ID, Experiment ID, Variation IDs, Entity IDs and keys
To access your project's datafile:
-
Navigate to the project you are targeting.
-
Go to the Settings dashboard and navigate to the Environments tab.
- Select the .json link for the specific Environment you want to view (Development or Production).
- This will open your datafile in a new tab.
The variable names in the datafile are slightly different than those in the Event API JSON object.
To map the Event API fields to the datafile variables:
Event API Variable Name |
Datafile Variable Name |
Datafile Variable Parents |
account_id |
accountId |
None |
campaign_id |
layerId |
experiments > |
experiment_id |
id |
experiments > |
variation_id |
id |
experiments > variations |
entity_id |
id |
events > |
key |
key |
events > |
In non-legacy Optimizely Feature Experimentation projects created after February 2021, find the experimentId
in the project's datafile.
Examine this sample project datafile. These are the values mapped to the API variables.
account_id
: 9367106729 (line 114)campaign_id
: 1363949190 (line 20)experiment_id
(multiple):- 4381824755 (line 18)
- 8403352966 (line 46)
- 8404883348 (line 74)
variation_id
(multiple):- 6404851286 (line 10)
- 4429569305 (line 14)
- 6848562798 (line 38)
- 1647531815 (line 42)
- 5895524347 (line 66)
- 8404413532 (line 70)
entity_id
(multiple):- 6431058684 (line 105)
- 2491806650 (line 110)
key
(multiple):- ADD_TO_CART (line 106)
- COMPLETED_PURCHASE (line 111)