DavidWells / DavidWells/analytics

Plugin function and event handler parameters are not documented

Open
#301 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.7k
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Looking at the docs I don't know what to expect as the parameters to initialize, page, track, and so on.

I do see it's an object with fields like payload, instance, config. But what are those things? I can infer config is the config of my plugin and payload is what was passed to the original track or page call. What is instance ?

When I call analytics.track('some event', { ... payload ... }), where does the event name go? Is it assigned into the payload or somewhere else?

I think I can piece it together by analyzing the code and plugins but it would be nice to beef up the docs in those areas for the benefit of others trying to write some custom plugins.

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 by reading the implementation of the initialize, page, and track handlers and the existing plugin documentation, then compare them with example plugins. Document the meanings of payload, instance, and config, including where the event name from analytics.track is placed. Done means a plugin author can determine each handler parameter from the docs without reverse-engineering the code.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.