- Run experiments on CMS content without engineering involvement
- Configure content to serve with each variation
- No performance penalty or flicker
Integrating with Contentful
Our Contentful Marketplace App is publicly available. You can find it here. To use this integration effectively, you will need to do setup around the Contentful marketplace app, your Content types, and your actual codebase. These are one-time setups, then you will be able to seamlessly run A/B/n tests directly inside Contentful.Setting up the Statsig Marketplace App
- Navigate to the Marketplace in Contentful, and find the Statsig app. Click ‘Install’.
-
Statsig will prompt you to enter a Console API Key. You can find an existing Console API Key in your Statsig project under Settings > Keys & Environments. It’s important that this key is of type ‘Console’, and has read and write permissions. Feel free to generate a new key of type ‘Console’ if a suitable one does not already exist for your project.

- Once your API Key is entered, hit ‘Install to selected environments’. Your app should now be configured. Returning to this page later will only show the obfuscated API Key.
Setting up Statsig Variant Container
Once configured, a new Content model should have been added to your space called ‘Statsig variant container’. We can check to make sure this is setup properly:-
Navigate to the ‘Content model’ tab in Contentful, and select the ‘Statsig variant container’.

-
You should see a list of 4 fields: Statsig Experiment Id, Entry Name, Default Variation (control), Treatment Variations.

-
If your ‘Statsig Experiment Id’ field shows
Excluded from api responsenext to it, we will need to update this field to be fetchable in API calls. We can do this by clicking the three dots on the right of the field, and click ‘Include in API response’. Then click ‘Save’.
Setting up Experiments in Content Types
You can configure your existing content types to run Statsig experiments in, automatically serving different variants of this content type to your users. The steps below walk through how to add a ‘Statsig experiment’ field to your target content type.-
Navigate to the ‘Content model’ tab in Contentful, and select your target content type (in this example,
page - Blog post). You should see the list of fields for this content type:
-
Click ‘Add field’, and choose ‘Reference’. Enter
Statsig experimentfor the Name, then click ‘Add and Configure’.
-
Under ‘Validation’, select ‘Accept only specified entry type’, and choose ‘Statsig variant container’ from the dropdown.

- Confirm your new field, and save your content type.
Running an Experiment on your Content
To run an experiment on your content, you can link a Statsig Experiment to it. Here’s how:-
Navigate to the ‘Content’ tab in Contentful, and select your existing entry from the list. At the bottom of the Editor tab, you should now see an editable field for ‘Statsig experiment’:

-
Click on ‘Add content’, and select ‘Statsig variant container’ from the New content dropdown. You should see a new Statsig variant container layover:

-
Under the Statsig tab, enter the name of your experiment under the ‘Entry Name’ field. Add your control and treatment variations. In this example, we will add
component - Rich imagevariations to experiment with. -
When your experiment setup is finalized, hit ‘Publish’ on the new Statsig variant container entry.
Ensure your experiment setup is finalized before publishing, as this will create your experiment inside of Statsig.

- You should now be prompted to start your newly created experiment inside of Statsig. Follow the ‘Go to Statsig Experiment’ link to finalize your experiment’s setup, add metrics, and start your experiment.
- Once your experiment has been started on Statsig, you should see a green banner at the top of your Statsig variant container, and your variation fields will no longer be editable.
- Return to your original entry, and hit ‘Publish changes’.
Integrating Statsig Experiments in your Codebase
We have provided an example repository that outlines how you can integrate your Statsig experiments created from Contentful into your codebase. TheREADME walks through the setup process, including pulling experiment fields from Contentful, calling a Statsig SDK, and matching assigned users to their respective variant.