Quick Start for Developers

This quick reference guide describes the steps you need to follow to integrate Ninetailed in your website.

In this quick guide you will learn how to integrate Ninetailed in a website using Contentful as headless CMS and React for the frontend in five steps:

  1. Install Contentful App

  2. Create a personalized variant

  3. Install React SDK

  4. Get visitor profile

  5. Personalize components

Step 1: Install Contentful App

Install our Contentful App from the official marketplace.

  1. Select the space and environment you want to install the app.

  2. Authorize the app access.

  3. Link your Contentful account to Ninetailed.

  4. Create an organization in Ninetailed.

  5. Set up the content types for dynamic content personalization.

  6. Confirm your settings and install the app. 🙃

Find more information about the install process in the Contentful section.

Step 2: Create a personalized variant

A variant is the relevant content for a specific audience. To create a variant in Contentful:

  1. Edit or create an entry of any content type which was set up in the install process.

  2. Create a new variant for the entry and update the content.

  3. Create a new audience and publish it.

  4. Publish the variant and the entry and you're done. 🙌

Find more information about how to define a new audience in the Audience Builder section.

Step 3: Install React SDK

To show the variants in the frontend you need to install Ninetailed React SDK.

1. Install

Install @ninetailed/client-sdk-react module via npm or yarn.

yarn add @ninetailed/client-sdk-react

2. How to use

This is what the configuration of @ninetailed/client-sdk-react looks like:

import React from 'react';
import {
} from '@ninetailed/client-sdk-react';
export const App = () => {
return (<>
<AnalyticsProvider apiKey="Your_API_Key">
<YourAppCode />

Your API Key can be found in the CMS or Ninetailed dashboard configuration.

Step 4: Get visitor profile

The next step is to fire a page view to get the profile of the visitor.

This is what a page view looks like:

import React, { useEffect } from 'react';
import { useAnalytics } from '@ninetailed/client-sdk-react';
export const Page = () => {
const { page } = useAnalytics();
useEffect(() => {
}, [page]);
// ... your Page component

Step 5: Personalize components

To show the variants in the frontend you need to wrap the components to be personalized.

import { Personalize, useAnalytics } from '@ninetailed/client-sdk-react';
import Headline from '../Headline.dynamic';
export const Page = () => {
// ...page view effect from Step 4
// fetch the content
const [page, setPage] = useState(null);
useEffect(() => {
// Fetch your content from Contentful as before, just make sure the variants will get fetched.
const { page } = getPageFromContentful();
}, [setPage]);
return <>
<Personalize component={Headline} variants={page.headline.variants} text={page.headline.text} />
{/* ...the rest of your page */}