Closed xtellurian closed 2 years ago
@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 path
when analytics.page() is called.
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
@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
path
when analytics.page() is called.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/
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 segment
defaults to do their thing for 100% of users of this plugin, this would be a "breaking change", not a bugfix.
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