Thanks to visit codestin.com
Credit goes to github.com

Skip to content

deptno/gtag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@deptno/gtag

GTag

install

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

/* 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 (
    <>
      <!-- ... -->
      <GTag id={YOUR_GA_ID} />
    </>
  )
}

package

license

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •