Step-by-step guides to install EazyStats tracking code on your platform
Follow these simple steps to integrate EazyStats analytics into your React application and start tracking your users.
The recommended way to add scripts to all pages in a React application is by adding it to your root component.
Usually App.jsx or main.jsx
import { useEffect } from 'react';
function App() {
useEffect(() => {
// Add EazyStats script
const script = document.createElement('script');
script.defer = true;
script.setAttribute('data-site-id', 'your_website_id');
script.setAttribute('data-site-domain', 'yourdomain.com');
script.src = 'https://eazystats.com/tracker.js';
document.head.appendChild(script);
// Cleanup on unmount
return () => {
if (document.head.contains(script)) {
document.head.removeChild(script);
}
};
}, []);
return (
// Your app content
);
}
export default App;
Important: Make sure to replace the placeholder values:
your_website_id → Your actual Website ID from EazyStatsyourdomain.com → Your website's root domainYou can also add the script directly to your public/index.html file if you prefer:
<script
defer="" data-site-id="your_website_id" data-site-domain="yourdomain.com" src="https://eazystats.com/tracker.js"
> </script>After implementing either method above, follow these steps to verify everything is working:
Visit your live website
View your dashboard for incoming data
Data appears within a few minutes
Your React app should now be tracking visitors with EazyStats. Check your dashboard to see your analytics!