@sekmet/gatsby-source-google-analytics-reporting-api

GatsbyJS Source for Google Anatytics Reporting API

Usage no npm install needed!

<script type="module">
  import sekmetGatsbySourceGoogleAnalyticsReportingApi from 'https://cdn.skypack.dev/@sekmet/gatsby-source-google-analytics-reporting-api';
</script>

README

Gatsby source for Google Anatytics Reporting API

Install

npm i gatsby-source-google-analytics-reporting-api

Configure

In gatsby-config.js:

    {
      resolve: `gatsby-source-google-analytics-reporting-api`,
      options: {
        email: process.env.CLIENT_EMAIL,
        key: require('fs').readFileSync('private.key'),
        viewId: `115350264`,
        startDate: `2009-01-01`,
      }
    },

Usage

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

License

MIT