Nine Putrid Mangos

    @r/google-tag-manager

    0.2.7 • Public • Published

    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

    Keywords

    none

    Install

    npm i @r/google-tag-manager

    DownloadsWeekly Downloads

    15

    Version

    0.2.7

    License

    UNLICENSED

    Unpacked Size

    7.82 kB

    Total Files

    4

    Last publish

    Collaborators

    • redditnpm2
    • schwers
    • madlee
    • wick