🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@bcgov/gatsby-source-matomo

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bcgov/gatsby-source-matomo

Plugin that generates a set of nodes based off Matomo analytics

0.0.5
latest
npm
Version published
Weekly downloads
4
-88.24%
Maintainers
5
Weekly downloads
 
Created
Source

Gatsby Source Matomo

Load page data as source nodes

Features

  • Page URL information including visits, hits, bounce rate etc.

Quirks

Although the Matomo API claims to be 'restful', it is far from that. For the initial implementation of this plugin, only page information is retrieved by via default method Action.getPageUrls api reference

This can be overridden to your liking with the apiOptions option

To Use

  • Install npm install --save @bcgov/gatsby-source-matomo
  • Add to your gatsby config
{
  resolve: 'gatsby-source-matomo',
  options: {
    matomoApiToken: '...',
    matomoUrl: '...',
    siteId: '...'
    apiOptions:  {...}, // overrides for the matomo api
  }
}

Options

  • matomoApiToken: this is the access token
  • matomoUrl: the path to your Matomo instance (https://my-matomo-site.com)
  • siteId: the site id you want to get information from
  • apiOptions: an object to override the query to the matomo api.
//...
resolve: 'gatsby-source-matomo',
options: {
  apiOptions: {
    period: '..',
    date: '..',
    method: 'foo'
    // etc
  }
}

Road Map

The initial implementation default to getting page urls, this plus the overridability with the apiOptions field makes this plugin fairly flexible. I am happy to take PR's on extending the capability of this plugin

  • add support to recurse through page urls. Matomo only provides page urls one section at a time. At this time we only support 1 level nested page paths.

  • https://mysite.com/path1/path2/path3 > will not get path3 stats

Disclaimer when overriding with ApiOptions

There is no implementation detail to change the Node Type during an override so be careful with that!

Keywords

gatsby

FAQs

Package last updated on 03 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts