Releases: lukeed/ganalytics
v3.1.3
v3.1.2
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
Patches
- Move
localStorage
assignment into constructor call: ac99986
This is friendlier to server-side usage as aglobal.localStorage
shim is no longer needed on import.
Refactor
Chores
v3.1.0
Features
-
NEW Added
toWait
argument to skip the"pageview"
event upon initialization: (#5)Thanks @antonk52!
-
NEW The
ganalytics
UMD build is now available onunpkg.com
🎉Check it out: https://unpkg.com/ganalytics
-
NEW You are now able to initialize
ganalytics
without usingnew
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
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
Major Changes
-
BREAKING: Removed
get
option: 66cc1b2, 96465d3GAnalytics is now firing GET requests via
new Image().src = url
, which works natively in all browsers. AKA, nofetch
polyfills or replacements are needed! Credit to @developit and @kristoferbaxter 🎉 -
BREAKING: Removed inline
assign
helper: 43f87b8, 275565eGAnalytics 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 ofObject.assign
with_extends
, an injected Babel helper.