0.0.9 • Published 9 months ago

@moosesaeed/ga-gtag-partytown v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Global site tag (gtag.js) - Google Analytics

npm npm bundle size (minified)

ES module for the Google Analytics Global Site Tag.

Install

$ npm install --save ga-gtag

Usage

import { gtag, install } from 'ga-gtag';

// Substitute your tracking ID (begins with "G-", "UA-", "AW-" or "DC-")
install('G-##########'); 

install() adds the Global Site Tag script element into <head>. It only needs to be called once, but can safely be called multiple times (the script won't be re-added).

install() also has a second, optional argument that can be used to specify additional config info for the initialization (for instance to disable pageview measurement):

install('G-##########', { 'send_page_view': false });

From there, gtag() can be used as specified in Google's documentation:

gtag('event', 'login', { 'method': 'Google' });
0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago