segmentio / segmentio/analytics.js-integrations

[heap] There is no any possibility to turn off heap.

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

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
125
Forks
136
Avg merge
2h 45m
Merged PRs (30d)
1

Description

Migrated from #16 by @HovhannesB

#Details
Recently I had a problem with turning off the heap. If you load the lib with analytics.js there is no any possibility to turn it off. The only solution is to refresh the browser page and not to load the heap. In the case of single page applications refreshing the browser window is not the best idea.
I tried analytics.reset, analytics.off, analytics.integrations.heap.off.
By examining code it turned out that anonymous functions are set on event listeners and JS doesn't give you any opportunity to turn them off.

#Expected result
Adding a function like heap.shutDown(), that stops heap.

Contributor guide

No contributing guide indexed for this repository

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 the Heap integration and the existing analytics.reset, analytics.off, and analytics.integrations.heap.off entry points. Trace how its event listeners are registered and determine the shutdown behavior needed for a single-page application. Done means Heap can be stopped without refreshing the page, with the relevant behavior covered by tests if the integration has them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
analytics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.