Disclaimer: This website requires JavaScript to function properly. Some features may not work as expected. Please enable JavaScript in your browser settings for the best experience.

Optimizely will be sunsetting Full Stack Experimentation on July 29, 2024. See the recommended Feature Experimentation migration timeline and documentation.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Example datafile

This topic describes an example datafile in JSON.

The datafile is a JSON string that describes all the experiments and features running in a given environment and dependent entities like audiences and attributes. Normally, you will not need to interact with the datafile directly. The SDK exposes methods that operate on it internally.

The example below shows what a datafile might contain. Use it to understand the configuration information that is passed.

{
    "accountId": "12345",
    "anonymizeIP": false,
    "botFiltering": false,
    "projectId": "23456",
    "revision": "6",
    "version": "4",
    "experiments": [
        {
            "key": "my_experiment",
            "id": "45678",
            "layerId": "34567",
            "status": "Running",
            "variations": [
                {
                    "id": "56789",
                    "key": "control",
                    "variables": []
                },
                {
                    "id": "67890",
                    "key": "treatment",
                    "variables": []
                }
            ],
            "trafficAllocation": [
                {
                    "entityId": "56789",
                    "endOfRange": 5000
                },
                {
                    "entityId": "67890",
                    "endOfRange": 10000
                }
            ],
            "audienceIds": [],
            "forcedVariations": {}
        }
    ],
    "featureFlags": [
        {
            "experimentIds": [],
            "id": "56789",
            "key": "price_filter",
            "rolloutId": "67890",
            "variables": [
                {
                    "defaultValue": "100",
                    "id": "12345",
                    "key": "min_price",
                    "type": "integer"
                }
            ]
        }
    ],
    "events": [
        {
            "experimentIds": [
                "34567"
            ],
            "id": "56789",
            "key": "my_conversion"
        }
    ],
    "audiences": [],
    "attributes": [],
    "groups": [],
    "rollouts": [
        {
            "experiments": [
                {
                    "audienceIds": [],
                    "forcedVariations": {},
                    "id": "23456",
                    "key": "23456",
                    "layerId": "34567",
                    "status": "Running",
                    "trafficAllocation": [
                        {
                            "endOfRange": 5000,
                            "entityId": "45678"
                        }
                    ],
                    "variations": [
                        {
                            "featureEnabled": true,
                            "id": "56789",
                            "key": "56789",
                            "variables": [
                                {
                                    "id": "67890",
                                    "value": "100"
                                }
                            ]
                        }
                    ]
                }
            ],
            "id": "78901"
        }
    ],
    "variables": []
}