Skip to main content
View plugin on GitHub
See starters using this

Gatsby Source Plugin for Google Analytics Total Page Views

⚠️ DOES NOT WORK ⚠️

Install

npm i gatsby-source-google-analytics-total-pageviews

Configure

In gatsby-config.js:

    {
      resolve: `gatsby-source-google-analytics-total-pageviews`,
      options: {
        email: process.env.CLIENT_EMAIL,
        key: [googleApiKey],
        viewId: [googleAnalyticsViewId],
        startDate: '30daysAgo',
      }
    },

Usage

    pageViews(path: {eq: $slug}) {
      totalCount
    }

License

MIT