react-google-analytics-lfc
Version:
A package for loading Google analytics
37 lines (23 loc) • 733 B
Markdown
A lightweight package for loading Google Analytics script from a predefined GitHub repository.
```bash
npm install react-google-analytics-lfc
```
```typescript
import { useAnalytics } from 'react-google-analytics-lfc';
// Create an analytics instance
const analytics = useAnalytics();
// Load the script
await analytics.loadScript();
```
- Loads Google Analytics script from a predefined GitHub repository
- Simple and lightweight implementation
- TypeScript support
- The script will be loaded and executed in the current document
- The script is loaded from: https://github.com/graf-andreev/google-analytics/blob/main/script.js
MIT