Socket
Socket
Sign inDemoInstall

@moosesaeed/partytown-ga-gtag

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @moosesaeed/partytown-ga-gtag

ES module for the Google Analytics Global Site Tag with partytown attribute.


Version published
Weekly downloads
3
decreased by-80%
Maintainers
1
Install size
7.23 kB
Created
Weekly downloads
 

Changelog

Source

0.0.12 (2023-08-06)

Bug Fixes

  • :bug: (e90ce06)

Readme

Source

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' });

Keywords

FAQs

Last updated on 06 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc