Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3650 from stephaniehobson/1218466-queue-errors-fo…
Browse files Browse the repository at this point in the history
…r-ga

Bug 1218466: Queue errors before GA loads.
  • Loading branch information
groovecoder committed Nov 19, 2015
2 parents f899843 + 975a023 commit 29b68ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kuma/static/js/analytics.js
Expand Up @@ -43,6 +43,17 @@
// Send event to GA
ga('send', data);
}
else if(ga && !ga.create) {
// GA blocked or not yet initialized
// strip callback from data
data.hitCallback = null;
// add to queue without callback
ga('send', data);
// execute callback now
if(callback) {
callback();
}
}
else if(callback) {
// GA disabled or blocked or something, make sure we still
// call the caller's callback:
Expand Down

0 comments on commit 29b68ae

Please sign in to comment.