1.3.1 • Published 7 months ago

lesca-gtag v1.3.1

Weekly downloads
7
License
MIT
Repository
-
Last release
7 months ago

React React React React React NPM React NPM

Why use it?

use Google analytics in a simple way.

Live Demo

Installation

npm install lesca-gtag --save

Usage

install modules before DOM render

import Gtag from 'lesca-gtag';

// install on entry file
Gtag.install('your-gtag-id'); // get your id => https://analytics.google.com/analytics/web/

add pageview

import Gtag from 'lesca-gtag';

// page view
Gtag.pv('your-page-name');

add event

import Gtag from 'lesca-gtag';

<button
  onClick={() => {
    Gtag.event('your-page-name', 'action-name');
  }}
>
  send event
</button>

Development

Methods

methoddescriptionreturn
.install( id:string, debug:boolean )initialize gtagvoid
.inset(id:string)push dataLayer without gtag.js(use gtm maybe)void
.pv( pageName:string )add page viewvoid
.event(pageName:string, actionName:string)add eventvoid
.gtag( arguments:string )argumentsvoid

Features

  • maintain if necessary
1.3.1

7 months ago

1.3.0

12 months ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.2

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago