You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# `micro-analytics`
1
+
# `micro-analytics` 📈
2
2
3
3
Public analytics as a Node.js microservice, no sysadmin experience required.
4
4
@@ -13,14 +13,12 @@ A tiny analytics server with less than 100 lines of code, easy to run and hack a
13
13
Running your own `micro-analytics` is just two tiny commands away:
14
14
15
15
```
16
-
17
16
npm install -g micro-analytics-cli
18
17
19
18
micro-analytics
20
-
21
19
```
22
20
23
-
That's it, The analytics server is now running at `localhost:3000`! 🎉
21
+
That's it, the analytics server is now running at `localhost:3000`! 🎉
24
22
25
23
See [`server-setup.md`](./server-setup.md) for instructions on acquiring a server and setting up `nginx` to make your `micro-analytics` publicly available.
26
24
@@ -30,7 +28,7 @@ See [`server-setup.md`](./server-setup.md) for instructions on acquiring a serve
30
28
31
29
### Tracking views
32
30
33
-
To track a view, simply send a request to `/<id>`. If you send a `GET` request, the request will increment the views and return the total views for that id. If you send a `POST` request, the views will increment but you don't get the total views back.
31
+
To track a view of `x`, simply send a request to `/x`. If you send a `GET` request, the request will increment the views and return the total views for the id. (in this case "x") If you send a `POST` request, the views will increment but you don't get the total views back.
34
32
35
33
This is how you'd track pageviews for a website: (though note that this can be used to track anything you want)
36
34
@@ -44,7 +42,7 @@ This is how you'd track pageviews for a website: (though note that this can be u
44
42
</script>
45
43
```
46
44
47
-
If you just want to get the views for an id and don't want to increment the views during a `GET` request, set `inc` to `false` in your query parameter. (`/<id>?inc=false`)
45
+
If you just want to get the views for an id and don't want to increment the views during a `GET` request, set `inc` to `false` in your query parameter. (`/x?inc=false`)
48
46
49
47
If you want to get all views for all ids, set the `all` query parameter to `true`. (`/?all=true`)
0 commit comments