Skip to content

Commit cbab4a6

Browse files
committed
Update docs
1 parent 4134691 commit cbab4a6

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

.github/workflows/example.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ jobs:
2929
netlify-site-id: ${{ secrets.NETLIFY_SITE }}
3030
days: 0
3131
disable-header: true
32-
- uses: niklasmerz/csv-to-google-spreadsheet@fixes
32+
- uses: niklasmerz/csv-to-google-spreadsheet@master
3333
with:
3434
csv_path: pageviews.csv
3535
spreadsheet_id: ${{ secrets.google_spreadsheet_id }}
3636
worksheet: 0
3737
append_content: true
3838
google_service_account_email: ${{ secrets.google_service_account_email }}
3939
google_service_account_private_key: ${{ secrets.google_service_account_private_key }}
40-
- uses: niklasmerz/csv-to-google-spreadsheet@fixes
40+
- uses: niklasmerz/csv-to-google-spreadsheet@master
4141
with:
4242
csv_path: visitors.csv
4343
spreadsheet_id: ${{ secrets.google_spreadsheet_id }}
4444
worksheet: 1
4545
append_content: true
4646
google_service_account_email: ${{ secrets.google_service_account_email }}
4747
google_service_account_private_key: ${{ secrets.google_service_account_private_key }}
48-
- uses: niklasmerz/csv-to-google-spreadsheet@fixes
48+
- uses: niklasmerz/csv-to-google-spreadsheet@master
4949
with:
5050
csv_path: bandwidth.csv
5151
spreadsheet_id: ${{ secrets.google_spreadsheet_id }}

.github/workflows/summary-release.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,3 @@ jobs:
4343
asset_path: ./monthly-summary.zip
4444
asset_name: monthly-summary-${{ steps.current-time.outputs.formattedTime }}.zip
4545
asset_content_type: application/zip
46-
- name: Report Status
47-
if: always()
48-
uses: ravsamhq/notify-slack-action@master
49-
with:
50-
status: ${{ job.status }}
51-
notify_when: 'failure'
52-
env:
53-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
# Netlify Analytics Collector
22

3-
This actions archives your analytics data from Netlify Analytics
3+
> :warning: This tool uses an unofficial/unpublisehd API from Netlify. It may break any time!
44
5-
See [.github/workflows](./.github/workflows) for examples.
5+
[Netlify Analytics](https://www.netlify.com/products/analytics/) is awesome but currently it only shows you data for the last 30 days. You can archive analytics from Netlify Analytics with this tool into CSV files. It either runs with NodeJS locally or can be added to Github repos as a Github action that runs on a schedule.
66

7-
Running as Github Action or NodeJS app.
7+
You can find example Github Actions in [.github/workflows](.github/workflows).
8+
9+
* `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.
10+
* `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.
11+
12+
These are the workflows I came up and you can probably built even cooler workflows. Let me know!
13+
14+
## Setup
15+
16+
You need to setup some secrets either as secrets for actions or environment variables.
17+
18+
* `NETLIFY_SITE` - You need the **API ID** of your Netlify site with analytics enabled. You can find it on your sites settings page.
19+
* `NETLIFY_TOKEN` - You need a personal access token for your Netlify account to login in. You can generate a token [here](https://app.netlify.com/user/applications/personal)
20+
21+
### For Google Sheets
22+
23+
The example workflow uses [this action](https://github.com/canonical-web-and-design/csv-to-google-spreadsheet). Please read there how to set the action if you need it.
24+
25+
* `GOOGLE_SERVICE_ACCOUNT_EMAIL`
26+
* `GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY`
27+
* `GOOGLE_SPREADSHEET_ID`

0 commit comments

Comments
 (0)