Socket
Socket
Sign inDemoInstall

gtag-opt-in

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gtag-opt-in

Google Analytics Opt In


Version published
Weekly downloads
520
decreased by-7.14%
Maintainers
1
Install size
9.52 kB
Created
Weekly downloads
 

Readme

Source

GTag Opt In · Tests Status

Google Analytics Opt In

GTag Opt In is a browser library to opt-in in Google Analytics. Plus, it configures Analytics to anonymize IP. See why and when to use it by reading the wiki page.

Install

NPM

npm install gtag-opt-in

Yarn

yarn install gtag-opt-in

HTML

<script src="https://www.npmcdn.com/gtag-opt-in"></script>

It imports the library as the GTagOptIn global variable.

Use

ES6

import * as GTagOptIn from 'gtag-opt-in';

GTagOptIn.register('UA-XXXXXXXXX-Y');
GTagOptIn.optin();
GTagOptIn.optout();

HTML

<script>
  GTagOptIn.register('UA-XXXXXXXXX-Y');
  GTagOptIn.optin();
  GTagOptIn.optout();
</script>

Documentation

Further documentation can be found at the wiki page.

Future

The library destiny is to be replaced with official support once Google Analytics releases the Consent mode feature which is currently under beta.

License

Software licensed under MIT license. See the LICENSE file.

Keywords

FAQs

Last updated on 21 Dec 2021

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