Skip to content

Commit 6bba4b6

Browse files
greghuelsemetelka
andauthored
docs for the Eppo Contentful marketplace app (#487)
* docs for the Eppo Contentful marketplace app * added danger and info on analysis * Added app link --------- Co-authored-by: Eric Metelka <[email protected]>
1 parent fdd4c56 commit 6bba4b6

17 files changed

+33
-82
lines changed

docs/guides/marketing/integrating-with-contentful.md

Lines changed: 33 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -6,115 +6,66 @@ sidebar_position: 6
66

77
It is common for marketing and content teams to want an A/B testing solution with a point-and-click visual editor to make straightforward copy or image optimizations. However, these solutions most often rely on blocking scripts that cause performance degradations—slowing your site down by 200-500 milliseconds in best-case scenarios. You could avoid these performance issues by fully implementing feature flags for marketing experiments—but this will mean marketing has to rely on engineering for every test they want to run.
88

9-
Using a headless CMS like Contentful, and a lightweight, robust feature flagging SDK, like Eppo, allows the best of both worlds: an easy way for marketing teams to run tests without sacrificing performance. In this tutorial, we will walk through how to set up Eppo’s Node SDK so Marketing teams can run their own experiments by updating [Content](https://www.contentful.com/help/content-model-and-content-type/) defined in Contentful and feature flags in Eppo.
9+
Using a headless CMS like Contentful, and a lightweight, robust feature flagging SDK, like Eppo, allows the best of both worlds: an easy way for marketing teams to run tests without sacrificing performance. In this tutorial, we will walk through how to set up Eppo’s Node SDK so Marketing teams can run their own experiments by updating [Content](https://www.contentful.com/help/content-model-and-content-type/) defined in Contentful and feature flags in Eppo.
1010

11+
## Installing Eppo's Contentful marketplace app
1112

12-
## Setting up Contentful
13+
Eppo now supports seamless integration with Contentful via the Eppo Contentful marketplace app. This app allows you to create experiements directly within a Contentful blog post.
1314

14-
For this example, imagine we are running an experiment on the Eppo homepage. There are a few places where we might want to experiment on this page:
15+
To get started, visit [Eppo's Contentful app page](https://www.contentful.com/marketplace/eppo/) and click the `Get the app` button to install.
1516

16-
![Eppo homepage](/img/guides/integrating-with-contentful/eppo-homepage.png)
17+
When installing the app, you should see a configuration screen that allows you to enter an **Eppo API key** along with various other settings.
1718

18-
1. The hero title (”Run reliable, impactful experiments”)
19-
2. The hero body (”Eppo streamlines …”)
20-
3. The CTA text (”Preview Eppo Now”), and the CTA link (”www.geteppo.com/get-access”)
21-
4. The demo video
19+
![Configuring the Eppo marketplace app](/img/guides/integrating-with-contentful/configuring-eppo-marketplace-app.png)
2220

23-
To build this experiment out in our Contentful space, create a new Content Model with the name “Homepage”. Add the following content fields:
21+
Upon installation, you'll need to use an API key that has write access to **Feature Flags** and **Experiments**. To create a key, navigate to https://eppo.cloud/admin/api_keys, then click on **Create key**.
2422

25-
![Contentful field setup](/img/guides/integrating-with-contentful/contentful-field-setup.png)
23+
![Generating an API key for Contentful](/img/guides/integrating-with-contentful/configuring-eppo-marketplace-app.png)
2624

27-
Now to create our variants, navigate to the content page and create two content entries using the Homepage Content Model you created above. Name one “Homepage Baseline” and the other “Homepage Redesign”. Each version should reflect the copy you want to test:
25+
Copy the key that was generated and paste it into the **Eppo API key** field in Eppo's Contentful app configuration screen. You'll then need to select a **Default randomization entity** and **Default assignment logging table**. Click on **Install to selected environments** to finish installation.
2826

29-
![Contentful variant setup](/img/guides/integrating-with-contentful/contentful-variant-setup.png)
27+
## Configuring a Content Type to use Eppo Experiments
3028

29+
Next, we'll need to configure certain content types to use the Eppo plugin that we installed. In this example, we'll assume that we have a **page - Blog post** [content model](https://www.contentful.com/help/content-models/content-modelling-basics/) and that we want to directly run Eppo experiments within that model. To set this up, you'll need to click on **Content model** from the navigation menu, then click on **page - Blog post** from the list of models available.
3130

32-
:::note
33-
For this tutorial, we are including a Control and Variant for an A/B test, but you can repeat this process to add additional variants.
34-
:::
35-
36-
Now that we have the content defined, we’ll need to get the entry ID for our two pages. In Contentful, the entry ID can be found on the content page and by clicking on the 3 dots next to your content entries and clicking ‘Copy entry ID’. Save these for now, we will use them in our Eppo setup next.
37-
38-
![Getting Contentful entry ids](/img/guides/integrating-with-contentful/getting-contentful-entry-ids.png)
39-
40-
## Setting up Eppo
41-
42-
Next, we’ll create a [corresponding flag in Eppo](/feature-flag-quickstart/) (Configuration >> Create). For each variant above, simply add a new variant in the Eppo UI. For each variant value, paste in the corresponding Contentful entry ID. Make sure to also save your Feature Flag key – you will need it for your Node implementation later.
43-
44-
![Eppo feature flag setup](/img/guides/integrating-with-contentful/eppo-feature-flag-setup.png)
45-
46-
## Setting up your Node environment
47-
Now that we have the flag and a few variants defined, you can enable the flag in your local environment and start developing the page using the content defined in Contentful. For details on setting up your first flag, please see the [Feature Flag quick start section](/feature-flag-quickstart) of our docs.
31+
![Navigating to your content type](/img/guides/integrating-with-contentful/navigate-to-content-type.png)
4832

49-
The code example below does the following:
33+
From within the "Fields" subpage of the "page - Blog post" management, you'll then want to click on **+ Add field**.
5034

51-
1. Initialize the Eppo and Contentful clients
52-
2. Use the Eppo client to determine which variation a user should be assigned
53-
3. Use the variation assignment to fetch content from Contentful
35+
![Navigating to add a field](/img/guides/integrating-with-contentful/navigate-to-add-field.png)
5436

55-
To get the implementation we built running locally, [clone this repo from Github](https://github.com/hhargreaveseppo/contentful_eppo_blog), and follow the README instructions. If you already know where you would like to implement this integration you can use the following code as boilerplate:
37+
On the modal that pops up, click **Reference**, then type in the name `Eppo Experiment`.
5638

57-
```js
39+
![Adding a field](/img/guides/integrating-with-contentful/adding-a-field.png)
5840

59-
import { init } from "@eppo/node-server-sdk";
60-
import * as EppoSdk from "@eppo/node-server-sdk";
41+
Then, click **Add and configure**.
6142

62-
import contentful from "contentful";
63-
import 'dotenv/config'
43+
![Configuring a field](/img/guides/integrating-with-contentful/configuring-a-field.png)
6444

65-
// Eppo Specific methods
66-
await init({
67-
apiKey: <EPPO SDK KEY>
68-
});
45+
On the configuration screen for the field, make sure you check **Accept only specified content type**, with `Eppo variant container` selected. Click **Confirm** to save your changes.
6946

70-
const eppoClient = EppoSdk.getInstance();
47+
The Eppo Contentful marketplace app is now configured for use with the `page - Blog post` content type! You can repeat this process for other content types that you want to run experiments with.
7148

72-
const homepageEntryId = eppoClient.getStringAssignment(
73-
"<EPPO FLAG KEY>", // flag key from Eppo UI
74-
"<USER ID>", // unique identifier for the user
75-
{}, // user attributes, if any (otherwise pass an empty object)
76-
defaultValue,
77-
)
78-
console.log("<EPPO FLAG KEY>", homepageEntryId)
49+
## Running an experiment in Contentful
7950

80-
// Contentful specific methods
81-
const contentfulClient = await contentful.createClient({
82-
space: <CONTENTFUL SPACE ID>, // Add your Contentful Space ID here
83-
accessToken: <CONTENTFUL ACCESS TOKEN> // add your Contentful Access Token here
84-
})
51+
At this point, when you go to a blog-post entry in Contentful, you should see a new "Eppo Experiment" field. From here, click on **+ Add content**, then click on **Eppo variant container**.
8552

86-
const entry = await contentfulClient.getEntry(homepage_entry_id)
87-
console.log(entry) // see the different assignments that a user received
88-
```
53+
![Creating an experiment](/img/guides/integrating-with-contentful/creating-an-experiment.png)
8954

90-
Once your application is running you should see your entry fields logged based on what variation that user ID was assigned.
55+
In this example, we'll create two "component - Rich image" variants to determine which "hero image" to display for the blog post. You can select existing images by clicking on **Link existing entry**, or you can link an image that doesn't exist yet by clicking on **Create new entry and link**. Click publish once you've finished.
9156

92-
![Example variation and Contentful content logged](/img/guides/integrating-with-contentful/example-variation-log.png)
57+
![Linking entries](/img/guides/integrating-with-contentful/linking-entries.png)
9358

59+
Once you publish, a message will appear at the top of the screen letting you know that a new feature flag has been created in the Eppo UI. Click on on the link that says **Go to Eppo feature flag** to confirm this worked. From the Eppo UI, you can then enable the flag.
9460

95-
### Initial Deployment
96-
97-
Engineering will still need to build the site to read from the CMS and render the page as appropriate. For the initial deployment, it may be easiest to only include one variant. The addition of new content and randomized variants can then all be managed in the Contentful and Eppo UIs.
98-
99-
We recommend having a default entry ID in case there are any issues initializing the Eppo client; in this case the Eppo SDK will return `NULL` for the variant value.
100-
101-
### Workflow for deploying a new content experiment
102-
103-
The recommended workflow for launching a content-based experiment is as follows:
104-
105-
1. Create a new entry in Contentful for the appropriate content model.
106-
2. Create a new variant in Eppo with the `entry_id` from Contentful UI.
107-
3. Create an allocation to test the new content in production (see screenshot below).
108-
4. Load page to QA new content and [add screenshots to Eppo](/experiment-analysis/configuration/#adding-screenshots) for reference.
109-
5. [Create an experiment allocation](/feature-flagging/concepts/experiment-assignment/) and launch the experiment.
110-
6. Analyze experiment and make rollout decisions like any other Eppo experiment.
111-
112-
:::tip
113-
This can all be done in the Contentful and Eppo UIs with no additional engineering support.
61+
:::danger
62+
The experiment is not running until the linked feature flag is enabled in the Eppo UI. Don't forget to enable the feature flag.
11463
:::
11564

116-
![Updating Eppo Experiment allocation](/img/guides/integrating-with-contentful/updating-eppo-allocation.png)
65+
The experiment also has a linked experiment analysis that is automatically created for you when you publish. This is the experiment in the Eppo UI where metrics can be added and you can monitor the experiment results. Learn more about [configuring your analysis here](/experiment-analysis/index).
66+
67+
That's it! You now have a feature flag and experiment configured for this blog post.
11768

118-
## Conclusion
69+
## Updating your codebase to support Eppo experiments
11970

120-
Now that you have Contentful and Eppo set up, you can see how easy it is to run no-code experiments. Once your content models are defined and Eppo feature flags are set up, teams can set up additional variations and define content in Contentful without any additional code releases.
71+
Your codebase will require changes to support Eppo's Contentful marketplace app. Refer to the `README.md` instructions in Eppo's [contentful-pages-router-blog-sample](https://github.com/Eppo-exp/contentful-pages-router-blog-sample) repository to integrate your Codebase with Contentful.
165 KB
Loading
47.3 KB
Loading
64.1 KB
Loading
-83.7 KB
Binary file not shown.
-106 KB
Binary file not shown.
223 KB
Loading
109 KB
Loading
-66.2 KB
Binary file not shown.
-212 KB
Binary file not shown.

0 commit comments

Comments
 (0)