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

Custom events not working #4

Open
paymog opened this issue Dec 8, 2020 · 1 comment
Open

Custom events not working #4

paymog opened this issue Dec 8, 2020 · 1 comment

Comments

@paymog
Copy link

paymog commented Dec 8, 2020

I've successfully installed Segment using this tool which is amazing - I'm seeing page views appear in the Segment debugger.

However, when I try to perform event tracking the events never appear in the Segment debugger. I've verified that there are no problems in the console but I'm not sure how to continue debugging.

Here's how I'm firing the custom event

export const emitMetric = (category, action, label) => {
  analytics.default.track(category, {
    action: action,
    label: label,
  })
};

this function is called from various parts of my codebase. I've verified with the chrome debugger that these lines of code are hit during navigation of the website. Even still, I don't see the events appear in the Segment debugger.

I've verified that the debugger has all event types filtered too.

image

@anishmprasad any chance you know why I might not be getting events here? Could it be a problem with the package or how I'm using it?

EDIT: and here's the chrome debugger successfully hitting the function with string values

image

@paymog
Copy link
Author

paymog commented Dec 8, 2020

Interestingly, I just added window.analytics.track(category) to the function above and those calls successfully appear in the debugger.

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