Gatsby

Seeka can be installed on Gatsby sites via the NPM package.

  1. Install the browser SDK NPM package.

  2. Install the Seeka Gatsby plugin with one of the below commands.

    # Yarn classic (v1)
    yarn add @seeka-labs/gatsby-plugin-seeka@latest
    
    # NPM
    npm install --save @seeka-labs/gatsby-plugin-seeka@latest
  3. Append below environment variables to your .env file. You can find your details in the Seeka app.

    .env
    GATSBY_SEEKA_CONVERGE_PUBLICKEY=(copy value from seeka.app)
    GATSBY_SEEKA_ORGANISATION_ID=(copy value from seeka.app)
    GATSBY_SEEKA_INSTANCE_ID=(copy value from seeka.app)
  4. Add the following to your gatsby-config.js file.

    gatsby-config.js
    module.exports = {
        /// ... existing configuration
        plugins: [
            /// ... existing plugins
    +        {
    +            resolve: '@seeka-labs/gatsby-plugin-seeka',
    +            options: {
    +                publicKey: process.env.GATSBY_SEEKA_CONVERGE_PUBLICKEY,
    +                org: process.env.GATSBY_SEEKA_ORGANISATION_ID,
    +                id: process.env.GATSBY_SEEKA_INSTANCE_ID
    +            }
    +        }
        ]
    }
  5. Page views will automatically tracked. To track other events and enrich identities, see the tracking events and tracking identities in React docs.

Debugging / diagnosis

To identify if your integration is running correctly, see the diagnosing section for more information on how to enable debugging and diagnosis mode.