Skip to main content
Question

Issues with amplitude.init() for React Web App

  • 17 June 2024
  • 0 replies
  • 91 views

I have a react based front end web app that I am trying to use Amplitude to start doing user tracking. I’m following the tutorials with having the 

import * as amplitude from '@amplitude/analytics-browser';

and then trying to initialize amplitude using the following in my App.tsx file 

useEffect(() => {

amplitude.init(<insert API key here>); // need to put this key in another .env file later

}, >]);

 

In my package.json my version is “@amplitude/analytics-browser": "^2.9.0"

 

However when looking at my console output I keep getting the error message: POST https://api2.amplitude.com/2/httpapi net::ERR_NAME_NOT_RESOLVED. Does anyone know why I can’t seem to initialize amplitude?

0 replies

Be the first to reply!

Reply