Skip to content

Commit

Permalink
breaking: dispatch GET via Image()
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jul 26, 2017
1 parent 954e0ec commit 66cc1b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function assign(tar) {

function GA(ua, opts) {
opts = opts || {};
this.get = opts.get || window.fetch.bind();
this.args = assign({ tid:ua, cid:UID }, opts);
this.send('pageview');
}
Expand All @@ -35,7 +34,7 @@ GA.prototype.send = function (type, opts) {
opts = { dl:location.href, dt:document.title };
}
var obj = assign({ t:type }, this.args, opts, { z:Date.now() });
this.get(encode(obj)); // construct url; send POST
new Image().src = encode(obj); // dispatch a GET
}

export default GA;

0 comments on commit 66cc1b2

Please sign in to comment.