npm install @identitysquare/cookiechimp-segment-wrapper
npm install @segment/analytics-nextimport { withCookieChimpCMP } from '@identitysquare/cookiechimp-segment-wrapper'
import { AnalyticsBrowser } from '@segment/analytics-next'
export const analytics = new AnalyticsBrowser()
withCookieChimpCMP(analytics).load({
writeKey: '<MY_WRITE_KEY>'
})If Segment is a Required vendor, you can enable it to load in opt-in locations before consent is given while ensuring non-required destinations remain blocked.
withCookieChimpCMP(analytics, { alwaysLoadSegment: true }).load({
writeKey: '<MY_WRITE_KEY>'
})