Commit Graph

177 Commits

Author SHA1 Message Date
Danny eddb1e9566 write info level after connecting to database 2018-05-25 14:12:32 +02:00
Danny 05b2cc53a2 only turn relative path into absolute path 2018-05-23 14:52:38 +02:00
Danny 11b4e5e5b3 print message if using default config 2018-05-23 09:11:28 +02:00
Danny fc35d68926 output log messages during bootstrap, eg with config file location 2018-05-23 09:03:42 +02:00
Danny 7c3cecad09 use errorf log when database migrations fail 2018-05-22 16:20:43 +02:00
Danny 7adc5d3bec wip on chart implementation using d3 2018-05-22 12:23:17 +02:00
Danny da19c116b7 strip AMP & UTM vars from referrer urls. closes #37 2018-05-22 10:30:35 +02:00
Danny van Kooten 3b8a884991 godoc improvements 2018-05-21 11:54:01 +02:00
Danny 0039683b74 set header code when sessionstore returns err 2018-05-15 14:20:05 +02:00
Danny 47c6dc3ab7 add test for setting secret through env var 2018-05-15 14:15:47 +02:00
Danny 1bd093b8a4 add test for config.randomString func 2018-05-15 13:54:36 +02:00
Danny c30e5b3120 introduce datastore interface & stop relying on package var to retrieve db conn. relates to #29 2018-05-15 13:30:37 +02:00
Danny 8b639d348d lowercase all log messages and strip newlines 2018-05-15 10:26:35 +02:00
Danny 69fc3e7aa1 implement results type container 2018-05-14 15:31:33 +02:00
Danny 68ab44c57d use github.com/urfave/cli as cli framework 2018-05-14 13:42:03 +02:00
Danny 73e011b6cc implement notfound handler with simple 404 page, closes #19 2018-05-14 12:08:18 +02:00
Danny 6482378734 serve assets from /assets subdir and re-use packr box for index.html & tracker.js 2018-05-14 11:17:41 +02:00
Danny 4aac79c7f9 coalesce query results to handle nil 2018-05-14 10:17:58 +02:00
Danny 7c33ac7b86 Merge branch 'master' of github.com:usefathom/fathom 2018-05-14 10:16:43 +02:00
Danny 2c09050d74 move should-collect logic into func so it can be tested 2018-05-14 10:14:43 +02:00
Danny 05a159da7f skip missing referrer values. closes #26 2018-05-14 10:06:53 +02:00
Danny van Kooten 7d111a8372 Merge branch 'master' of https://github.com/usefathom/fathom
* 'master' of https://github.com/usefathom/fathom:
  fire off request for fetching totals earlier
  use pageviews sum to show green percentage bar in pseudo-element
  add api routes for getting aggregated pageview sum for pages & referrers
  ignore prerendered pages, #13
  don't send unneeded var in collect request
  derive tracker URL from script element if not explicitly set
  restyle login page
  weight multi-day average for pages & referrers too. #23
  weight site averages when calculating multi-day average. closes #23
  only update average duration if we know time on page.
2018-05-12 14:49:23 +02:00
Danny van Kooten 618e85e53b unique index on daily_page_stats should include hostname 2018-05-12 14:49:21 +02:00
Danny dbcc0545a2 add api routes for getting aggregated pageview sum for pages & referrers 2018-05-11 15:49:37 +02:00
Danny d104abaec2 Merge branch 'master' of github.com:usefathom/fathom 2018-05-11 10:54:47 +02:00
Danny 3991665a72 weight multi-day average for pages & referrers too. #23 2018-05-11 10:54:41 +02:00
Danny 88a59e75ab weight site averages when calculating multi-day average. closes #23 2018-05-11 10:48:25 +02:00
Danny 9bb1a05e06 only update average duration if we know time on page. 2018-05-11 10:33:12 +02:00
Danny van Kooten e2d45dbc40 check errors returned by sessionstoreE 2018-05-10 22:21:44 +02:00
Danny e73a205d26 run the aggregator every minute since we only need the last pageview of every visitor for determining distinct realtime visitor count 2018-05-09 10:36:05 +02:00
Danny 840956bfbd set precision for duration & bounce rate when storing & retrieving data from datastore 2018-05-09 10:35:16 +02:00
Danny 3e22efc5f7 when getting stats for a given period; date should larger than start date, but not equal 2018-05-09 08:36:29 +02:00
Danny 8ed076dd02 use correct groupby parameter for aggregated stats 2018-05-09 08:34:58 +02:00
Danny 624e1f353a fix json tag in models struct 2018-05-09 08:34:48 +02:00
Danny van Kooten a8edcee54e store avg time on site as float to not race to 0 2018-05-08 20:16:31 +02:00
Danny van Kooten 27e1d5d368 set packr box dir dynamically to ensure all drivers are packrd 2018-05-08 18:49:56 +02:00
Danny 3493bb1e9e default to actual driver name instead of alias 2018-05-08 16:21:22 +02:00
Danny 60cca7d40f add support for postgres too. closes #9 2018-05-08 15:41:48 +02:00
Danny 0683cac2bf use packr to embed migration files & web assets into binary. closes #8 2018-05-08 14:57:08 +02:00
Danny b4c7de0880 store hostname for each pageview & page stat 2018-05-08 13:21:36 +02:00
Danny b8ceff621d store hostname so we can track multiple subdomains in one fathom instance, if needed 2018-05-08 13:08:16 +02:00
Danny 02bcfbf503 generate default value for secret so that fathom can run using only default values 2018-05-08 12:45:24 +02:00
Danny 2ceaaeb9f5 add support for sqlite. #9 2018-05-08 12:31:51 +02:00
Danny 0a0476b5ae store accurate new session count & use that to determine bounce rate 2018-05-08 11:52:01 +02:00
Danny fe7eee2b73 clean-up data structure & add indices 2018-05-08 10:45:17 +02:00
Danny van Kooten ca3d258174 fix params test 2018-05-08 09:11:32 +02:00
Danny van Kooten 8e99bc5896 add test for GetRequestParams 2018-05-08 08:22:21 +02:00
Danny van Kooten 5e0ac22fe4 and finally, delete pageviews after processing to keep pageviews table nice & small 2018-05-07 19:45:42 +02:00
Danny van Kooten 95cd0e4053 implement referrers table 2018-05-07 19:33:52 +02:00
Danny van Kooten 9a9ea1687c imment referrer stats api route 2018-05-07 19:20:58 +02:00
Danny van Kooten 872bdd6141 define struct for all api params 2018-05-07 18:59:52 +02:00
Danny dac50c3da9 start cleaning up & implement page stats again 2018-05-07 17:01:20 +02:00
Danny 433c6e2f4d get general data flow up & running again for site stats 2018-05-07 16:05:53 +02:00
Danny van Kooten 082073afb8 [wip] move bulk of storage to client-side for improved scalability, simplicity and privacy. see #14. 2018-05-06 11:53:19 +02:00
Danny 5a403d536a first stab at time on site tracking. #20 2018-05-04 15:43:05 +02:00
Danny 86e5a7a957 simple bounce rate implementation. #21 2018-05-04 12:20:37 +02:00
Danny van Kooten 760780f07b use limit from request when getting pageviews 2018-05-03 21:01:51 +02:00
Danny d76cb6f24d stop storing ip address & browser version details. 2018-05-02 15:33:01 +02:00
Danny 47d8347ef1 universal handling of retrieving totals from datastore, incl. uniques. 2018-05-02 14:52:52 +02:00
Danny van Kooten 50556c44e9 prepare json data for new components, use fallback values in components 2018-05-01 20:02:05 +02:00
Danny c238a2abc3 use COALESCE instead of IFNULL, get rid of backticks. First steps towards Postgres compliance 2018-04-30 16:11:47 +02:00
Danny van Kooten ac15507023 stop exporting DB instance in datastore pkg. yay 2018-04-27 17:32:16 +02:00
Danny van Kooten a20e2b1227 move remaining queries to datastore pkg & bubble up errors to http handlers 2018-04-27 17:28:03 +02:00
Danny van Kooten b0d16b648b move remainder of aggregation funcs from count pkg to datastore pkg 2018-04-27 16:25:01 +02:00
Danny van Kooten 94b5a03d8e refactor part of count package to datastore, needs more work for other metrics besides pageviews 2018-04-26 20:40:00 +02:00
Danny van Kooten 80254ee4ee move pageview queries to datastore pkg & rebind query for other db engines than mysql 2018-04-26 19:30:15 +02:00
Danny bcfca8138b rewrite remaining queries in datastore pkg to use sqlx 2018-04-25 14:29:32 +02:00
Danny 8571c24a0d prepend forward slash for tracker.js asset, so we can omit it on cli argument 2018-04-25 14:04:09 +02:00
Danny f317603da3 rewrite datastore page funcs to use sqlx scanning 2018-04-25 14:01:42 +02:00
Danny 6f0ed92dfe use sqlx pkg for scanning user queries 2018-04-25 13:45:21 +02:00
Danny 2ac0abd02e move SaveUser func to datastore package and make it db driver agnostic 2018-04-25 13:25:34 +02:00
Danny 32f4299656 use envconfig to validate configuration values & handle default values 2018-04-25 13:05:29 +02:00
Danny b3ee15cc9a universal error handling in api pkg by returning errs from http handlers 2018-04-25 11:59:30 +02:00
Danny 08ce5e651d simplify build steps & don't store dist assets in VC 2018-04-25 10:15:24 +02:00
Danny 4faf4f9498 rename all go import paths to new repository location 2018-04-24 10:28:23 +02:00
Danny f83d6c2193 check err in user register command 2018-04-23 10:50:31 +02:00
Danny 93b285c0a9 change project directory structure to clean-up root dir 2018-04-20 13:12:23 +02:00