Ninetailed
Search…
Getting started
This guide describes the steps you need to follow to add Ninetailed to Gatsby.
With the Gatsby JS plugin you can add dynamic content for personalization to any component.

Gatsby JS

Install the gatsby-plugin-ninetailed modules via npm or yarn.

Install module via npm

1
npm install @ninetailed/gatsby-plugin-ninetailed @ninetailed/experience-sdk-react
Copied!

Install module via yarn

1
yarn add @ninetailed/gatsby-plugin-ninetailed @ninetailed/experienceexperience-sdk-react
Copied!

Gatsby JS + Contentful CMS

If you use Gatsby JS and Contentful as CMS install the gatsby-plugin-ninetailed and contentful-plugin-ninetailed modules via npm or yarn.

Install module via npm

1
npm install @ninetailed/gatsby-plugin-ninetailed @ninetailed/experience-sdk-react @ninetailed/experience-sdk-gatsby-contentful
Copied!

Install module via yarn

1
yarn add @ninetailed/gatsby-plugin-ninetailed @ninetailed/experience-sdk-react @ninetailed/experience-sdk-gatsby-contentful
Copied!

How to use

Just add the plugin to the plugins array in your gatsby-config.js and your API Key.
1
plugins: [
2
...your other gatsby plugins
3
{
4
resolve: `gatsby-plugin-ninetailed`,
5
options: {
6
apiKey: 'your api key'
7
}
8
}
9
]
Copied!
Your API Key can be found in the CMS or Ninetailed dashboard configuration.
By using the Gatsby JS plugin there's no need to configure the ProfileProvider or AnalyticsProvider as described in the React tutorial, as this is done by the plugin.
The plugin automatically tracks Pageviews on route change, please do not track it on your own as you would generate incorrect events.
Last modified 2mo ago