segmentio / analytics-next

Segment Analytics.js 2.0
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript
MIT License
403 stars 136 forks source link

Amplitude Integration not loading correctly #1029

Closed Dgiulian closed 8 months ago

Dgiulian commented 8 months ago

I have the Amplitude Integration configured in Segment. But it's not loading correctly using @segment/analytics-next.

When I track an event the payload includes this metadata


"_metadata": {
    "failedInitializations": [
      "Amplitude"
    ],
    "bundled": [
      "Amplitude",
      "Intercom",
      "Segment.io"
    ],
    "unbundled": [],
    "bundledIds": [
      ".....",
      "....."
    ]
}

this is the code I'm using to load Segment:

  const [analytics] = useState(
    import.meta.env.VITE_SEGMENT_KEY
      ? AnalyticsBrowser.load({
          writeKey: import.meta.env.VITE_SEGMENT_KEY,
        })
      : undefined,
  );

After checking in Segment I can see the event being tracked, but it's not getting through to Amplitude.

I can see the https://cdn.segment.com/v1/projects/<WriteKey>/settings being called and includes the correct Amplitude apiKey.

The console is showing this error when Segment loads:

image

silesky commented 8 months ago

@Dgiulian, sorry you're having an issue.

Can you take out a support ticket through the Segment website? This repo does not include the actual action destinations themselves.