This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

gtag-opt-in

3.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i gtag-opt-in

Weekly Downloads

499

Version

3.0.0

License

MIT

Unpacked Size

9.75 kB

Total Files

7

Last publish

Collaborators

  • luciomartinez