🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

analyticstride

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

analyticstride

Simple analytics tracking component for React applications

unpublished
latest
Source
npmnpm
Version
1.2.2
Version published
Maintainers
0
Created
Source

AnalyticStride

A simple, lightweight analytics tracking component for React applications. Just add the component and get instant analytics!

Installation

npm install analyticstride
# or
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'; // If using in a Server Component

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" // Use your own server
  apiKey="your-api-key" // For premium features
  onCollect={(data) => {
    // Optional callback when data is collected
    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

Keywords

analytics

FAQs

Package last updated on 02 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts