Code Monkey home page Code Monkey logo

netlify-analytics-collector's Introduction

Netlify Analytics Collector

โš ๏ธ This tool uses an unofficial/unpublisehd API from Netlify. It may break any time!

Netlify Analytics is awesome but currently it only shows you data for the last 30 days. You can archive analytics into CSV files with this tool. It either runs with NodeJS locally or can be added to Github repos as a Github action that runs on a schedule.

You can find example workflows in .github/workflows.

  • example.yml is set to run every day just before midnight to create 1 a zip file with the analytics of the last 30 days and 2 adds the analytics for the current day to a Google Sheet.
  • summary-release.yml Is a workflow that runs on the first day of each month and creates a new release in the Github repo with an zip with CSV files of the analtics data from the past month.

These are the workflows I came up and you can probably built even cooler workflows. Let me know!

Setup

You need to setup some secrets either as secrets for actions or environment variables.

  • NETLIFY_SITE - You need the API ID of your Netlify site with analytics enabled. You can find it on your sites settings page.
  • NETLIFY_TOKEN - You need a personal access token for your Netlify account to login in. You can generate a token here

For Google Sheets

The example workflow uses this action to update a Google Sheet every day. Please read there how to set the action if you need it.

  • GOOGLE_SERVICE_ACCOUNT_EMAIL
  • GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY
  • GOOGLE_SPREADSHEET_ID

netlify-analytics-collector's People

Contributors

niklasmerz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.