-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add pathname to analytics.page() #47
Conversation
@benjaminhoffman I'm not familiar with this codebase, but I think this is a good way to get the actual path for the segment payload |
yeah im not sure the best way for this. i defer to @newhouse for official review now :) |
Will have a look as soon as I can. Looks good at first glance though. |
@xtellurian while this code looks simple enough, I'm struggling to understand the issue that it's solving, and when. Is this about canonical link issues, still? More importantly, I wonder if this code change will actually break behavior for some users in some cases. Some more explanation would be appreciated, and also any code samples that I can use to replicate the issue/scenario this is solving for would be great! |
@newhouse I'm using this plugin in production. The paths I get in my segment events are all empty. My workaround is to manually call analytics.page() I don't think this plugin correctly captures the But I can see that analytics.js theoretically adds the path to all page() calls - https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/ |
@xtellurian we've seen issues in the past around page calls. it's very strange and I wouldn't rule out segment itself (I worked there as an engineer and we all knew page calls were kinda shaky anyway... we used track calls instead). see here: https://github.com/benjaminhoffman/gatsby-plugin-segment-js/issues?q=path |
Not that the effort is not appreciated, but I think that for now, unless you can provide a simple way to reproduce this that I can use to investigate and understand some more, it's probably not a good idea to merge this in. And unless the plugin is definitely not allowing I suspect there is something unique to your setup/use-case that's causing this to be an issue. If you can figure out what that is so I can replicate and investigate, let me know... Closing for now... |
Adds the pathname to analytics.page() call
Fix #13