micro-analytics / micro-analytics/micro-analytics-cli

Analytics on homepage?

Open
#80 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
732
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Attempting to GET the / endpoint yields Please include a path to a page. on the client and:

Error: Please include a path to a page.
    at createError (/app/node_modules/micro/lib/server.js:152:15)
    at analyticsHandler (/app/node_modules/micro-analytics-cli/src/handler.js:58:11)
    at /app/node_modules/micro-analytics-cli/src/handler.js:109:16
    at resolve (/app/node_modules/micro/lib/server.js:24:34)
    at Promise._execute (/app/node_modules/bluebird/js/release/debuggability.js:300:9)
    at Promise._resolveFromExecutor (/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/app/node_modules/bluebird/js/release/promise.js:79:10)
    at Function.exports.run (/app/node_modules/micro/lib/server.js:24:3)
    at Server.server (/app/node_modules/micro/lib/server.js:13:50)
    at emitTwo (events.js:126:13)
    at Server.emit (events.js:214:7)
    at parserOnIncoming (_http_server.js:602:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)

in the server logs. Is there any way to track events at the root page?

For example, running fetch(`https://my-micro.analytics/${location.pathname}`) doesn’t record visits to the homepage.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with analyticsHandler in micro-analytics-cli/src/handler.js, the entry point named in the stack trace, and reproduce GET / alongside a request for a page path. Determine the intended behavior for root-page tracking and define a test that distinguishes valid root events from missing-page errors; done means homepage visits are recorded without the current error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
analytics, api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.