AnalyticStride
A simple, lightweight analytics tracking component for React applications. Just add the component and get instant analytics!
Installation
npm install analyticstride
yarn add analyticstride
Usage
Simply add the Analytics component to your app:
React
import { Analytics } from 'analyticstride';
function App() {
return (
<div>
<Analytics />
{/* Your app content */}
</div>
);
}
Next.js
'use client';
import { Analytics } from 'analyticstride';
function App() {
return (
<div>
<Analytics />
{/* Your app content */}
</div>
);
}
That's it! Your analytics will be automatically collected and stored.
Advanced Configuration (Optional)
You can customize the analytics tracking with props:
<Analytics
endpoint="https://your-custom-server.com/analytics"
apiKey="your-api-key"
onCollect={(data) => {
console.log('Analytics data:', data);
}}
/>
What's Collected
The component automatically collects and stores:
- Current page path
- Timestamp
- Referrer
- User agent
- Screen resolution
- Browser language
- Hostname
Self Hosting (Optional)
By default, analytics data is stored in our cloud. If you prefer to self-host:
- Clone the server repository
- Follow the server setup instructions in the server directory
- Update the endpoint in your Analytics component to point to your server
View Your Analytics
Access your analytics dashboard at https://analyticstride.com/dashboard
(Sign up for an API key to access premium features)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
ISC