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

Proposal: allow endPaint to accept a customProperties object to do custom reporting #68

Closed
dmatteo opened this issue May 20, 2019 · 2 comments
Assignees
Milestone

Comments

@dmatteo
Copy link

dmatteo commented May 20, 2019

The current API for endPaint only allows a metric name to be passed in, which is limiting the potential to report additional properties, especially when using custom analytics tracking.

The proposed syntax will accept the object, and surface it in logging statements and analytics tracking, e.g.

on the tracking side

perfume.endPaint(METRIC_NAME, { page: '/login' }

on the reporting site

export const perfumeOptions = {
    firstContentfulPaint: true,
    firstInputDelay: true,
    analyticsTracker: (metricName: string, duration: number, browser?: *, customProperties: { [key:string]: string }) => {
        track(`custom_tracking_${metricName}`, {
            duration,
            ...customProperties
        });
    },
    logging: false,
};

export const perfume = new Perfume(perfumeOptions);

I'll be following up this issue with a PR soon 😄

@Zizzamia
Copy link
Owner

Amazing, thank you for taking the time to write the PR. Before moving forward I need to change the way logging and sendTiming is done to support more flexible behavior.

#69 (comment)

@Zizzamia Zizzamia added this to the v3.0.0 milestone Sep 29, 2019
@Zizzamia Zizzamia self-assigned this Sep 29, 2019
@Zizzamia Zizzamia modified the milestones: v3.0.0, v3.1.0 Oct 13, 2019
@Zizzamia Zizzamia modified the milestones: v3.1.0, v3.2.0 Nov 12, 2019
@Zizzamia Zizzamia modified the milestones: v4.6.0, v4.4.0 Dec 1, 2019
Zizzamia added a commit that referenced this issue Dec 1, 2019
@Zizzamia
Copy link
Owner

Zizzamia commented Dec 1, 2019

This feature will be available with v4.4.0.
Really appreciated the feedback 🔥🔥🔥

@Zizzamia Zizzamia closed this as completed Dec 1, 2019
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

2 participants