micro-analytics / micro-analytics-cli

Public analytics as a Node.js microservice. No sysadmin experience required! πŸ“ˆ
MIT License
734 stars 39 forks source link

Add support for metadata with post requests #71

Closed relekang closed 7 years ago

relekang commented 7 years ago

Excerpt from docs:

You can add more metadata to the view by posting a JSON payload with the field meta. Everything in that meta field will be set on meta in the view object. You can read the data out with the all option, see below for more info. Example request that will post the browser useragent string:

 <script>
   fetch('servicedomain.com' + window.location.pathname, {
     method: "POST",
     credentials: "include",
     headers: {"Content-Type": "application/json"},
     body: JSON.stringify({meta: { browser: navigator.userAgent }}),
   })
 </script>
codecov-io commented 7 years ago

Codecov Report

Merging #71 into master will increase coverage by 0.17%. The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   75.28%   75.46%   +0.17%     
==========================================
  Files          10       10              
  Lines         259      269      +10     
  Branches       44       46       +2     
==========================================
+ Hits          195      203       +8     
- Misses         59       61       +2     
  Partials        5        5
Impacted Files Coverage Ξ”
packages/micro-analytics-cli/src/handler.js 72.88% <88.23%> (+1.45%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update e809e7e...1cd9650. Read the comment docs.

relekang commented 7 years ago

That is a very good idea πŸ˜…

relekang commented 7 years ago

Updated the readme :v: