DavidWells / DavidWells/analytics

Segment Plugin Feature Request: Passing options to analytics.load()

Open
#506 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

Currently, the Segment plugin initialisation does not allow users to pass the optional second argument, options to the core analytics.load() function. This limits customisation when loading the Segment library.

We request the addition of a new property, loadOptions within the plugin configuration object. This property should accept the desired options object, which will then be passed directly to analytics.load() alongside the writeKey.

Proposed Implementation Change:

Instead of the current call:

analytics.load(writeKey);

The plugin should be modified to accept and utilize the loadOptions from the plugin configuration:

const { writeKey, loadOptions } = pluginConfig;
analytics.load(writeKey, loadOptions); // Pass loadOptions as the second argument

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 at the Segment plugin initialization and locate the current analytics.load(writeKey) call described in the issue. Add support for the plugin configuration's loadOptions and verify that analytics.load receives it as the second argument.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
analytics
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.