@terra-dev/use-google-analytics
v0.20.1
Published
In this time, there are no suitable Google Analytics's new `gtag` supported library.
Downloads
33
Readme
@terra-dev/use-google-analytics
In this time, there are no suitable Google Analytics's new gtag
supported library.
This library only support gtag
. If you want to use the legacy Google Anlaytics you can make better that use react-ga
Usage
import { GoogleAnalytics } from '@terra-dev/use-google-analytics';
function App() {
return (
<>
<GoogleAnalytics trackingId={YOUR_TRACKING_ID} />
<App />
</>
);
}
Or
import { useGoogleAnalytics } from '@terra-dev/use-google-analytics';
function App() {
useGoogleAnalytics({ trackingId: YOUR_TRACKING_ID });
return <App />;
}