benjaminhoffman / gatsby-plugin-segment-js

Gatsby plugin for segment.com's analytic.js snippet
https://www.npmjs.com/package/gatsby-plugin-segment-js
MIT License
40 stars 28 forks source link

Will this plugin support segment 2.0? #49

Closed collinwu closed 1 year ago

collinwu commented 2 years ago

Hi maintainers,

I appreciate all you do. ๐Ÿ™

A concern came up about Segment deprecating v1 of their analytics.js library this year? Will this plugin support analytics.js 2.0?

Adding link for reference:

https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2/

benjaminhoffman commented 2 years ago

i have no plans to unfortunately... unless someone from the community wants to jump in

newhouse commented 2 years ago

I'm not sure that there's anything we need to do?

The only call we make is a page and the signature for that method does not appear to have changed.

And the docs say the upgrade process is done on the Segment side of things and requires no code changes. I'm guessing the snippet we are including will download whatever version of Analytics that your account key suggests it should.

So, I'm guessing this will just workโ„ข๏ธ.

benjaminhoffman commented 2 years ago

well said @newhouse ... for those reading this, see here how to upgrade: https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2/

it appears there's no required changes on our end

collinwu commented 2 years ago

oh interesting. i thought they may have at least changed the script url to ${host}/analytics.js/v1/" + key + "/analytics.min.js to ${host}/analytics.js/v2/${key}/...

thank you gentlemen for looking into this more. i should have done so on my part before opening this ticket

๐Ÿ™

newhouse commented 2 years ago

If that turns out not to be the case, please let us know @collinwu

collinwu commented 2 years ago

Will do thanks y'all!