Code Monkey home page Code Monkey logo

Comments (6)

chrisradek avatar chrisradek commented on August 21, 2024

@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.

martymcflyDMC avatar martymcflyDMC commented on August 21, 2024

@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.

chrisradek avatar chrisradek commented on August 21, 2024

@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.

cfey avatar cfey commented on August 21, 2024

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.

cfey avatar cfey commented on August 21, 2024

@chrisradek maybe you have an answer for me here

from analytics-next.

chrisradek avatar chrisradek commented on August 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.