Skip to content

Releases: lukeed/ganalytics

v3.1.3

29 Jan 02:15
Compare
Choose a tag to compare

Patches

  • Add missing types for uid and cid to CommonParams interface (#14): 914f2bf

Chores

  • Add missing documentation for uid vs cid parameters (#14): 914f2bf

v3.1.2

08 May 18:05
Compare
Choose a tag to compare

Chores

  • NEW Added TypeScript support! (#11, #13): 1666f00, 54d05da, fb80bb9

    Thank you @rand0me~!

    Definitions include and export interfaces for all Event data objects, and will also swap the inferred interface for you based on the .send(...) value.

    import GAnalytics from "ganalytics";
    
    const GA = GAnalytics('UA-asd', {
      //
    });
    
    GA.send('pageview');
    GA.send('exception');
    
    GA.send('transaction');
    // Argument of type '"transaction"' is not assignable to parameter of type 'EventOptional'
    
    GA.send('event', {
      ec: 123
      // Type 'number' is not assignable to type 'string'.ts(2322)
      // The expected type comes from property 'ec' which is declared here on type 'EventParams'
    });
  • Update build tool: 8e5f096

v3.1.1

18 Oct 21:14
Compare
Choose a tag to compare

Patches

  • Move localStorage assignment into constructor call: ac99986
    This is friendlier to server-side usage as a global.localStorage shim is no longer needed on import.

Refactor

Chores

v3.1.0

13 Oct 19:32
Compare
Choose a tag to compare

Features

  • NEW Added toWait argument to skip the "pageview" event upon initialization: (#5)

    Thanks @antonk52!

  • NEW The ganalytics UMD build is now available on unpkg.com 🎉

    Check it out: https://unpkg.com/ganalytics

  • NEW You are now able to initialize ganalytics without using new

    However, you still can if you want to!

    import GA from 'ganalytics';
    
    // Before (this still works);
    const foo = new GA(...);
    foo.send('event', ...);
    
    // After: 
    const bar = GA(...);
    bar.send('event', ...);

Miscellaneous

  • Refactor: Inline all methods for significant byte savings: dc003bc, b4b86df
    Dropped almost 100 bytes (-21%)!

  • The module entry now uses .mjs extension: 06e1eb3
    For the bundler(s) that prefer it to .js

Chores

v3.0.0

12 Jan 16:53
Compare
Choose a tag to compare

Major Changes

BREAKING: Removed DNT listener: ae18cc0

This was already a major difference compared to the official GA client, so websites that switched to ganalytics were reporting a sudden "drop" in visitors. By ignoring the DNT, we are now inline with the official client.

If you're feeling honorable and would like to continue respecting your users' DNT setting, you may instead anonymize your user's IP addresses (via opts.aip) or limit your installation to the 2.x.x version.

$ npm install ganalytics@2

Patches

v2.0.0

26 Jul 19:26
Compare
Choose a tag to compare

Major Changes

  • BREAKING: Removed get option: 66cc1b2, 96465d3

    GAnalytics is now firing GET requests via new Image().src = url, which works natively in all browsers. AKA, no fetch polyfills or replacements are needed! Credit to @developit and @kristoferbaxter 🎉

  • BREAKING: Removed inline assign helper: 43f87b8, 275565e

    GAnalytics now ships with Object.assign by default. This means that there is no Internet Explorer support by default.

    However, Babel users may install babel-plugin-transform-object-assign to quickly regain IE compatibility! This is possible because the plugin will replace instances of Object.assign with _extends, an injected Babel helper.

Patches