Ninetailed
Search…
⌃K

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

npm install @ninetailed/gatsby-plugin-ninetailed @ninetailed/experience-sdk-react

Install module via yarn

yarn add @ninetailed/gatsby-plugin-ninetailed @ninetailed/experienceexperience-sdk-react

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

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

Install module via yarn

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

How to Use

Just add the plugin to the plugins array in your gatsby-config.js and your API Key.
plugins: [
...your other gatsby plugins
{
resolve: `gatsby-plugin-ninetailed`,
options: {
apiKey: 'your api key'
}
}
]
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.