pirsch-analytics / pirsch Goto Github PK
View Code? Open in Web Editor NEWPirsch is a drop-in, server-side, no-cookie, and privacy-focused analytics solution for Go.
Home Page: https://pirsch.io
License: GNU Affero General Public License v3.0
Pirsch is a drop-in, server-side, no-cookie, and privacy-focused analytics solution for Go.
Home Page: https://pirsch.io
License: GNU Affero General Public License v3.0
Right now it contains more than just the IP. That's not a huge issue, but it could be nicer.
Right now, a session cannot live longer than the maximum session lifetime. To change this the following two changes need to be made:
SELECT "session" FROM "hit" WHERE fingerprint = $1 AND "session" > $2 LIMIT 1
Probably need to add more test to make sure sessions are continuous, but can run out at some point.
Missed that in 1.4.0...
In case an entry exists already, update it. This is useful to be able to run the processor multiple times a day, whenever and without getting messed up data.
Not sure this is required really.
For a time span add:
Example:
2020-01-20 - 2020-01-27
Must be counted for distinct fingerprints and not grouped by path for the total number of visitors.
Add IP ranges to filter for. I'm not sure this is actually that useful, since we filter out bot user agents anyways? It IS useful but keeping track of IPs is cumbersome and not reliable. I might use heuristics for this issue (like how many sessions does a client have, is it reasonable and so on).
Test data:
marvinblum | panic: pq: value too long for type character varying(200)
marvinblum |
marvinblum | goroutine 11 [running]:
marvinblum | github.com/emvi/pirsch.panicOnErr(...)
marvinblum | /go/pkg/mod/github.com/emvi/[email protected]/util.go:23
marvinblum | github.com/emvi/pirsch.(*Tracker).aggregate(0xc00005c460, 0x99f8a0, 0xc000076680)
marvinblum | /go/pkg/mod/github.com/emvi/[email protected]/tracker.go:169 +0x44b
marvinblum | created by github.com/emvi/pirsch.(*Tracker).startWorker
marvinblum | /go/pkg/mod/github.com/emvi/[email protected]/tracker.go:151 +0x9a
referrer := r.Header.Get("Ref")
This should be Referer
.
Funnels can probably be implemented by combining multiple filtering steps. Example:
200 --(-10%)--> 180 --(-50%)--> 90
Filter 1 Filter 2 Filter 3
Add a simple Js script to call an endpoint. Easy.
SELECT count(DISTINCT("fingerprint")) "visitors",
count(DISTINCT("fingerprint", "session")) "sessions"
FROM hit
;
Should show some difference, but it doesn't.
[ERROR] Error processing tracking data err=sql: Scan error on column index 2, name "language": converting NULL to string is unsupported
To track multiple applications/subdomains or to separate data in other ways.
They are either
So I think it's fine to ignore them.
For "today" and "yesterday". The number for yesterday is included twice: yesterday*2+today
This will be a huge refactoring to simplify storing/processing the statistics and to allow them to be filtered by tenant + page + period, where each part is optional. The other views can be cumulated from these or extracted from the hits directly (live data).
This is still broken. The statistics are created for the last existing day, instead of a new one. This is probably due to how the save functions find the latest row.
Go-http-client
Twingly
evc-batch
mailto
newspaper
FeedReader
Magic Browser
Ruby
Weavr
HackerNews
CFNetwork
SocialBeeAgent
Embed PHP library (?)
Creating new sql.NullInt64s everywhere is annoying. Add a function to do that by passing an integer (0 = null, everything else = valid ID).
main_test.go needs some abstraction/simplification in order to add new storage backends more easily.
Count every visitor who leaves after visiting the first page as bounced.
Need to add hits.
The event handler might not fire, and some other improvements can be made.
So that the fingerprint cannot be unhashed again.
This is not an issue as long as you (the user) don't decrypt the hashes and no one gets access to your database. Consumer IPs usually change after a while, as ISPs use IP pools for their customers.
Analyzer:
if addToday && len(stats) > 0 {
I would like to ask if you planning or maybe accept a PR to accept Mongodb integration?
Track events from JS and the API.
Track HTTP status codes to get statistics on failed requests. Should be optional and set when calling the Hit function.
To prevent anyone from reassembling fingerprints.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.