Gatsby Book Launch

“The missing guide to the modern web” launches on Thursday, Sep 29th: Modular: The Web’s New Architecture

ContactSign Up for Free
Community Plugin
View plugin on GitHub

gatsby-plugin-firstparty

Gatsby plugin to connect your site to Firstparty analytics tool.

Install

npm install --save gatsby-plugin-firstparty

How to use

// gatsby-config.js
module.exports = {
    ...
    plugins: [
        {
            resolve: `gatsby-plugin-firstparty`,
            options: {
                // your source URL starting with "fp."
                sourceUrl: "fp.yourdomain.com",
                // your write key for this source from the Sources page
                writeKey: "YOUR_SOURCE_WRITE_KEY",
            }
        },
        ...
    ]
}

How it works

This plugin adds the Firstparty tracking script to the <head> of every page as documented in the Firstparty setup instructions. After downloading the script, it loads the firstparty object with your write key and domain and logs the page view.

© 2022 Gatsby, Inc.