Comments (6)
@martymcflyDMC Thanks for opening this issue.
The integrations from analytics.js-integrations
don't conform to the Plugin interface. Both the Plugin
interface and the integrations have a load
method, but they accept different arguments. That's why you're getting the callback error - the library is attempting to call load()
on a plugin but gets an integration instead.
Internally we have the LegacyDestination plugin that handles wrapping integrations but it expects to be loading an integration from the segment CDN.
Can you share more about why you're trying to load an integration directly rather than have the library load it based on the source settings? I don't believe we have an easy way to do what you want today but if we understand your use-case better we may be able to suggest an alternative or consider adding this functionality.
from analytics-next.
@chrisradek Thanks for the reply
Is there a version of analytics.js-integrations
that conform to the Analytics next Plugin interface?
So you are saying I can do the following to load extra integrations from the analytics.js-integrations
library?
AnalyticsBrowser.load({
cdnSettings: {
integrations: {
'Segment.io': {}
Amplitide: {
apiKey: 'abc',
},
},
},
plugins: [cutomPlugin],
}).then(r => {
console.log(r)
})
from analytics-next.
@martymcflyDMC
Are you trying to use some integrations without setting them up as part of your Segment source, or are you developing your own integration?
from analytics-next.
Hi,
I got a similar question
I want to use this open source library and one or two integrations from @segmentio/analytics.js-integrations
For using an standardized interface for tracking. Let's say I use HubSpot, FB Pixel and one custom Destination (own API).
How can I bundle these to get a standalone .js
file or better to request the integrations and this library to be build into my project
Is this possible and if yes, how?
from analytics-next.
@chrisradek maybe you have an answer for me here
from analytics-next.
@cfey It's not currently possible to import integrations directly with this library. Right now you'd need to rely on analytics-next fetching those integrations based on your source configuration. We do want to support being able to import these integrations directly though. Marking as a feature request.
from analytics-next.
Related Issues (20)
- In a sandboxed environment, addEventListener may not behave as expected
- Protocol support for batching?
- Mocking with Jest or Vitest is VERY hard HOT 1
- [Feature Request] Add ability to listen to identity changes HOT 3
- Delete
- ReferenceError: getGlobalCDNUrl function window is not defined HOT 3
- DestinationMiddlewareFunction type is missing from export HOT 1
- Feature request to expose fetch mechanism? HOT 3
- Track method missing events in source debugger HOT 2
- Missing return types and promises not awaited HOT 5
- Provide a way to lazy load AnalyticsBrowser without pulling in all the other dependencies HOT 4
- SSR broke in v1.58.0 HOT 6
- Segment broke with next js 13.5.2 HOT 3
- Segment is not loaded when OneTrust consent integration is setup and jurisdiction does not require a banner to be shown. HOT 4
- OneTrust integration - support a required group for loading a.js HOT 3
- Destination filters only applying *sometimes*? HOT 2
- Delete
- Metrics Calls When using a Proxy HOT 1
- support flush on demand for node.js client HOT 2
- Update vulnerable axios version in `@segment/analytics-node` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics-next.