Open Titou325 opened 3 years ago
hey @Titou325, unfortunately this is not possible with the existing implementation of consent manager. The consent manager assumes that analytics
is available on the window
object ( in this method ) , and therefore, using the npm
package is not compatible. This can be a good future improvement for consent manager, so I'll take a note and discuss with the team internally.
This feature would be very useful. In our implementation we would like to share the methods to call segment in the frotend and in our firebase functions. Due to this restriction we need to have the snippet on the frontend and then the @segment/analytics-next on the backend(functions) to also use it there.
Are there any news? When will it be possible to use it with @segment/analytics-next
?
We already using the new library as written in your documentation.
Also the old analytics.js
is soon out of support.
On August 31, 2022, Segment will end support and maintenance for Analytics.js Classic https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2/
The consent manager assumes that
analytics
is available on thewindow
object ( in this method ) , and therefore, using thenpm
package is not compatible.
I don't understand - can we not use this?
There is documentation that says V2 is backwards compatible with V1... but then this Consent Manager doesn't work so it's not backwards compatible.
Can someone explain what is missing / incompatible and what is needed to support V2? Perhaps the community can help upgrading it.
@seanlail consent manager is only incompatible when using AJS 2.0 as an npm package. If using V2, but also using Segment Snippet to load AJS, consent manager still works as expected.
Is there a timeline for future support? If the library is backwards compatible with AJS 1.0 why can we simply not do:
window.analytics = AnalyticsBrowser.load({ writeKey }) // import from analytics-next
before ConsentManager is loaded?
Any movement on this? Wanted to move to using the @segment/analytics-next
package in our project alongside ConsentManagerBuilder, but found out from looking through the code that it wasn't possible before finding this issue. I wanted to try @jayoutdoorsy's approach to see what would happen, but apparently the AnalyticsBrowser
has completely different typings from AnalyticsSnippet
Bump!
Up!
Bump
It looks like Segment included a consent-management tool inside of their @segment/analytics-next
package: https://github.com/segmentio/analytics-next/tree/master/packages/consent
I haven't used it yet, but I'm confident it's compatible with the rest of analytics-next
Hi, thanks a lot for this plugin which is very useful!
We are trying to move to @segment/analytics-next as part of our integrated React codebase and as such are now using webpack to bundle the analytics. It thus seems that they are no longer available at window.analytics and we can't use react hooks on the consent response.
Here is an example of the code that we have :
How could we easily adapt this to work with the consent manager API, especially the custom consent manager? I guess it should be documented if feasible. Let us know if we can be of any help.
Have a nice day!