Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extra information for Page method in Angulartics2Segment #408

Open
1 of 3 tasks
npinciak opened this issue Feb 26, 2021 · 0 comments
Open
1 of 3 tasks

Allow extra information for Page method in Angulartics2Segment #408

npinciak opened this issue Feb 26, 2021 · 0 comments

Comments

@npinciak
Copy link

For support questions, please consider using Gitter - Chat

I'm submitting a ...

  • bug report

  • feature request

  • question about the decisions made in the repository

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior?

As a user, I should be able to add extra information when firing a Page tracking event using Segment, so I can gain more granular information on user behavior

  • What is the motivation / use case for changing the behavior?

Right now, the Page track method only supports a string, which severely inhibits the behavior of Segment's Page method.

   * https://segment.com/docs/libraries/analytics.js/#page
   *
   * analytics.page([category], [name], [properties], [options], [callback]);
   */
  pageTrack(path: string) {
    // TODO : Support optional parameters where the parameter order and type changes their meaning
    try {
      analytics.page(path);
    } catch (e) {
      if (!(e instanceof ReferenceError)) {
        throw e;
      }
    }
  }

The jsdoc even shows the ability to add these options parameters, which makes it very confusing (and a tad bit frustrating)

  • Environment:
Angular CLI: 11.0.7
Node: 14.15.4      
OS: win32 x64      

Angular: 11.0.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1100.7
@angular-devkit/build-angular      0.1100.7
@angular-devkit/core               11.0.7
@angular-devkit/schematics         11.0.7
@angular/cdk                       11.0.4
@angular/cli                       11.0.7
@angular/flex-layout               11.0.0-beta.33
@angular/material                  11.0.4
@angular/material-moment-adapter   11.0.4
@schematics/angular                11.0.7
@schematics/update                 0.1100.7
rxjs                               6.5.4
typescript                         4.0.5
@npinciak npinciak changed the title Allow extra information for Page method Allow extra information for Page method in Angulartics2Segment Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant