Preserve ability to disable analytics behavior, explicitly document this option
This commit is contained in:
@@ -9,14 +9,16 @@ module.exports = function(options) {
|
||||
this.options.switches = this.options.switches || {}
|
||||
this.options.switchesOptions = this.options.switchesOptions || {}
|
||||
this.options.history = this.options.history || true
|
||||
this.options.analytics = (typeof this.options.analytics === "function") ? this.options.analytics : function() {
|
||||
if (window._gaq) {
|
||||
_gaq.push(["_trackPageview"])
|
||||
this.options.analytics = (typeof this.options.analytics === "function" || this.options.analytics === false) ?
|
||||
this.options.analytics :
|
||||
function() {
|
||||
if (window._gaq) {
|
||||
_gaq.push(["_trackPageview"])
|
||||
}
|
||||
if (window.ga) {
|
||||
ga("send", "pageview", {page: location.pathname, title: document.title})
|
||||
}
|
||||
}
|
||||
if (window.ga) {
|
||||
ga("send", "pageview", {page: location.pathname, title: document.title})
|
||||
}
|
||||
}
|
||||
this.options.scrollTo = (typeof this.options.scrollTo === "undefined") ? 0 : this.options.scrollTo;
|
||||
this.options.cacheBust = (typeof this.options.cacheBust === "undefined") ? true : this.options.cacheBust
|
||||
this.options.debug = this.options.debug || false
|
||||
|
||||
Reference in New Issue
Block a user