UNPKG

react-google-analytics-lfc

Version:

A package for loading Google analytics

37 lines (23 loc) 733 B
# React Google Analytics LFC A lightweight package for loading Google Analytics script from a predefined GitHub repository. ## Installation ```bash npm install react-google-analytics-lfc ``` ## Usage ```typescript import { useAnalytics } from 'react-google-analytics-lfc'; // Create an analytics instance const analytics = useAnalytics(); // Load the script await analytics.loadScript(); ``` ## Features - Loads Google Analytics script from a predefined GitHub repository - Simple and lightweight implementation - TypeScript support ## Notes - 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 ## License MIT