https://github.com/deptno/gtag
https://github.com/deptno/gtag
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/deptno/gtag
- Owner: deptno
- Created: 2020-08-27T04:16:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T23:11:46.000Z (over 4 years ago)
- Last Synced: 2025-01-31T16:55:30.144Z (8 months ago)
- Language: TypeScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @deptno/gtag
GTag## install
```shell script
npm i @deptno/{gtag,gtag-react}
```## api
- config
`config` makes state and causes breaking type system.(not recommend)
- set
`set` makes state and causes breaking type system.(not recommend)
- event
`event` support default event types.
- action
`action` is user custom `event`## usage
```tsx
/* GlobalLayoutComponent */
import {config, set, event, action} from '@deptno/gtag'
import {GTag} from '@deptno/gtag-react'export const GlobalLayoutComponent = _ => {
useEffect(() => {
action('user_custom_action_name', {
event_category: 'user_category',
})
action('user_custom_action_name', {
event_category: 'user_category',
})
}, [])return (
<>
>
)
}```
## package
- [@deptno/gtag](/packages/gtag)
typescripted gtag wrapper
- [@deptno/gtag-react](/packages/gtag-react)
gtag component## license
MIT