Socket
Socket
Sign inDemoInstall

@r/google-tag-manager

Package Overview
Dependencies
2
Maintainers
13
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @r/google-tag-manager

A wrapper for google tag manager with a builtin jail.


Version published
Weekly downloads
11
increased by1000%
Maintainers
13
Install size
45.2 kB
Created
Weekly downloads
 

Readme

Source

r/google-tag-manager

A wrapper for google tag manager with a builtin jail.

Change Log

v0.0.0

Initial release

v0.1.0
v0.2.0
  • Include additional location / referrer data in default payload.
v0.2.2
  • Update @r/frames dependency
v0.2.3
  • Queue events until to loaded event returns from jail.
v0.2.6
  • Release assets are packaged with the build, rather than compiled upon install
v0.2.7
  • Updates @r/frames so that this package will not break server environments

Installation

yarn add @r/google-tag-manager -s

Usage example

import * as gtm from '@r/google-tag-manager';

// initialize gtm
gtm.setup({
  containerId: 'GTM-XXXXXX',
  host: 'redditmedia.com',
  payload: {
    user: 1234,
    subreddit: 'WhatsSnoo',
  },
});

// trigger events (payload optional)
gtm.trigger('pageview', {
  subreddit: 'announcements',
});
gtm.trigger('loggedout');

TODO

  1. Add tests
  2. Convert to typescript

FAQs

Last updated on 17 Oct 2019

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