I have created a simple react app, and I try to send some events to mixpanel.
However nothing is sent. No api requests are shown in network console, when mixpanel.track('test') is called.
when mixpanel.init('token') is called, I receive this response:
{"notifications":[],"config":{"enable_collect_everything":false}}
this is my index.js:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
let mixpanel = require('mixpanel-browser');
mixpanel.init('my-secret-token');
mixpanel.track('test');
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
I have initialized my react app by create-react-app, and installed mixpanel-browser module.
I also have created mixpanel project, and triple checked that token.
Any ideas what I am doing wrong?
I have created a simple react app, and I try to send some events to mixpanel.
However nothing is sent. No api requests are shown in network console, when mixpanel.track('test') is called.
when mixpanel.init('token') is called, I receive this response:
{"notifications":[],"config":{"enable_collect_everything":false}}
this is my index.js:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
let mixpanel = require('mixpanel-browser');
mixpanel.init('my-secret-token');
mixpanel.track('test');
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
I have initialized my react app by create-react-app, and installed mixpanel-browser module.
I also have created mixpanel project, and triple checked that token.
Any ideas what I am doing wrong?
Share Improve this question edited Sep 13, 2018 at 11:51 Óscar Andreu 1,70014 silver badges32 bronze badges asked Aug 22, 2018 at 9:01 user3777939user3777939 4013 silver badges13 bronze badges3 Answers
Reset to default 14Anything that stops tracking can be the cause - Adblock is one possibility.
Another one is "Do not track" setting enabled on your browser.
There may be other plugins which you might have installed to avoid websites tracking you.
Ok, it seems to have something to do with my chrome browser. When using safari, everything works fine, but with chrome nothing is sent.
macOS: high sierra, 10.13.6 (17G65) chrome version: 68.0.3440.106
Do you have any adblocker?
I had the same issue and the problem was the uBlock chrome extension. Some adblockers prevent Mixpanel from loading on your page. To avoid this, I moved all the important events to the backend.
Here you have the Mixpanel information about adblockers:
https://help.mixpanel.com/hc/en-us/articles/115004499463-Ad-Blockers-Affect-Mixpanel