Skip to content

About

An official plugin to add the Hardal tracking snippet to your Gatsby site.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

Hardal

Hardal for Gatsby

Add Hardal analytics to a Gatsby website by loading the Hardal tracking script through gatsby-config.js. The plugin configures the website ID, script URL, automatic tracking, built-in events, and Do Not Track behavior.

License: MIT Package version

Getting started

You need a Gatsby site, a Hardal website ID, and a compatible Hardal tracker URL. Install the plugin, then add the configuration below to your Gatsby project.

Installation

npm install --save gatsby-plugin-hardal
# or
yarn add gatsby-plugin-hardal

Configuration

// In your gatsby-config.js

plugins: [
  {
    resolve: `gatsby-plugin-hardal`,
    options: {
      websiteId: "<PASTE_YOUR_WEBSITE_ID>",
      srcUrl: "https://app.usehardal.com/hardal.js",
      includeInDevelopment: true,
      autoTrack: true,
      builtInEvents: false, // get your built-in events like scroll, rage click, etc.
      respectDoNotTrack: true,
      eventModel: "web2"
    }
  }
];

includeInDevelopment controls whether the script is included during development; production builds include it automatically. See the plugin source for the exact script attributes.

Support

Maintained by Hardal.

About

An official plugin to add the Hardal tracking snippet to your Gatsby site.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages