Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

A bunch of scripts to pull down stats from Matomo

Notifications You must be signed in to change notification settings

ministryofjustice/matomo-scrape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matomo scrape

This document outlines the steps to export the NPR radio show podcast stats from the Hub as well as feedback.

Prerequisites

To run the script and format the stats you’ll need:

  1. Access to production environment: connected via ssh tunnel to the cloud gateway so the app to works

  2. PIWIK token: Log in to PIWIK (via ssh tunnel). Select the person icon (towards the top right), this takes you to your personal settings. Click the API option on the left hand panel to access the user authentication token

  1. Node & npm: Instructions to install node and npm

App setup

Download the app on this page into a directory on your computer, then:

open a terminal session move into the directory where you downloaded the app to run the following commands

npm install

Create an environment file to which to store urls in

cp .env.example .env

Then replace the value with the correct ones in the created .env file

Getting your data

To download feedback stats for the respective prison you will need to run the following command.

Before you run this command make sure you are ssh'd in the the production bounce box of the representative establishment

./bin/feedback_stats START_DATE,END_DATE ESTABLISHMENT_NAME

e.g.
START_DATE=2019-03-15
END_DATE=2019-03-25
ESTABLISHMENT_NAME=berwyn | wayland

./bin/feedback_stats 2019-03-15,2019-03-25 berwyn

Downloading the NPR stats is similar to downloading the feedback stats.

Before you run this command make sure you are ssh'd in the the production bounce box of the representative establishment

./bin/npr_stats 2019-03-15,2019-03-25 berwyn

Once you've run either command you should be able to find your file in the csv-exports folder.

About

A bunch of scripts to pull down stats from Matomo

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •