forked from googleanalytics/autotrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotrack.js.map
1 lines (1 loc) · 163 KB
/
autotrack.js.map
1
{"version":3,"sources":["node_modules/dom-utils/lib/matches.js"," [synthetic:util/defineproperty] "," [synthetic:util/global] "," [synthetic:es6/symbol] "," [synthetic:es6/util/arrayfromiterable] "," [synthetic:es6/util/makeiterator] "," [synthetic:es6/util/arrayfromiterator] "," [synthetic:es6/util/inherits] ","node_modules/dom-utils/lib/parents.js","node_modules/dom-utils/lib/delegate.js","node_modules/dom-utils/lib/closest.js","lib/plugins/event-tracker.js","node_modules/dom-utils/lib/get-attributes.js","node_modules/dom-utils/lib/parse-url.js","lib/method-chain.js","lib/utilities.js","lib/provide.js","lib/constants.js","lib/usage.js","lib/plugins/clean-url-tracker.js","lib/plugins/impression-tracker.js","lib/event-emitter.js","lib/store.js","lib/session.js","lib/plugins/max-scroll-tracker.js","lib/plugins/media-query-tracker.js","lib/plugins/outbound-form-tracker.js","lib/plugins/outbound-link-tracker.js","lib/plugins/page-visibility-tracker.js","lib/plugins/social-widget-tracker.js","lib/plugins/url-change-tracker.js"],"names":["$jscomp.defineProperty","$jscomp.global","$jscomp.initSymbol","$jscomp.global.Symbol","$jscomp.Symbol","$jscomp.symbolCounter_","$jscomp.SYMBOL_PREFIX","$jscomp.global.Symbol.iterator","$jscomp.arrayIterator","$jscomp.initSymbolIterator","$jscomp.iteratorPrototype","proto","window","Element","prototype","nativeMatches","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","element","test","nodeType","i","item","selector","call","nodes","parentNode","querySelectorAll","node","parents","list","push","delegate","eventType","callback","listener","event","delegateTarget","opts","composed","composedPath","target","parentElements","concat","parent","document","useCapture","ancestor","addEventListener","destroy","removeEventListener","getAttributes","attrs","map","attributes","length","attr","name","value","DEFAULT_PORT","a","createElement","cache","parseUrl","url","location","href","charAt","port","HTTP_PORT","HTTPS_PORT","host","replace","hash","hostname","origin","protocol","pathname","search","instances","constructor","MethodChain","context","methodName","originalMethodReference","isTask","get","methodChain","boundMethodChain","wrappedMethod","this.wrappedMethod","lastBoundMethod","$jscomp.arrayFromIterable","args","set","add","overrideMethod","rebindMethodChain","remove","index","indexOf","splice","method","previousMethod","bind","getOrCreateMethodChain","filter","h","createFieldsObj","defaultFields","userFields","tracker","hitFilter","originalBuildHitTask","buildHitTask","model","assign","getAttributeFields","prefix","attributeFields","Object","keys","forEach","attribute","field","camelCase","slice","domReady","readyState","fn","debounce","wait","timeout","clearTimeout","setTimeout","withTimeout","called","source","sources","key","hasOwnProperty","str","match","p1","toUpperCase","isObject","provide","pluginName","pluginConstructor","gaAlias","GoogleAnalyticsObject","q","gaDevIds","DEV_ID","gaplugins","plugins","CLEAN_URL_TRACKER","EVENT_TRACKER","IMPRESSION_TRACKER","MEDIA_QUERY_TRACKER","OUTBOUND_FORM_TRACKER","OUTBOUND_LINK_TRACKER","PAGE_VISIBILITY_TRACKER","SOCIAL_WIDGET_TRACKER","URL_CHANGE_TRACKER","MAX_SCROLL_TRACKER","PLUGIN_COUNT","trackUsage","plugin","VERSION","usageHex","parseInt","toString","toAdd","usageBin","substr","CleanUrlTracker","defaultOpts","queryDimension","stripQuery","queryDimensionIndex","trackerGetOverride","buildHitTaskOverride","methodOverride","originalMethod","fieldsObj","page","cleanUrlFields","cleanedFieldsObj","indexFilename","parts","split","join","trailingSlash","isFilename","NULL_DIMENSION","urlFieldsFilter","userCleanedFieldsObj","EventTracker","events","attributePrefix","handleEvents","delegates","type","getAttribute","send","hitType","transport","ImpressionTracker","IntersectionObserver","MutationObserver","defaultOptions","rootMargin","handleDomMutations","handleIntersectionChanges","handleDomElementAdded","handleDomElementRemoved","mutationObserver","items","elementMap","thresholdMap","observeElements","elements","ImpressionTracker.prototype","?.prototype","data","deriveDataFromElements","observer","threshold","id","getElementById","observe","body","childList","subtree","requestAnimationFrame","unobserveElements","itemsToKeep","itemsToRemove","some","itemInItems","itemToRemove","getItemFromElement","trackFirstImpressionOnly","dataToKeep","dataToRemove","unobserve","disconnect","unobserveAllElements","mutations","mutation","k","removedEl","removedNodes","walkNodeTree","j","addedEl","addedNodes","child","childNodes","records","record","intersectionRatio","intersectionRect","top","bottom","left","right","eventCategory","eventAction","eventLabel","nonInteraction","handleImpression","EventEmitter","registry_","emit","getRegistry_","isListening","Store","defaults","$jscomp.inherits","getOrCreate","trackingId","namespace","AUTOTRACK_PREFIX","storageListener","storedItem","String","localStorage","getItem","parse","newData","oldData","mergedData","setItem","JSON","stringify","store","oldValue","newValue","err","Session","timeZone","Session.DEFAULT_TIMEOUT","sendHitTaskOverride","dateTimeFormatter","Intl","DateTimeFormat","Store.getOrCreate","defaultProps","hitTime","isExpired","sessionData","currentDate","Date","oldHitDate","oldHitTime","MINUTES","datesAreDifferentInTimezone","format","isSessionExpired","sessionControl","MaxScrollTracker","increaseThreshold","sessionTimeout","pagePath","getPagePath","handleScroll","trackerSetOverride","session","listenForMaxScrollChanges","getMaxScrollPercentageForCurrentPage","html","documentElement","scrollPercentage","Math","min","max","round","pageYOffset","pageHeight","offsetHeight","scrollHeight","innerHeight","removeItem","maxScrollPercentage","stopListeningForMaxScrollChanges","increaseAmount","setMaxScrollPercentageForCurrentPage","eventValue","sendMaxScrollEvent","maxScrollMetricIndex","fields","lastPagePath","mediaMap","MediaQueryTracker","matchMedia","changeTemplate","changeTimeout","definitions","Array","isArray","changeListeners","processMediaQueries","definition","dimensionIndex","mediaName","getMatchName","addChangeListeners","getMediaList","media","mql","handleChanges","addListener","removeListener","OutboundFormTracker","formSelector","shouldTrackOutboundForm","handleFormSubmits","form","action","navigator","sendBeacon","preventDefault","hitCallback","submit","parseUrlFn","OutboundLinkTracker","linkSelector","shouldTrackOutboundLink","handleLinkInteractions","link","metaKey","ctrlKey","shiftKey","altKey","which","defaultPrevented","PAGE_ID","uuid","b","random","PageVisibilityTracker","lastPageState","handleChange","handleWindowUnload","handleExternalStoreSet","VISIBLE","visibilityState","PageVisibilityTracker.prototype","validateChangeData","HIDDEN","lastStoredChange","state","pageId","change","time","sendPageVisibilityEvent","queueTime","isSessionActive","getTimeSinceLastStoredChange","timeSinceLastStoredChange","SECONDS$1","delta","visibleMetricIndex","PageVisibilityTracker_prototype$trackerSetOverride","SocialWidgetTracker","addWidgetListeners","addTwitterEventHandlers","handleTweetEvents","handleFollowEvents","handleLikeEvents","handleUnlikeEvents","SocialWidgetTracker.prototype","FB","Event","subscribe","addFacebookEventHandlers","twttr","ready","removeTwitterEventHandlers","unbind","region","socialNetwork","socialAction","socialTarget","screen_name","unsubscribe","removeFacebookEventHandlers","UrlChangeTracker","history","pushState","shouldTrackUrlChange","trackReplaceState","path","pushStateOverride","replaceStateOverride","handlePopState","UrlChangeTracker.prototype","handleUrlChange","historyDidUpdate","oldPath","newPath","title"],"mappings":"A,YAAA,IAAA,CAAA,CCoCAA,GACsC,UAAlC,EAAA,MAAO,OAAA,iBAAP,CACA,MAAA,eADA,CAEA,QAAQ,CAAC,CAAD,CAAS,CAAT,CAAmB,CAAnB,CAA+B,CAErC,GAAI,CAAA,IAAJ,EAAsB,CAAA,IAAtB,CACE,KAAM,KAAI,SAAJ,CAAc,2CAAd,CAAN,CAEE,CAAJ,EAAc,KAAA,UAAd,EAAiC,CAAjC,EAA2C,MAAA,UAA3C,GACA,CAAA,CAAO,CAAP,CADA,CACmB,CAAA,MADnB,CALqC,CDvC3C,CE2CAC,EAb2B,WAAlB,EAAC,MAAO,OAAR,EAAiC,MAAjC,GAa0B,IAb1B,CAa0B,IAb1B,CAEe,WAAlB,EAAC,MAAO,OAAR,EAA2C,IAA3C,EAAiC,MAAjC,CAAmD,MAAnD,CAW6B,IChBd,SAAA,EAAQ,EAAG,CAE9BC,CAAA,CAAqB,QAAQ,EAAG,EAE3BC,EAAA,OAAL,GACEA,CAAA,OADF,CAC0BC,EAD1B,CAJ8B,CAWhC,IAAAC,GAAyB,CASR,SAAA,GAAQ,CAAC,CAAD,CAAkB,CACzC,MA5BsBC,gBA4Bt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A,EhB9FzCrW,EAAA,CAAAO,CAAAP,CgB8FmBgW,OhB9FnBhW,CgB8F4Bf,WhB9F5Be,CAAA,CAAmDqF,CAAnD,CgB+F4CiR,EAAAA,CAAAA,IAAAA,EhB/F5CtW,EAAA,CAAAO,CAAAP,CgB+FmBgW,OhB/FnBhW,CgB+F4Bf,chB/F5Be,CAAA,CAAmDqF,CAAnD,CgBgGA/K,OAAA0C,oBAAA,CAA2B,UAA3B,CAAuC,IAAAuZ,EAAvC,CAHO,CAQXvT;CAAA,CAAQ,kBAAR,CAA4B+S,EAA5B","file":"","sourcesContent":["const proto = window.Element.prototype;\nconst nativeMatches = proto.matches ||\n proto.matchesSelector ||\n proto.webkitMatchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector;\n\n\n/**\n * Tests if a DOM elements matches any of the test DOM elements or selectors.\n * @param {Element} element The DOM element to test.\n * @param {Element|string|Array<Element|string>} test A DOM element, a CSS\n * selector, or an array of DOM elements or CSS selectors to match against.\n * @return {boolean} True of any part of the test matches.\n */\nexport default function matches(element, test) {\n // Validate input.\n if (element && element.nodeType == 1 && test) {\n // if test is a string or DOM element test it.\n if (typeof test == 'string' || test.nodeType == 1) {\n return element == test ||\n matchesSelector(element, /** @type {string} */ (test));\n } else if ('length' in test) {\n // if it has a length property iterate over the items\n // and return true if any match.\n for (let i = 0, item; item = test[i]; i++) {\n if (element == item || matchesSelector(element, item)) return true;\n }\n }\n }\n // Still here? Return false\n return false;\n}\n\n\n/**\n * Tests whether a DOM element matches a selector. This polyfills the native\n * Element.prototype.matches method across browsers.\n * @param {!Element} element The DOM element to test.\n * @param {string} selector The CSS selector to test element against.\n * @return {boolean} True if the selector matches.\n */\nfunction matchesSelector(element, selector) {\n if (typeof selector != 'string') return false;\n if (nativeMatches) return nativeMatches.call(element, selector);\n const nodes = element.parentNode.querySelectorAll(selector);\n for (let i = 0, node; node = nodes[i]; i++) {\n if (node == element) return true;\n }\n return false;\n}\n",null,null,null,null,null,null,null,"/**\n * Returns an array of a DOM element's parent elements.\n * @param {!Element} element The DOM element whose parents to get.\n * @return {!Array} An array of all parent elemets, or an empty array if no\n * parent elements are found.\n */\nexport default function parents(element) {\n const list = [];\n while (element && element.parentNode && element.parentNode.nodeType == 1) {\n element = /** @type {!Element} */ (element.parentNode);\n list.push(element);\n }\n return list;\n}\n","import closest from './closest';\nimport matches from './matches';\n\n/**\n * Delegates the handling of events for an element matching a selector to an\n * ancestor of the matching element.\n * @param {!Node} ancestor The ancestor element to add the listener to.\n * @param {string} eventType The event type to listen to.\n * @param {string} selector A CSS selector to match against child elements.\n * @param {!Function} callback A function to run any time the event happens.\n * @param {Object=} opts A configuration options object. The available options:\n * - useCapture<boolean>: If true, bind to the event capture phase.\n * - deep<boolean>: If true, delegate into shadow trees.\n * @return {Object} The delegate object. It contains a destroy method.\n */\nexport default function delegate(\n ancestor, eventType, selector, callback, opts = {}) {\n // Defines the event listener.\n const listener = function(event) {\n let delegateTarget;\n\n // If opts.composed is true and the event originated from inside a Shadow\n // tree, check the composed path nodes.\n if (opts.composed && typeof event.composedPath == 'function') {\n const composedPath = event.composedPath();\n for (let i = 0, node; node = composedPath[i]; i++) {\n if (node.nodeType == 1 && matches(node, selector)) {\n delegateTarget = node;\n }\n }\n } else {\n // Otherwise check the parents.\n delegateTarget = closest(event.target, selector, true);\n }\n\n if (delegateTarget) {\n callback.call(delegateTarget, event, delegateTarget);\n }\n };\n\n ancestor.addEventListener(eventType, listener, opts.useCapture);\n\n return {\n destroy: function() {\n ancestor.removeEventListener(eventType, listener, opts.useCapture);\n },\n };\n}\n","import matches from './matches';\nimport parents from './parents';\n\n/**\n * Gets the closest parent element that matches the passed selector.\n * @param {Element} element The element whose parents to check.\n * @param {string} selector The CSS selector to match against.\n * @param {boolean=} shouldCheckSelf True if the selector should test against\n * the passed element itself.\n * @return {Element|undefined} The matching element or undefined.\n */\nexport default function closest(element, selector, shouldCheckSelf = false) {\n if (!(element && element.nodeType == 1 && selector)) return;\n const parentElements =\n (shouldCheckSelf ? [element] : []).concat(parents(element));\n\n for (let i = 0, parent; parent = parentElements[i]; i++) {\n if (matches(parent, selector)) return parent;\n }\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {delegate} from 'dom-utils';\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj, getAttributeFields} from '../utilities';\n\n\n/**\n * Class for the `eventTracker` analytics.js plugin.\n * @implements {EventTrackerPublicInterface}\n */\nclass EventTracker {\n /**\n * Registers declarative event tracking.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?EventTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.EVENT_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n /** @type {EventTrackerOpts} */\n const defaultOpts = {\n events: ['click'],\n fieldsObj: {},\n attributePrefix: 'ga-',\n // hitFilter: undefined,\n };\n\n this.opts = /** @type {EventTrackerOpts} */ (assign(defaultOpts, opts));\n\n this.tracker = tracker;\n\n // Binds methods.\n this.handleEvents = this.handleEvents.bind(this);\n\n const selector = '[' + this.opts.attributePrefix + 'on]';\n\n // Creates a mapping of events to their delegates\n this.delegates = {};\n this.opts.events.forEach((event) => {\n this.delegates[event] = delegate(document, event, selector,\n this.handleEvents, {composed: true, useCapture: true});\n });\n }\n\n /**\n * Handles all clicks on elements with event attributes.\n * @param {Event} event The DOM click event.\n * @param {Element} element The delegated DOM element target.\n */\n handleEvents(event, element) {\n const prefix = this.opts.attributePrefix;\n\n // Ensures the event type matches the one specified on the element.\n if (event.type != element.getAttribute(prefix + 'on')) return;\n\n /** @type {FieldsObj} */\n const defaultFields = {transport: 'beacon'};\n const attributeFields = getAttributeFields(element, prefix);\n const userFields = assign({}, this.opts.fieldsObj, attributeFields);\n const hitType = attributeFields.hitType || 'event';\n\n this.tracker.send(hitType, createFieldsObj(defaultFields,\n userFields, this.tracker, this.opts.hitFilter, element));\n }\n\n /**\n * Removes all event listeners and instance properties.\n */\n remove() {\n Object.keys(this.delegates).forEach((key) => {\n this.delegates[key].destroy();\n });\n }\n}\n\n\nprovide('eventTracker', EventTracker);\n","/**\n * Gets all attributes of an element as a plain JavaScriot object.\n * @param {Element} element The element whose attributes to get.\n * @return {!Object} An object whose keys are the attribute keys and whose\n * values are the attribute values. If no attributes exist, an empty\n * object is returned.\n */\nexport default function getAttributes(element) {\n const attrs = {};\n\n // Validate input.\n if (!(element && element.nodeType == 1)) return attrs;\n\n // Return an empty object if there are no attributes.\n const map = element.attributes;\n if (map.length === 0) return {};\n\n for (let i = 0, attr; attr = map[i]; i++) {\n attrs[attr.name] = attr.value;\n }\n return attrs;\n}\n","const HTTP_PORT = '80';\nconst HTTPS_PORT = '443';\nconst DEFAULT_PORT = RegExp(':(' + HTTP_PORT + '|' + HTTPS_PORT + ')$');\n\n\nconst a = document.createElement('a');\nconst cache = {};\n\n\n/**\n * Parses the given url and returns an object mimicing a `Location` object.\n * @param {string} url The url to parse.\n * @return {!Object} An object with the same properties as a `Location`.\n */\nexport default function parseUrl(url) {\n // All falsy values (as well as \".\") should map to the current URL.\n url = (!url || url == '.') ? location.href : url;\n\n if (cache[url]) return cache[url];\n\n a.href = url;\n\n // When parsing file relative paths (e.g. `../index.html`), IE will correctly\n // resolve the `href` property but will keep the `..` in the `path` property.\n // It will also not include the `host` or `hostname` properties. Furthermore,\n // IE will sometimes return no protocol or just a colon, especially for things\n // like relative protocol URLs (e.g. \"//google.com\").\n // To workaround all of these issues, we reparse with the full URL from the\n // `href` property.\n if (url.charAt(0) == '.' || url.charAt(0) == '/') return parseUrl(a.href);\n\n // Don't include default ports.\n let port = (a.port == HTTP_PORT || a.port == HTTPS_PORT) ? '' : a.port;\n\n // PhantomJS sets the port to \"0\" when using the file: protocol.\n port = port == '0' ? '' : port;\n\n // Sometimes IE incorrectly includes a port for default ports\n // (e.g. `:80` or `:443`) even when no port is specified in the URL.\n // http://bit.ly/1rQNoMg\n const host = a.host.replace(DEFAULT_PORT, '');\n\n // Not all browser support `origin` so we have to build it.\n const origin = a.origin ? a.origin : a.protocol + '//' + host;\n\n // Sometimes IE doesn't include the leading slash for pathname.\n // http://bit.ly/1rQNoMg\n const pathname = a.pathname.charAt(0) == '/' ? a.pathname : '/' + a.pathname;\n\n return cache[url] = {\n hash: a.hash,\n host: host,\n hostname: a.hostname,\n href: a.href,\n origin: origin,\n pathname: pathname,\n port: port,\n protocol: a.protocol,\n search: a.search,\n };\n}\n","/**\n * Copyright 2017 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @fileoverview\n * The functions exported by this module make it easier (and safer) to override\n * foreign object methods (in a modular way) and respond to or modify their\n * invocation. The primary feature is the ability to override a method without\n * worrying if it's already been overridden somewhere else in the codebase. It\n * also allows for safe restoring of an overridden method by only fully\n * restoring a method once all overrides have been removed.\n */\n\n\nconst instances = [];\n\n\n/**\n * A class that wraps a foreign object method and emit events before and\n * after the original method is called.\n */\nexport default class MethodChain {\n /**\n * Adds the passed override method to the list of method chain overrides.\n * @param {!Object} context The object containing the method to chain.\n * @param {string} methodName The name of the method on the object.\n * @param {!Function} methodOverride The override method to add.\n */\n static add(context, methodName, methodOverride) {\n getOrCreateMethodChain(context, methodName).add(methodOverride);\n }\n\n /**\n * Removes a method chain added via `add()`. If the override is the\n * only override added, the original method is restored.\n * @param {!Object} context The object containing the method to unchain.\n * @param {string} methodName The name of the method on the object.\n * @param {!Function} methodOverride The override method to remove.\n */\n static remove(context, methodName, methodOverride) {\n getOrCreateMethodChain(context, methodName).remove(methodOverride)\n }\n\n /**\n * Wraps a foreign object method and overrides it. Also stores a reference\n * to the original method so it can be restored later.\n * @param {!Object} context The object containing the method.\n * @param {string} methodName The name of the method on the object.\n */\n constructor(context, methodName) {\n this.context = context;\n this.methodName = methodName;\n this.isTask = /Task$/.test(methodName);\n\n this.originalMethodReference = this.isTask ?\n context.get(methodName) : context[methodName];\n\n this.methodChain = [];\n this.boundMethodChain = [];\n\n // Wraps the original method.\n this.wrappedMethod = (...args) => {\n const lastBoundMethod =\n this.boundMethodChain[this.boundMethodChain.length - 1];\n\n return lastBoundMethod(...args);\n };\n\n // Override original method with the wrapped one.\n if (this.isTask) {\n context.set(methodName, this.wrappedMethod);\n } else {\n context[methodName] = this.wrappedMethod;\n }\n }\n\n /**\n * Adds a method to the method chain.\n * @param {!Function} overrideMethod The override method to add.\n */\n add(overrideMethod) {\n this.methodChain.push(overrideMethod);\n this.rebindMethodChain();\n }\n\n /**\n * Removes a method from the method chain and restores the prior order.\n * @param {!Function} overrideMethod The override method to remove.\n */\n remove(overrideMethod) {\n const index = this.methodChain.indexOf(overrideMethod);\n if (index > -1) {\n this.methodChain.splice(index, 1);\n if (this.methodChain.length > 0) {\n this.rebindMethodChain();\n } else {\n this.destroy();\n }\n }\n }\n\n /**\n * Loops through the method chain array and recreates the bound method\n * chain array. This is necessary any time a method is added or removed\n * to ensure proper original method context and order.\n */\n rebindMethodChain() {\n this.boundMethodChain = [];\n for (let method, i = 0; method = this.methodChain[i]; i++) {\n const previousMethod = this.boundMethodChain[i - 1] ||\n this.originalMethodReference.bind(this.context);\n this.boundMethodChain.push(method(previousMethod));\n }\n }\n\n /**\n * Calls super and destroys the instance if no registered handlers remain.\n */\n destroy() {\n const index = instances.indexOf(this);\n if (index > -1) {\n instances.splice(index, 1);\n if (this.isTask) {\n this.context.set(this.methodName, this.originalMethodReference);\n } else {\n this.context[this.methodName] = this.originalMethodReference;\n }\n }\n }\n}\n\n\n/**\n * Gets a MethodChain instance for the passed object and method. If the method\n * has already been wrapped via an existing MethodChain instance, that\n * instance is returned.\n * @param {!Object} context The object containing the method.\n * @param {string} methodName The name of the method on the object.\n * @return {!MethodChain}\n */\nfunction getOrCreateMethodChain(context, methodName) {\n let methodChain = instances\n .filter((h) => h.context == context && h.methodName == methodName)[0];\n\n if (!methodChain) {\n methodChain = new MethodChain(context, methodName);\n instances.push(methodChain);\n }\n return methodChain;\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {getAttributes} from 'dom-utils';\n\n\n/**\n * Accepts default and user override fields and an optional tracker, hit\n * filter, and target element and returns a single object that can be used in\n * `ga('send', ...)` commands.\n * @param {FieldsObj} defaultFields The default fields to return.\n * @param {FieldsObj} userFields Fields set by the user to override the\n * defaults.\n * @param {Tracker=} tracker The tracker object to apply the hit filter to.\n * @param {Function=} hitFilter A filter function that gets\n * called with the tracker model right before the `buildHitTask`. It can\n * be used to modify the model for the current hit only.\n * @param {Element=} target If the hit originated from an interaction\n * with a DOM element, hitFilter is invoked with that element as the\n * second argument.\n * @return {!FieldsObj} The final fields object.\n */\nexport function createFieldsObj(defaultFields, userFields,\n tracker = undefined, hitFilter = undefined, target = undefined) {\n if (typeof hitFilter == 'function') {\n const originalBuildHitTask = tracker.get('buildHitTask');\n return {\n buildHitTask: (/** @type {!Model} */ model) => {\n model.set(defaultFields, null, true);\n model.set(userFields, null, true);\n hitFilter(model, target);\n originalBuildHitTask(model);\n },\n };\n } else {\n return assign({}, defaultFields, userFields);\n }\n}\n\n\n/**\n * Retrieves the attributes from an DOM element and returns a fields object\n * for all attributes matching the passed prefix string.\n * @param {Element} element The DOM element to get attributes from.\n * @param {string} prefix An attribute prefix. Only the attributes matching\n * the prefix will be returned on the fields object.\n * @return {FieldsObj} An object of analytics.js fields and values\n */\nexport function getAttributeFields(element, prefix) {\n const attributes = getAttributes(element);\n const attributeFields = {};\n\n Object.keys(attributes).forEach(function(attribute) {\n // The `on` prefix is used for event handling but isn't a field.\n if (attribute.indexOf(prefix) === 0 && attribute != prefix + 'on') {\n let value = attributes[attribute];\n\n // Detects Boolean value strings.\n if (value == 'true') value = true;\n if (value == 'false') value = false;\n\n const field = camelCase(attribute.slice(prefix.length));\n attributeFields[field] = value;\n }\n });\n\n return attributeFields;\n}\n\n\n/**\n * Accepts a function to be invoked once the DOM is ready. If the DOM is\n * already ready, the callback is invoked immediately.\n * @param {!Function} callback The ready callback.\n */\nexport function domReady(callback) {\n if (document.readyState == 'loading') {\n document.addEventListener('DOMContentLoaded', function fn() {\n document.removeEventListener('DOMContentLoaded', fn);\n callback();\n });\n } else {\n callback();\n }\n}\n\n\n/**\n * Returns a function, that, as long as it continues to be called, will not\n * actually run. The function will only run after it stops being called for\n * `wait` milliseconds.\n * @param {!Function} fn The function to debounce.\n * @param {number} wait The debounce wait timeout in ms.\n * @return {!Function} The debounced function.\n */\nexport function debounce(fn, wait) {\n let timeout;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => fn(...args), wait);\n };\n}\n\n\n/**\n * Accepts a function and returns a wrapped version of the function that is\n * expected to be called elsewhere in the system. If it's not called\n * elsewhere after the timeout period, it's called regardless. The wrapper\n * function also prevents the callback from being called more than once.\n * @param {!Function} callback The function to call.\n * @param {number=} wait How many milliseconds to wait before invoking\n * the callback.\n * @return {!Function} The wrapped version of the passed function.\n */\nexport function withTimeout(callback, wait = 2000) {\n let called = false;\n const fn = function() {\n if (!called) {\n called = true;\n callback();\n }\n };\n setTimeout(fn, wait);\n return fn;\n}\n\n\n/**\n * A small shim of Object.assign that aims for brevity over spec-compliant\n * handling all the edge cases.\n * @param {!Object} target The target object to assign to.\n * @param {...Object} sources Additional objects who properties should be\n * assigned to target.\n * @return {!Object} The modified target object.\n */\nexport const assign = Object.assign || function(target, ...sources) {\n for (let source, i = 0; source = sources[i]; i++) {\n for (let key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n};\n\n\n/**\n * Accepts a string containing hyphen or underscore word separators and\n * converts it to camelCase.\n * @param {string} str The string to camelCase.\n * @return {string} The camelCased version of the string.\n */\nexport function camelCase(str) {\n return str.replace(/[\\-\\_]+(\\w?)/g, function(match, p1) {\n return p1.toUpperCase();\n });\n}\n\n\n/**\n * Capitalizes the first letter of a string.\n * @param {string} str The input string.\n * @return {string} The capitalized string\n */\nexport function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\n/**\n * Indicates whether the passed variable is a JavaScript object.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the test is an object.\n */\nexport function isObject(value) {\n return typeof value == 'object' && value !== null;\n}\n\n\n/**\n * Accepts a value that may or may not be an array. If it is not an array,\n * it is returned as the first item in a single-item array.\n * @param {*} value The value to convert to an array if it is not.\n * @return {!Array} The array-ified value.\n */\nexport function toArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\n\n/**\n * @return {number} The current date timestamp\n */\nexport function now() {\n return +new Date();\n}\n\n\n/*eslint-disable */\n// https://gist.github.com/jed/982883\n/** @param {?=} a */\nexport const uuid = function b(a){return a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,b)};\n/*eslint-enable */\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {DEV_ID} from './constants';\nimport {capitalize} from './utilities';\n\n\n/**\n * Provides a plugin for use with analytics.js, accounting for the possibility\n * that the global command queue has been renamed or not yet defined.\n * @param {string} pluginName The plugin name identifier.\n * @param {Function} pluginConstructor The plugin constructor function.\n */\nexport default function provide(pluginName, pluginConstructor) {\n const gaAlias = window.GoogleAnalyticsObject || 'ga';\n window[gaAlias] = window[gaAlias] || function(...args) {\n (window[gaAlias].q = window[gaAlias].q || []).push(args);\n };\n\n // Adds the autotrack dev ID if not already included.\n window.gaDevIds = window.gaDevIds || [];\n if (window.gaDevIds.indexOf(DEV_ID) < 0) {\n window.gaDevIds.push(DEV_ID);\n }\n\n // Formally provides the plugin for use with analytics.js.\n window[gaAlias]('provide', pluginName, pluginConstructor);\n\n // Registers the plugin on the global gaplugins object.\n window.gaplugins = window.gaplugins || {};\n window.gaplugins[capitalize(pluginName)] = pluginConstructor;\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nexport const VERSION = '2.0.1';\nexport const DEV_ID = 'i5iSjo';\n\nexport const VERSION_PARAM = '_av';\nexport const USAGE_PARAM = '_au';\n\nexport const NULL_DIMENSION = '(not set)';\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {USAGE_PARAM, VERSION, VERSION_PARAM} from './constants';\n\n\nexport const plugins = {\n CLEAN_URL_TRACKER: 1,\n EVENT_TRACKER: 2,\n IMPRESSION_TRACKER: 3,\n MEDIA_QUERY_TRACKER: 4,\n OUTBOUND_FORM_TRACKER: 5,\n OUTBOUND_LINK_TRACKER: 6,\n PAGE_VISIBILITY_TRACKER: 7,\n SOCIAL_WIDGET_TRACKER: 8,\n URL_CHANGE_TRACKER: 9,\n MAX_SCROLL_TRACKER: 10,\n};\n\n\nconst PLUGIN_COUNT = Object.keys(plugins).length;\n\n\n\n/**\n * Tracks the usage of the passed plugin by encoding a value into a usage\n * string sent with all hits for the passed tracker.\n * @param {!Tracker} tracker The analytics.js tracker object.\n * @param {number} plugin The plugin enum.\n */\nexport function trackUsage(tracker, plugin) {\n trackVersion(tracker);\n trackPlugin(tracker, plugin);\n}\n\n\n/**\n * Converts a hexadecimal string to a binary string.\n * @param {string} hex A hexadecimal numeric string.\n * @return {string} a binary numeric string.\n */\nfunction convertHexToBin(hex) {\n return parseInt(hex || '0', 16).toString(2);\n}\n\n\n/**\n * Converts a binary string to a hexadecimal string.\n * @param {string} bin A binary numeric string.\n * @return {string} a hexadecimal numeric string.\n */\nfunction convertBinToHex(bin) {\n return parseInt(bin || '0', 2).toString(16);\n}\n\n\n/**\n * Adds leading zeros to a string if it's less than a minimum length.\n * @param {string} str A string to pad.\n * @param {number} len The minimum length of the string\n * @return {string} The padded string.\n */\nfunction padZeros(str, len) {\n if (str.length < len) {\n let toAdd = len - str.length;\n while (toAdd) {\n str = '0' + str;\n toAdd--;\n }\n }\n return str;\n}\n\n\n/**\n * Accepts a binary numeric string and flips the digit from 0 to 1 at the\n * specified index.\n * @param {string} str The binary numeric string.\n * @param {number} index The index to flip the bit.\n * @return {string} The new binary string with the bit flipped on\n */\nfunction flipBitOn(str, index) {\n return str.substr(0, index) + 1 + str.substr(index + 1);\n}\n\n\n/**\n * Accepts a tracker and a plugin index and flips the bit at the specified\n * index on the tracker's usage parameter.\n * @param {Object} tracker An analytics.js tracker.\n * @param {number} pluginIndex The index of the plugin in the global list.\n */\nfunction trackPlugin(tracker, pluginIndex) {\n const usageHex = tracker.get('&' + USAGE_PARAM);\n let usageBin = padZeros(convertHexToBin(usageHex), PLUGIN_COUNT);\n\n // Flip the bit of the plugin being tracked.\n usageBin = flipBitOn(usageBin, PLUGIN_COUNT - pluginIndex);\n\n // Stores the modified usage string back on the tracker.\n tracker.set('&' + USAGE_PARAM, convertBinToHex(usageBin));\n}\n\n\n/**\n * Accepts a tracker and adds the current version to the version param.\n * @param {Object} tracker An analytics.js tracker.\n */\nfunction trackVersion(tracker) {\n tracker.set('&' + VERSION_PARAM, VERSION);\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {parseUrl} from 'dom-utils';\nimport {NULL_DIMENSION} from '../constants';\nimport MethodChain from '../method-chain';\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign} from '../utilities';\n\n\n/**\n * Class for the `cleanUrlTracker` analytics.js plugin.\n * @implements {CleanUrlTrackerPublicInterface}\n */\nclass CleanUrlTracker {\n /**\n * Registers clean URL tracking on a tracker object. The clean URL tracker\n * removes query parameters from the page value reported to Google Analytics.\n * It also helps to prevent tracking similar URLs, e.g. sometimes ending a\n * URL with a slash and sometimes not.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?CleanUrlTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.CLEAN_URL_TRACKER);\n\n /** @type {CleanUrlTrackerOpts} */\n const defaultOpts = {\n // stripQuery: undefined,\n // queryDimensionIndex: undefined,\n // indexFilename: undefined,\n // trailingSlash: undefined,\n // urlFilter: undefined,\n };\n this.opts = /** @type {CleanUrlTrackerOpts} */ (assign(defaultOpts, opts));\n\n this.tracker = tracker;\n\n /** @type {string|null} */\n this.queryDimension = this.opts.stripQuery &&\n this.opts.queryDimensionIndex ?\n `dimension${this.opts.queryDimensionIndex}` : null;\n\n // Binds methods to `this`.\n this.trackerGetOverride = this.trackerGetOverride.bind(this);\n this.buildHitTaskOverride = this.buildHitTaskOverride.bind(this);\n\n // Override built-in tracker method to watch for changes.\n MethodChain.add(tracker, 'get', this.trackerGetOverride);\n MethodChain.add(tracker, 'buildHitTask', this.buildHitTaskOverride);\n }\n\n /**\n * Ensures reads of the tracker object by other plugins always see the\n * \"cleaned\" versions of all URL fields.\n * @param {function(string):*} originalMethod A reference to the overridden\n * method.\n * @return {function(string):*}\n */\n trackerGetOverride(originalMethod) {\n return (field) => {\n if (field == 'page' || field == this.queryDimension) {\n const fieldsObj = /** @type {!FieldsObj} */ ({\n location: originalMethod('location'),\n page: originalMethod('page'),\n });\n const cleanedFieldsObj = this.cleanUrlFields(fieldsObj);\n return cleanedFieldsObj[field];\n } else {\n return originalMethod(field);\n }\n };\n }\n\n /**\n * Cleans URL fields passed in a send command.\n * @param {function(!Model)} originalMethod A reference to the\n * overridden method.\n * @return {function(!Model)}\n */\n buildHitTaskOverride(originalMethod) {\n return (model) => {\n const cleanedFieldsObj = this.cleanUrlFields({\n location: model.get('location'),\n page: model.get('page'),\n });\n model.set(cleanedFieldsObj, null, true);\n originalMethod(model);\n };\n }\n\n /**\n * Accepts of fields object containing URL fields and returns a new\n * fields object with the URLs \"cleaned\" according to the tracker options.\n * @param {!FieldsObj} fieldsObj\n * @return {!FieldsObj}\n */\n cleanUrlFields(fieldsObj) {\n const url = parseUrl(\n /** @type {string} */ (fieldsObj.page || fieldsObj.location));\n\n let pathname = url.pathname;\n\n // If an index filename was provided, remove it if it appears at the end\n // of the URL.\n if (this.opts.indexFilename) {\n const parts = pathname.split('/');\n if (this.opts.indexFilename == parts[parts.length - 1]) {\n parts[parts.length - 1] = '';\n pathname = parts.join('/');\n }\n }\n\n // Ensure the URL ends with or doesn't end with slash based on the\n // `trailingSlash` option. Note that filename URLs should never contain\n // a trailing slash.\n if (this.opts.trailingSlash == 'remove') {\n pathname = pathname.replace(/\\/+$/, '');\n } else if (this.opts.trailingSlash == 'add') {\n const isFilename = /\\.\\w+$/.test(pathname);\n if (!isFilename && pathname.substr(-1) != '/') {\n pathname = pathname + '/';\n }\n }\n\n /** @type {!FieldsObj} */\n const cleanedFieldsObj = {\n page: pathname + (!this.opts.stripQuery ? url.search : '')\n }\n if (fieldsObj.location) {\n cleanedFieldsObj.location = fieldsObj.location;\n }\n if (this.queryDimension) {\n cleanedFieldsObj[this.queryDimension] =\n url.search.slice(1) || NULL_DIMENSION;\n }\n\n // Apply the `urlFieldsFilter()` option if passed.\n if (typeof this.opts.urlFieldsFilter == 'function') {\n /** @type {!FieldsObj} */\n const userCleanedFieldsObj =\n this.opts.urlFieldsFilter(cleanedFieldsObj, parseUrl);\n\n // Ensure only the URL fields are returned.\n return {\n page: userCleanedFieldsObj.page,\n location: userCleanedFieldsObj.location,\n [this.queryDimension]: userCleanedFieldsObj[this.queryDimension],\n };\n } else {\n return cleanedFieldsObj;\n }\n }\n\n /**\n * Restores all overridden tasks and methods.\n */\n remove() {\n MethodChain.remove(this.tracker, 'get', this.trackerGetOverride);\n MethodChain.remove(this.tracker, 'buildHitTask', this.buildHitTaskOverride);\n }\n}\n\n\nprovide('cleanUrlTracker', CleanUrlTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj,\n domReady, getAttributeFields} from '../utilities';\n\n\n/**\n * Class for the `impressionTracker` analytics.js plugin.\n * @implements {ImpressionTrackerPublicInterface}\n */\nclass ImpressionTracker {\n /**\n * Registers impression tracking.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?ImpressionTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.IMPRESSION_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!(window.IntersectionObserver && window.MutationObserver)) return;\n\n /** type {ImpressionTrackerOpts} */\n const defaultOptions = {\n // elements: undefined,\n rootMargin: '0px',\n fieldsObj: {},\n attributePrefix: 'ga-',\n // hitFilter: undefined,\n };\n\n this.opts = /** type {ImpressionTrackerOpts} */ (\n assign(defaultOptions, opts));\n\n this.tracker = tracker;\n\n // Binds methods.\n this.handleDomMutations = this.handleDomMutations.bind(this);\n this.handleIntersectionChanges = this.handleIntersectionChanges.bind(this);\n this.handleDomElementAdded = this.handleDomElementAdded.bind(this);\n this.handleDomElementRemoved = this.handleDomElementRemoved.bind(this);\n\n /** @type {MutationObserver} */\n this.mutationObserver = null;\n\n // The primary list of elements to observe. Each item contains the\n // element ID, threshold, and whether it's currently in-view.\n this.items = [];\n\n // A map of element IDs in the `items` array to DOM elements in the\n // document. The presence of a key indicates that the element ID is in the\n // `items` array, and the presence of an element value indicates that the\n // element is in the DOM.\n this.elementMap = {};\n\n // A map of threshold values. Each threshold is mapped to an\n // IntersectionObserver instance specific to that threshold.\n this.thresholdMap = {};\n\n // Once the DOM is ready, start observing for changes.\n domReady(() => this.observeElements(this.opts.elements));\n }\n\n /**\n * Starts observing the passed elements for impressions.\n * @param {Array<!ImpressionTrackerElementsItem|string>} elements\n */\n observeElements(elements) {\n const data = this.deriveDataFromElements(elements);\n\n // Merge the new data with the data already on the plugin instance.\n this.items = this.items.concat(data.items);\n this.elementMap = assign({}, data.elementMap, this.elementMap);\n this.thresholdMap = assign({}, data.thresholdMap, this.thresholdMap);\n\n // Observe each new item.\n data.items.forEach((item) => {\n const observer = this.thresholdMap[item.threshold] =\n (this.thresholdMap[item.threshold] || new IntersectionObserver(\n this.handleIntersectionChanges, {\n rootMargin: this.opts.rootMargin,\n threshold: [+item.threshold],\n }));\n\n const element = this.elementMap[item.id] ||\n (this.elementMap[item.id] = document.getElementById(item.id));\n\n if (element) {\n observer.observe(element);\n }\n });\n\n if (!this.mutationObserver) {\n this.mutationObserver = new MutationObserver(this.handleDomMutations);\n this.mutationObserver.observe(document.body, {\n childList: true,\n subtree: true,\n });\n }\n\n // TODO(philipwalton): Remove temporary hack to force a new frame\n // immediately after adding observers.\n // https://bugs.chromium.org/p/chromium/issues/detail?id=612323\n requestAnimationFrame(() => {});\n }\n\n /**\n * Stops observing the passed elements for impressions.\n * @param {Array<!ImpressionTrackerElementsItem|string>} elements\n * @return {undefined}\n */\n unobserveElements(elements) {\n const itemsToKeep = [];\n const itemsToRemove = [];\n\n this.items.forEach((item) => {\n const itemInItems = elements.some((element) => {\n const itemToRemove = getItemFromElement(element);\n return itemToRemove.id === item.id &&\n itemToRemove.threshold === item.threshold &&\n itemToRemove.trackFirstImpressionOnly ===\n item.trackFirstImpressionOnly;\n });\n if (itemInItems) {\n itemsToRemove.push(item);\n } else {\n itemsToKeep.push(item);\n }\n });\n\n // If there are no items to keep, run the `unobserveAllElements` logic.\n if (!itemsToKeep.length) {\n this.unobserveAllElements();\n } else {\n const dataToKeep = this.deriveDataFromElements(itemsToKeep);\n const dataToRemove = this.deriveDataFromElements(itemsToRemove);\n\n this.items = dataToKeep.items;\n this.elementMap = dataToKeep.elementMap;\n this.thresholdMap = dataToKeep.thresholdMap;\n\n // Unobserve removed elements.\n itemsToRemove.forEach((item) => {\n if (!dataToKeep.elementMap[item.id]) {\n const observer = dataToRemove.thresholdMap[item.threshold];\n const element = dataToRemove.elementMap[item.id];\n\n if (element) {\n observer.unobserve(element);\n }\n\n // Disconnect unneeded threshold observers.\n if (!dataToKeep.thresholdMap[item.threshold]) {\n dataToRemove.thresholdMap[item.threshold].disconnect();\n }\n }\n });\n }\n }\n\n /**\n * Stops observing all currently observed elements.\n */\n unobserveAllElements() {\n Object.keys(this.thresholdMap).forEach((key) => {\n this.thresholdMap[key].disconnect();\n });\n\n this.mutationObserver.disconnect();\n this.mutationObserver = null;\n\n this.items = [];\n this.elementMap = {};\n this.thresholdMap = {};\n }\n\n /**\n * Loops through each of the passed elements and creates a map of element IDs,\n * threshold values, and a list of \"items\" (which contains each element's\n * `threshold` and `trackFirstImpressionOnly` property).\n * @param {Array} elements A list of elements to derive item data from.\n * @return {Object} An object with the properties `items`, `elementMap`\n * and `threshold`.\n */\n deriveDataFromElements(elements) {\n const items = [];\n const thresholdMap = {};\n const elementMap = {};\n\n if (elements.length) {\n elements.forEach((element) => {\n const item = getItemFromElement(element);\n\n items.push(item);\n elementMap[item.id] = this.elementMap[item.id] || null;\n thresholdMap[item.threshold] =\n this.thresholdMap[item.threshold] || null;\n });\n }\n\n return {items, elementMap, thresholdMap};\n }\n\n /**\n * Handles nodes being added or removed from the DOM. This function is passed\n * as the callback to `this.mutationObserver`.\n * @param {Array} mutations A list of `MutationRecord` instances\n */\n handleDomMutations(mutations) {\n for (let i = 0, mutation; mutation = mutations[i]; i++) {\n // Handles removed elements.\n for (let k = 0, removedEl; removedEl = mutation.removedNodes[k]; k++) {\n this.walkNodeTree(removedEl, this.handleDomElementRemoved);\n }\n // Handles added elements.\n for (let j = 0, addedEl; addedEl = mutation.addedNodes[j]; j++) {\n this.walkNodeTree(addedEl, this.handleDomElementAdded);\n }\n }\n }\n\n /**\n * Iterates through all descendents of a DOM node and invokes the passed\n * callback if any of them match an elememt in `elementMap`.\n * @param {Node} node The DOM node to walk.\n * @param {Function} callback A function to be invoked if a match is found.\n */\n walkNodeTree(node, callback) {\n if (node.nodeType == 1 && node.id in this.elementMap) {\n callback(node.id);\n }\n for (let i = 0, child; child = node.childNodes[i]; i++) {\n this.walkNodeTree(child, callback);\n }\n }\n\n /**\n * Handles intersection changes. This function is passed as the callback to\n * `this.intersectionObserver`\n * @param {Array} records A list of `IntersectionObserverEntry` records.\n */\n handleIntersectionChanges(records) {\n const itemsToRemove = [];\n for (let i = 0, record; record = records[i]; i++) {\n for (let j = 0, item; item = this.items[j]; j++) {\n if (record.target.id !== item.id) continue;\n\n if (isTargetVisible(item.threshold, record)) {\n this.handleImpression(item.id);\n\n if (item.trackFirstImpressionOnly) {\n itemsToRemove.push(item);\n }\n }\n }\n }\n if (itemsToRemove.length) {\n this.unobserveElements(itemsToRemove);\n }\n }\n\n /**\n * Sends a hit to Google Analytics with the impression data.\n * @param {string} id The ID of the element making the impression.\n */\n handleImpression(id) {\n const element = document.getElementById(id);\n\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n eventCategory: 'Viewport',\n eventAction: 'impression',\n eventLabel: id,\n nonInteraction: true,\n };\n\n /** @type {FieldsObj} */\n const userFields = assign({}, this.opts.fieldsObj,\n getAttributeFields(element, this.opts.attributePrefix));\n\n this.tracker.send('event', createFieldsObj(defaultFields,\n userFields, this.tracker, this.opts.hitFilter, element));\n }\n\n /**\n * Handles an element in the items array being added to the DOM.\n * @param {string} id The ID of the element that was added.\n */\n handleDomElementAdded(id) {\n const element = this.elementMap[id] = document.getElementById(id);\n this.items.forEach((item) => {\n if (id == item.id) {\n this.thresholdMap[item.threshold].observe(element);\n }\n });\n }\n\n /**\n * Handles an element currently being observed for intersections being\n * removed from the DOM.\n * @param {string} id The ID of the element that was removed.\n */\n handleDomElementRemoved(id) {\n const element = this.elementMap[id];\n this.items.forEach((item) => {\n if (id == item.id) {\n this.thresholdMap[item.threshold].unobserve(element);\n }\n });\n\n this.elementMap[id] = null;\n }\n\n /**\n * Removes all listeners and observers.\n * @private\n */\n remove() {\n this.unobserveAllElements();\n }\n}\n\n\nprovide('impressionTracker', ImpressionTracker);\n\n\n/**\n * Detects whether or not an intersection record represents a visible target\n * given a particular threshold.\n * @param {number} threshold The threshold the target is visible above.\n * @param {IntersectionObserverEntry} record The most recent record entry.\n * @return {boolean} True if the target is visible.\n */\nfunction isTargetVisible(threshold, record) {\n if (threshold === 0) {\n const i = record.intersectionRect;\n return i.top > 0 || i.bottom > 0 || i.left > 0 || i.right > 0;\n } else {\n return record.intersectionRatio >= threshold;\n }\n}\n\n\n/**\n * Creates an item by merging the passed element with the item defaults.\n * If the passed element is just a string, that string is treated as\n * the item ID.\n * @param {!ImpressionTrackerElementsItem|string} element The element to\n * convert to an item.\n * @return {!ImpressionTrackerElementsItem} The item object.\n */\nfunction getItemFromElement(element) {\n /** @type {ImpressionTrackerElementsItem} */\n const defaultOpts = {\n threshold: 0,\n trackFirstImpressionOnly: true,\n };\n\n if (typeof element == 'string') {\n element = /** @type {!ImpressionTrackerElementsItem} */ ({id: element});\n }\n\n return assign(defaultOpts, element);\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * An simple reimplementation of the native Node.js EventEmitter class.\n * The goal of this implementation is to be as small as possible.\n */\nexport default class EventEmitter {\n /**\n * Creates the event registry.\n */\n constructor() {\n this.registry_ = {};\n }\n\n /**\n * Adds a handler function to the registry for the passed event.\n * @param {string} event The event name.\n * @param {!Function} fn The handler to be invoked when the passed\n * event is emitted.\n */\n on(event, fn) {\n this.getRegistry_(event).push(fn);\n }\n\n /**\n * Removes a handler function from the registry for the passed event.\n * @param {string=} event The event name.\n * @param {Function=} fn The handler to be removed.\n */\n off(event = undefined, fn = undefined) {\n if (event && fn) {\n const eventRegistry = this.getRegistry_(event);\n const handlerIndex = eventRegistry.indexOf(fn);\n if (handlerIndex > -1) {\n eventRegistry.splice(handlerIndex, 1);\n }\n } else {\n this.registry_ = {};\n }\n }\n\n /**\n * Runs all registered handlers for the passed event with the optional args.\n * @param {string} event The event name.\n * @param {...*} args The arguments to be passed to the handler.\n */\n emit(event, ...args) {\n this.getRegistry_(event).forEach((fn) => fn(...args));\n }\n\n /**\n * Returns the total number of event handlers currently registered.\n * @return {number}\n */\n getEventCount() {\n let eventCount = 0;\n Object.keys(this.registry_).forEach((event) => {\n eventCount += this.getRegistry_(event).length;\n });\n return eventCount;\n }\n\n /**\n * Returns an array of handlers associated with the passed event name.\n * If no handlers have been registered, an empty array is returned.\n * @private\n * @param {string} event The event name.\n * @return {!Array} An array of handler functions.\n */\n getRegistry_(event) {\n return this.registry_[event] = (this.registry_[event] || []);\n }\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport EventEmitter from './event-emitter';\nimport {assign} from './utilities';\n\n\nconst AUTOTRACK_PREFIX = 'autotrack';\nconst instances = {};\nlet isListening = false;\n\n\n/**\n * A storage object to simplify interacting with localStorage.\n */\nexport default class Store extends EventEmitter {\n /**\n * Gets an existing instance for the passed arguements or creates a new\n * instance if one doesn't exist.\n * @param {string} trackingId The tracking ID for the GA property.\n * @param {string} namespace A namespace unique to this store.\n * @param {Object=} defaults An optional object of key/value defaults.\n * @return {Store} The Store instance.\n */\n static getOrCreate(trackingId, namespace, defaults) {\n const key = [AUTOTRACK_PREFIX, trackingId, namespace].join(':');\n\n // Don't create multiple instances for the same tracking Id and namespace.\n if (!instances[key]) {\n instances[key] = new Store(key, defaults);\n instances[key].key = key;\n if (!isListening) initStorageListener();\n }\n return instances[key];\n }\n\n /**\n * @param {string} key A key unique to this store.\n * @param {Object=} defaults An optional object of key/value defaults.\n */\n constructor(key, defaults) {\n super();\n this.key = key;\n this.defaults = defaults || {};\n }\n\n /**\n * Gets the data stored in localStorage for this store.\n * @return {!Object} The stored data merged with the defaults.\n */\n get() {\n const storedItem = String(window.localStorage &&\n window.localStorage.getItem(this.key));\n\n if (typeof storedItem != 'string') return {};\n // TODO(philipwalton): Implement schema migrations if/when a new\n // schema version is introduced.\n return parse(storedItem, this.defaults);\n }\n\n /**\n * Saves the passed data object to localStorage,\n * merging it with the existing data.\n * @param {Object} newData The data to save.\n */\n set(newData) {\n const oldData = this.get();\n const mergedData = assign(oldData, newData);\n window.localStorage &&\n window.localStorage.setItem(this.key, JSON.stringify(mergedData));\n }\n\n /**\n * Clears the data in localStorage for the current store.\n */\n clear() {\n window.localStorage && window.localStorage.removeItem(this.key);\n }\n\n /**\n * Removes the store instance for the global instances map. If this is the\n * last store instance, the storage listener is also removed.\n * Note: this does not erase the stored data. Use `clear()` for that.\n */\n destroy() {\n delete instances[this.key];\n if (!Object.keys(instances).length) {\n removeStorageListener();\n }\n }\n}\n\n\n/**\n * Adds a single storage event listener and flips the global `isListening`\n * flag so multiple events aren't added.\n */\nfunction initStorageListener() {\n window.addEventListener('storage', storageListener);\n isListening = true;\n}\n\n\n/**\n * Removes the storage event listener and flips the global `isListening`\n * flag so it can be re-added later.\n */\nfunction removeStorageListener() {\n window.removeEventListener('storage', storageListener);\n isListening = false;\n}\n\n\n/**\n * The global storage event listener.\n * @param {!Event} event The DOM event.\n */\nfunction storageListener(event) {\n const store = instances[event.key];\n if (store) {\n const oldData = parse(event.oldValue, store.defaults);\n const newData = parse(event.newValue, store.defaults);\n store.emit('externalSet', newData, oldData);\n }\n}\n\n\n/**\n * Parses a source string as JSON and merges the result with the passed\n * defaults object. If an error occurs while\n * @param {string} source A JSON string of data.\n * @param {!Object} defaults An object of key/value defaults.\n * @return {!Object} The parsed data object merged with the passed defaults.\n */\nfunction parse(source, defaults) {\n let data;\n try {\n data = /** @type {!Object} */ (JSON.parse(source));\n } catch(err) {\n data = {};\n }\n return assign({}, defaults, data);\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport MethodChain from './method-chain';\nimport Store from './store';\nimport {now} from './utilities';\n\n\nconst SECONDS = 1000;\nconst MINUTES = 60 * SECONDS;\n\n\nconst instances = {};\n\n\n/**\n * A session management class that helps track session boundaries\n * across multiple open tabs/windows.\n */\nexport default class Session {\n /**\n * Gets an existing instance for the passed arguments or creates a new\n * instance if one doesn't exist.\n * @param {!Tracker} tracker An analytics.js tracker object.\n * @param {number} timeout The session timeout (in minutes). This value\n * should match what's set in the \"Session settings\" section of the\n * Google Analytics admin.\n * @param {string=} timeZone The optional IANA time zone of the view. This\n * value should match what's set in the \"View settings\" section of the\n * Google Analytics admin. (Note: this assumes all views for the property\n * use the same time zone. If that's not true, it's better not to use\n * this feature).\n * @return {Session} The Session instance.\n */\n static getOrCreate(tracker, timeout, timeZone) {\n // Don't create multiple instances for the same property.\n const trackingId = tracker.get('trackingId');\n if (instances[trackingId]) {\n return instances[trackingId];\n } else {\n return instances[trackingId] = new Session(tracker, timeout, timeZone);\n }\n }\n\n /**\n * @param {!Tracker} tracker An analytics.js tracker object.\n * @param {number} timeout The session timeout (in minutes). This value\n * should match what's set in the \"Session settings\" section of the\n * Google Analytics admin.\n * @param {string=} timeZone The optional IANA time zone of the view. This\n * value should match what's set in the \"View settings\" section of the\n * Google Analytics admin. (Note: this assumes all views for the property\n * use the same time zone. If that's not true, it's better not to use\n * this feature).\n */\n constructor(tracker, timeout, timeZone) {\n this.tracker = tracker;\n this.timeout = timeout || Session.DEFAULT_TIMEOUT;\n this.timeZone = timeZone;\n\n // Binds methods.\n this.sendHitTaskOverride = this.sendHitTaskOverride.bind(this);\n\n // Overrides into the trackers sendHitTask method.\n MethodChain.add(tracker, 'sendHitTask', this.sendHitTaskOverride);\n\n // Some browser doesn't support various features of the\n // `Intl.DateTimeFormat` API, so we have to try/catch it. Consequently,\n // this allows us to assume the presence of `this.dateTimeFormatter` means\n // it works in the current browser.\n try {\n this.dateTimeFormatter =\n new Intl.DateTimeFormat('en-US', {timeZone: this.timeZone});\n } catch(err) {\n // Do nothing.\n }\n\n // Creates the session store and adds change listeners.\n /** @type {SessionStoreData} */\n const defaultProps = {\n hitTime: 0,\n isExpired: false,\n };\n this.store = Store.getOrCreate(\n tracker.get('trackingId'), 'session', defaultProps);\n }\n\n /**\n * Accepts a tracker object and returns whether or not the session for that\n * tracker has expired. A session can expire for two reasons:\n * - More than 30 minutes has elapsed since the previous hit\n * was sent (The 30 minutes number is the Google Analytics default, but\n * it can be modified in GA admin \"Session settings\").\n * - A new day has started since the previous hit, in the\n * specified time zone (should correspond to the time zone of the\n * property's views).\n *\n * Note: since real session boundaries are determined at processing time,\n * this is just a best guess rather than a source of truth.\n *\n * @param {SessionStoreData=} sessionData An optional sessionData object\n * which avoids an additional localStorage read if the data is known to\n * be fresh.\n * @return {boolean} True if the session has expired.\n */\n isExpired(sessionData = this.store.get()) {\n // True if the sessionControl field was set to 'end' on the previous hit.\n if (sessionData.isExpired) return true;\n\n const currentDate = new Date();\n const oldHitTime = sessionData.hitTime;\n const oldHitDate = oldHitTime && new Date(oldHitTime);\n\n if (oldHitTime) {\n if (currentDate - oldHitDate > (this.timeout * MINUTES)) {\n // If more time has elapsed than the session expiry time,\n // the session has expired.\n return true;\n } else if (this.datesAreDifferentInTimezone(currentDate, oldHitDate)) {\n // A new day has started since the previous hit, which means the\n // session has expired.\n return true;\n }\n }\n\n // For all other cases return false.\n return false;\n }\n\n /**\n * Returns true if (and only if) the timezone date formatting is supported\n * in the current browser and if the two dates are diffinitiabely not the\n * same date in the session timezone. Anything short of this returns false.\n * @param {!Date} d1\n * @param {!Date} d2\n * @return {boolean}\n */\n datesAreDifferentInTimezone(d1, d2) {\n if (!this.dateTimeFormatter) {\n return false;\n } else {\n return this.dateTimeFormatter.format(d1)\n != this.dateTimeFormatter.format(d2);\n }\n\n\n }\n\n /**\n * Keeps track of when the previous hit was sent to determine if a session\n * has expired. Also inspects the `sessionControl` field to handles\n * expiration accordingly.\n * @param {function(!Model)} originalMethod A reference to the overridden\n * method.\n * @return {function(!Model)}\n */\n sendHitTaskOverride(originalMethod) {\n return (model) => {\n originalMethod(model);\n\n const sessionData = this.store.get();\n const isSessionExpired = this.isExpired(sessionData);\n const sessionControl = model.get('sessionControl');\n\n const sessionWillStart = sessionControl == 'start' || isSessionExpired;\n const sessionWillEnd = sessionControl == 'end';\n\n // Update the stored session data.\n sessionData.hitTime = now();\n if (sessionWillStart) {\n sessionData.isExpired = false;\n }\n if (sessionWillEnd) {\n sessionData.isExpired = true;\n }\n this.store.set(sessionData);\n }\n }\n\n /**\n * Restores the tracker's original `sendHitTask` to the state before\n * session control was initialized and removes this instance from the global\n * store.\n */\n destroy() {\n MethodChain.remove(this.tracker, 'sendHitTask', this.sendHitTaskOverride);\n this.store.destroy();\n delete instances[this.tracker.get('trackingId')];\n }\n}\n\n\nSession.DEFAULT_TIMEOUT = 30; // minutes\n","/**\n * Copyright 2017 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {parseUrl} from 'dom-utils';\nimport MethodChain from '../method-chain';\nimport provide from '../provide';\nimport Session from '../session';\nimport Store from '../store';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj, debounce, isObject} from '../utilities';\n\n\n/**\n * Class for the `maxScrollQueryTracker` analytics.js plugin.\n * @implements {MaxScrollTrackerPublicInterface}\n */\nclass MaxScrollTracker {\n /**\n * Registers outbound link tracking on tracker object.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.MAX_SCROLL_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n /** @type {MaxScrollTrackerOpts} */\n const defaultOpts = {\n increaseThreshold: 20,\n sessionTimeout: Session.DEFAULT_TIMEOUT,\n // timeZone: undefined,\n // maxScrollMetricIndex: undefined,\n fieldsObj: {},\n // hitFilter: undefined\n };\n\n this.opts = /** @type {MaxScrollTrackerOpts} */ (\n assign(defaultOpts, opts));\n\n this.tracker = tracker;\n this.pagePath = this.getPagePath();\n\n // Binds methods to `this`.\n this.handleScroll = debounce(this.handleScroll.bind(this), 500);\n this.trackerSetOverride = this.trackerSetOverride.bind(this);\n\n // Creates the store and binds storage change events.\n this.store = Store.getOrCreate(\n tracker.get('trackingId'), 'plugins/max-scroll-tracker');\n\n // Creates the session and binds session events.\n this.session = new Session(\n tracker, this.opts.sessionTimeout, this.opts.timeZone);\n\n // Override the built-in tracker.set method to watch for changes.\n MethodChain.add(tracker, 'set', this.trackerSetOverride);\n\n this.listenForMaxScrollChanges();\n }\n\n\n /**\n * Adds a scroll event listener if the max scroll percentage for the\n * current page isn't already at 100%.\n */\n listenForMaxScrollChanges() {\n const maxScrollPercentage = this.getMaxScrollPercentageForCurrentPage();\n if (maxScrollPercentage < 100) {\n window.addEventListener('scroll', this.handleScroll);\n }\n }\n\n\n /**\n * Removes an added scroll listener.\n */\n stopListeningForMaxScrollChanges() {\n window.removeEventListener('scroll', this.handleScroll);\n }\n\n\n /**\n * Handles the scroll event. If the current scroll percentage is greater\n * that the stored scroll event by at least the specified increase threshold,\n * send an event with the increase amount.\n */\n handleScroll() {\n const pageHeight = getPageHeight();\n const scrollPos = window.pageYOffset; // scrollY isn't supported in IE.\n const windowHeight = window.innerHeight;\n\n // Ensure scrollPercentage is an integer between 0 and 100.\n const scrollPercentage = Math.min(100, Math.max(0,\n Math.round(100 * (scrollPos / (pageHeight - windowHeight)))));\n\n // If the session has expired, clear old scroll data and send no events.\n if (this.session.isExpired()) {\n this.store.clear();\n } else {\n const maxScrollPercentage = this.getMaxScrollPercentageForCurrentPage();\n\n if (scrollPercentage > maxScrollPercentage) {\n if (scrollPercentage == 100 || maxScrollPercentage == 100) {\n this.stopListeningForMaxScrollChanges();\n }\n const increaseAmount = scrollPercentage - maxScrollPercentage;\n if (scrollPercentage == 100 ||\n increaseAmount >= this.opts.increaseThreshold) {\n this.setMaxScrollPercentageForCurrentPage(scrollPercentage);\n this.sendMaxScrollEvent(increaseAmount, scrollPercentage);\n }\n }\n }\n }\n\n /**\n * Detects changes to the tracker object and triggers an update if the page\n * field has changed.\n * @param {function(...*)} originalMethod A reference to the overridden\n * method.\n * @return {function(...*)}\n */\n trackerSetOverride(originalMethod) {\n return (...args) => {\n originalMethod(...args);\n\n /** @type {!FieldsObj} */\n const fields = isObject(args[0]) ? args[0] : {[args[0]]: args[1]};\n if (fields.page) {\n const lastPagePath = this.pagePath;\n this.pagePath = this.getPagePath();\n\n if (this.pagePath != lastPagePath) {\n // Since event listeners for the same function are never added twice,\n // we don't need to worry about whether we're already listening. We\n // can just add the event listener again.\n this.listenForMaxScrollChanges();\n }\n }\n }\n }\n\n /**\n * Sends an event for the increased max scroll percentage amount.\n * @param {number} increaseAmount\n * @param {number} scrollPercentage\n */\n sendMaxScrollEvent(increaseAmount, scrollPercentage) {\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n eventCategory: 'Max Scroll',\n eventAction: 'increase',\n eventValue: increaseAmount,\n eventLabel: String(scrollPercentage),\n nonInteraction: true,\n };\n\n // If a custom metric was specified, set it equal to the event value.\n if (this.opts.maxScrollMetricIndex) {\n defaultFields['metric' + this.opts.maxScrollMetricIndex] = increaseAmount;\n }\n\n this.tracker.send('event',\n createFieldsObj(defaultFields, this.opts.fieldsObj,\n this.tracker, this.opts.hitFilter));\n }\n\n /**\n * Stores the current max scroll percentage for the current page.\n * @param {number} maxScrollPercentage\n */\n setMaxScrollPercentageForCurrentPage(maxScrollPercentage) {\n this.store.set({[this.pagePath]: maxScrollPercentage});\n }\n\n /**\n * Gets the stored max scroll percentage for the current page.\n * @return {number}\n */\n getMaxScrollPercentageForCurrentPage() {\n return this.store.get()[this.pagePath] || 0;\n }\n\n /**\n * Gets the page path from the tracker object.\n * @return {number}\n */\n getPagePath() {\n const url = parseUrl(\n this.tracker.get('page') || this.tracker.get('location'))\n return url.pathname + url.search;\n }\n\n /**\n * Removes all event listeners and restores overridden methods.\n */\n remove() {\n this.session.destroy();\n this.stopListeningForMaxScrollChanges();\n MethodChain.remove(this.tracker, 'set', this.trackerSetOverride);\n }\n}\n\n\nprovide('maxScrollTracker', MaxScrollTracker);\n\n\n/**\n * Gets the maximum height of the page including scrollable area.\n * @return {number}\n */\nfunction getPageHeight() {\n const html = document.documentElement;\n const body = document.body;\n return Math.max(html.offsetHeight, html.scrollHeight,\n body.offsetHeight, body.scrollHeight)\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {NULL_DIMENSION} from '../constants';\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj,\n debounce, isObject, toArray} from '../utilities';\n\n\n/**\n * Declares the MediaQueryList instance cache.\n */\nconst mediaMap = {};\n\n\n/**\n * Class for the `mediaQueryTracker` analytics.js plugin.\n * @implements {MediaQueryTrackerPublicInterface}\n */\nclass MediaQueryTracker {\n /**\n * Registers media query tracking.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.MEDIA_QUERY_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.matchMedia) return;\n\n /** @type {MediaQueryTrackerOpts} */\n const defaultOpts = {\n // definitions: unefined,\n changeTemplate: this.changeTemplate,\n changeTimeout: 1000,\n fieldsObj: {},\n // hitFilter: undefined,\n };\n\n this.opts = /** @type {MediaQueryTrackerOpts} */ (\n assign(defaultOpts, opts));\n\n // Exits early if media query data doesn't exist.\n if (!isObject(this.opts.definitions)) return;\n\n this.opts.definitions = toArray(this.opts.definitions);\n this.tracker = tracker;\n this.changeListeners = [];\n\n this.processMediaQueries();\n }\n\n /**\n * Loops through each media query definition, sets the custom dimenion data,\n * and adds the change listeners.\n */\n processMediaQueries() {\n this.opts.definitions.forEach((definition) => {\n // Only processes definitions with a name and index.\n if (definition.name && definition.dimensionIndex) {\n const mediaName = this.getMatchName(definition);\n this.tracker.set('dimension' + definition.dimensionIndex, mediaName);\n\n this.addChangeListeners(definition);\n }\n });\n }\n\n /**\n * Takes a definition object and return the name of the matching media item.\n * If no match is found, the NULL_DIMENSION value is returned.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension.\n * @return {string} The name of the matched media or NULL_DIMENSION.\n */\n getMatchName(definition) {\n let match;\n\n definition.items.forEach((item) => {\n if (getMediaList(item.media).matches) {\n match = item;\n }\n });\n return match ? match.name : NULL_DIMENSION;\n }\n\n /**\n * Adds change listeners to each media query in the definition list.\n * Debounces the changes to prevent unnecessary hits from being sent.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension\n */\n addChangeListeners(definition) {\n definition.items.forEach((item) => {\n const mql = getMediaList(item.media);\n const fn = debounce(() => {\n this.handleChanges(definition);\n }, this.opts.changeTimeout);\n\n mql.addListener(fn);\n this.changeListeners.push({mql, fn});\n });\n }\n\n /**\n * Handles changes to the matched media. When the new value differs from\n * the old value, a change event is sent.\n * @param {Object} definition A set of named media queries associated\n * with a single custom dimension\n */\n handleChanges(definition) {\n const newValue = this.getMatchName(definition);\n const oldValue = this.tracker.get('dimension' + definition.dimensionIndex);\n\n if (newValue !== oldValue) {\n this.tracker.set('dimension' + definition.dimensionIndex, newValue);\n\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n eventCategory: definition.name,\n eventAction: 'change',\n eventLabel: this.opts.changeTemplate(oldValue, newValue),\n nonInteraction: true,\n };\n this.tracker.send('event', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n }\n\n /**\n * Removes all event listeners and instance properties.\n */\n remove() {\n for (let i = 0, listener; listener = this.changeListeners[i]; i++) {\n listener.mql.removeListener(listener.fn);\n }\n }\n\n /**\n * Sets the default formatting of the change event label.\n * This can be overridden by setting the `changeTemplate` option.\n * @param {string} oldValue The value of the media query prior to the change.\n * @param {string} newValue The value of the media query after the change.\n * @return {string} The formatted event label.\n */\n changeTemplate(oldValue, newValue) {\n return oldValue + ' => ' + newValue;\n }\n}\n\n\nprovide('mediaQueryTracker', MediaQueryTracker);\n\n\n/**\n * Accepts a media query and returns a MediaQueryList object.\n * Caches the values to avoid multiple unnecessary instances.\n * @param {string} media A media query value.\n * @return {MediaQueryList} The matched media.\n */\nfunction getMediaList(media) {\n return mediaMap[media] || (mediaMap[media] = window.matchMedia(media));\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {delegate, parseUrl} from 'dom-utils';\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj,\n getAttributeFields, withTimeout} from '../utilities';\n\n\n/**\n * Class for the `outboundFormTracker` analytics.js plugin.\n * @implements {OutboundFormTrackerPublicInterface}\n */\nclass OutboundFormTracker {\n /**\n * Registers outbound form tracking.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.OUTBOUND_FORM_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n /** @type {OutboundFormTrackerOpts} */\n const defaultOpts = {\n formSelector: 'form',\n shouldTrackOutboundForm: this.shouldTrackOutboundForm,\n fieldsObj: {},\n attributePrefix: 'ga-',\n // hitFilter: undefined\n };\n\n this.opts = /** @type {OutboundFormTrackerOpts} */ (\n assign(defaultOpts, opts));\n\n this.tracker = tracker;\n\n this.delegate = delegate(document, 'submit', this.opts.formSelector,\n this.handleFormSubmits.bind(this), {composed: true, useCapture: true});\n }\n\n /**\n * Handles all submits on form elements. A form submit is considered outbound\n * if its action attribute starts with http and does not contain\n * location.hostname.\n * When the beacon transport method is not available, the event's default\n * action is prevented and re-emitted after the hit is sent.\n * @param {Event} event The DOM submit event.\n * @param {Element} form The delegated event target.\n */\n handleFormSubmits(event, form) {\n const action = parseUrl(form.action).href;\n\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n eventCategory: 'Outbound Form',\n eventAction: 'submit',\n eventLabel: action,\n };\n\n if (this.opts.shouldTrackOutboundForm(form, parseUrl)) {\n if (!navigator.sendBeacon) {\n // Stops the submit and waits until the hit is complete (with timeout)\n // for browsers that don't support beacon.\n event.preventDefault();\n defaultFields.hitCallback = withTimeout(function() {\n form.submit();\n });\n }\n\n const userFields = assign({}, this.opts.fieldsObj,\n getAttributeFields(form, this.opts.attributePrefix));\n\n this.tracker.send('event', createFieldsObj(\n defaultFields, userFields, this.tracker, this.opts.hitFilter, form));\n }\n }\n\n /**\n * Determines whether or not the tracker should send a hit when a form is\n * submitted. By default, forms with an action attribute that starts with\n * \"http\" and doesn't contain the current hostname are tracked.\n * @param {Element} form The form that was submitted.\n * @param {Function} parseUrlFn A cross-browser utility method for url\n * parsing (note: renamed to disambiguate when compiling).\n * @return {boolean} Whether or not the form should be tracked.\n */\n shouldTrackOutboundForm(form, parseUrlFn) {\n const url = parseUrlFn(form.action);\n return url.hostname != location.hostname &&\n url.protocol.slice(0, 4) == 'http';\n }\n\n /**\n * Removes all event listeners and instance properties.\n */\n remove() {\n this.delegate.destroy();\n }\n}\n\n\nprovide('outboundFormTracker', OutboundFormTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {delegate, parseUrl} from 'dom-utils';\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj,\n getAttributeFields, withTimeout} from '../utilities';\n\n\n/**\n * Class for the `outboundLinkTracker` analytics.js plugin.\n * @implements {OutboundLinkTrackerPublicInterface}\n */\nclass OutboundLinkTracker {\n /**\n * Registers outbound link tracking on a tracker object.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.OUTBOUND_LINK_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n /** @type {OutboundLinkTrackerOpts} */\n const defaultOpts = {\n events: ['click'],\n linkSelector: 'a, area',\n shouldTrackOutboundLink: this.shouldTrackOutboundLink,\n fieldsObj: {},\n attributePrefix: 'ga-',\n // hitFilter: undefined,\n };\n\n this.opts = /** @type {OutboundLinkTrackerOpts} */ (\n assign(defaultOpts, opts));\n\n this.tracker = tracker;\n\n // Binds methods.\n this.handleLinkInteractions = this.handleLinkInteractions.bind(this);\n\n // Creates a mapping of events to their delegates\n this.delegates = {};\n this.opts.events.forEach((event) => {\n this.delegates[event] = delegate(document, event, this.opts.linkSelector,\n this.handleLinkInteractions, {composed: true, useCapture: true});\n });\n }\n\n /**\n * Handles all interactions on link elements. A link is considered an outbound\n * link if its hostname property does not match location.hostname. When the\n * beacon transport method is not available, the links target is set to\n * \"_blank\" to ensure the hit can be sent.\n * @param {Event} event The DOM click event.\n * @param {Element} link The delegated event target.\n */\n handleLinkInteractions(event, link) {\n if (this.opts.shouldTrackOutboundLink(link, parseUrl)) {\n const href = link.getAttribute('href') || link.getAttribute('xlink:href');\n const url = parseUrl(href);\n\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n eventCategory: 'Outbound Link',\n eventAction: event.type,\n eventLabel: url.href,\n };\n\n if (!navigator.sendBeacon &&\n linkClickWillUnloadCurrentPage(event, link)) {\n // Adds a new event handler at the last minute to minimize the chances\n // that another event handler for this click will run after this logic.\n window.addEventListener('click', function(event) {\n // Checks to make sure another event handler hasn't already prevented\n // the default action. If it has the custom redirect isn't needed.\n if (!event.defaultPrevented) {\n // Stops the click and waits until the hit is complete (with\n // timeout) for browsers that don't support beacon.\n event.preventDefault();\n defaultFields.hitCallback = withTimeout(function() {\n location.href = href;\n });\n }\n });\n }\n\n /** @type {FieldsObj} */\n const userFields = assign({}, this.opts.fieldsObj,\n getAttributeFields(link, this.opts.attributePrefix));\n\n this.tracker.send('event', createFieldsObj(\n defaultFields, userFields, this.tracker, this.opts.hitFilter, link));\n }\n }\n\n /**\n * Determines whether or not the tracker should send a hit when a link is\n * clicked. By default links with a hostname property not equal to the current\n * hostname are tracked.\n * @param {Element} link The link that was clicked on.\n * @param {Function} parseUrlFn A cross-browser utility method for url\n * parsing (note: renamed to disambiguate when compiling).\n * @return {boolean} Whether or not the link should be tracked.\n */\n shouldTrackOutboundLink(link, parseUrlFn) {\n const href = link.getAttribute('href') || link.getAttribute('xlink:href');\n const url = parseUrlFn(href);\n return url.hostname != location.hostname &&\n url.protocol.slice(0, 4) == 'http';\n }\n\n /**\n * Removes all event listeners and instance properties.\n */\n remove() {\n Object.keys(this.delegates).forEach((key) => {\n this.delegates[key].destroy();\n });\n }\n}\n\n\nprovide('outboundLinkTracker', OutboundLinkTracker);\n\n\n/**\n * Determines if a link click event will cause the current page to upload.\n * Note: most link clicks *will* cause the current page to unload because they\n * initiate a page navigation. The most common reason a link click won't cause\n * the page to unload is if the clicked was to open the link in a new tab.\n * @param {Event} event The DOM event.\n * @param {Element} link The link element clicked on.\n * @return {boolean} True if the current page will be unloaded.\n */\nfunction linkClickWillUnloadCurrentPage(event, link) {\n return !(\n // The event type can be customized; we only care about clicks here.\n event.type != 'click' ||\n // Links with target=\"_blank\" set will open in a new window/tab.\n link.target == '_blank' ||\n // On mac, command clicking will open a link in a new tab. Control\n // clicking does this on windows.\n event.metaKey || event.ctrlKey ||\n // Shift clicking in Chrome/Firefox opens the link in a new window\n // In Safari it adds the URL to a favorites list.\n event.shiftKey ||\n // On Mac, clicking with the option key is used to download a resouce.\n event.altKey ||\n // Middle mouse button clicks (which == 2) are used to open a link\n // in a new tab, and right clicks (which == 3) on Firefox trigger\n // a click event.\n event.which > 1);\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {NULL_DIMENSION} from '../constants';\nimport MethodChain from '../method-chain';\nimport provide from '../provide';\nimport Session from '../session';\nimport Store from '../store';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj, isObject, now, uuid} from '../utilities';\n\n\nconst HIDDEN = 'hidden';\nconst VISIBLE = 'visible';\nconst PAGE_ID = uuid();\nconst SECONDS = 1000;\n\n\n/**\n * Class for the `pageVisibilityTracker` analytics.js plugin.\n * @implements {PageVisibilityTrackerPublicInterface}\n */\nclass PageVisibilityTracker {\n /**\n * Registers outbound link tracking on tracker object.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.PAGE_VISIBILITY_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n /** @type {PageVisibilityTrackerOpts} */\n const defaultOpts = {\n sessionTimeout: Session.DEFAULT_TIMEOUT,\n // timeZone: undefined,\n // visibleMetricIndex: undefined,\n fieldsObj: {},\n // hitFilter: undefined\n };\n\n this.opts = /** @type {PageVisibilityTrackerOpts} */ (\n assign(defaultOpts, opts));\n\n this.tracker = tracker;\n this.lastPageState = null;\n\n // Binds methods to `this`.\n this.trackerSetOverride = this.trackerSetOverride.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleWindowUnload = this.handleWindowUnload.bind(this);\n this.handleExternalStoreSet = this.handleExternalStoreSet.bind(this);\n\n // Creates the store and binds storage change events.\n this.store = Store.getOrCreate(\n tracker.get('trackingId'), 'plugins/page-visibility-tracker');\n this.store.on('externalSet', this.handleExternalStoreSet);\n\n // Creates the session and binds session events.\n this.session = new Session(\n tracker, this.opts.sessionTimeout, this.opts.timeZone);\n\n // Override the built-in tracker.set method to watch for changes.\n MethodChain.add(tracker, 'set', this.trackerSetOverride);\n\n document.addEventListener('visibilitychange', this.handleChange);\n window.addEventListener('unload', this.handleWindowUnload);\n if (document.visibilityState == VISIBLE) {\n this.handleChange();\n }\n }\n\n /**\n * Inspects the last visibility state change data and determines if a\n * visibility event needs to be tracked based on the current visibility\n * state and whether or not the session has expired. If the session has\n * expired, a change to `visible` will trigger an additional pageview.\n * This method also sends as the event value (and optionally a custom metric)\n * the elapsed time between this event and the previously reported change\n * in the same session, allowing you to more accurately determine when users\n * were actually looking at your page versus when it was in the background.\n */\n handleChange() {\n const lastStoredChange = this.validateChangeData(this.store.get());\n\n /** @type {PageVisibilityStoreData} */\n const change = {\n time: now(),\n state: document.visibilityState,\n pageId: PAGE_ID,\n };\n\n if (this.session.isExpired()) {\n if (document.visibilityState == HIDDEN) {\n // Hidden events should never be sent if a session has expired (if\n // they are, they'll likely start a new session with just this event).\n this.store.clear();\n } else {\n // If the session has expired, changes to visible should be considered\n // a new pageview rather than a visibility event.\n // This behavior ensures all sessions contain a pageview so\n // session-level page dimensions and metrics (e.g. ga:landingPagePath\n // and ga:entrances) are correct.\n\n /** @type {FieldsObj} */\n const defaultFields = {transport: 'beacon'};\n this.tracker.send('pageview',\n createFieldsObj(defaultFields, this.opts.fieldsObj,\n this.tracker, this.opts.hitFilter));\n\n this.store.set(change);\n }\n } else {\n if (lastStoredChange.pageId == PAGE_ID &&\n lastStoredChange.state == VISIBLE) {\n this.sendPageVisibilityEvent(lastStoredChange);\n }\n this.store.set(change);\n }\n\n this.lastPageState = document.visibilityState;\n }\n\n /**\n * Retroactively updates the stored change data in cases where it's known to\n * be out of sync.\n * This plugin keeps track of each visiblity change and stores the last one\n * in localStorage. LocalStorage is used to handle situations where the user\n * has multiple page open at the same time and we don't want to\n * double-report page visibility in those cases.\n * However, a problem can occur if a user closes a page when one or more\n * visible pages are still open. In such cases it's impossible to know\n * which of the remaining pages the user will interact with next.\n * To solve this problem we wait for the next change on any page and then\n * retroactively update the stored data to reflect the current page as being\n * the page on which the last change event occured and measure visibility\n * from that point.\n * @param {PageVisibilityStoreData} lastStoredChange\n * @return {PageVisibilityStoreData}\n */\n validateChangeData(lastStoredChange) {\n if (this.lastPageState == VISIBLE &&\n lastStoredChange.state == HIDDEN &&\n lastStoredChange.pageId != PAGE_ID) {\n lastStoredChange.state = VISIBLE;\n lastStoredChange.pageId = PAGE_ID;\n this.store.set(lastStoredChange);\n }\n return lastStoredChange;\n }\n\n /**\n * Sends a Page Visibility event with the passed event action and visibility\n * state. If a previous state change exists within the same session, the time\n * delta is tracked as the event label and optionally as a custom metric.\n * @param {PageVisibilityStoreData} lastStoredChange\n * @param {number|undefined=} hitTime A hit timestap used to help ensure\n * original order when reporting across multiple windows/tabs.\n */\n sendPageVisibilityEvent(lastStoredChange, hitTime = undefined) {\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n nonInteraction: true,\n eventCategory: 'Page Visibility',\n eventAction: 'track',\n eventLabel: NULL_DIMENSION,\n };\n if (hitTime) {\n defaultFields.queueTime = now() - hitTime;\n }\n\n const delta = this.getTimeSinceLastStoredChange(lastStoredChange, hitTime);\n\n // If at least a one second delta exists, report it.\n if (delta) {\n defaultFields.eventValue = delta;\n\n // If a custom metric was specified, set it equal to the event value.\n if (this.opts.visibleMetricIndex) {\n defaultFields['metric' + this.opts.visibleMetricIndex] = delta;\n }\n }\n\n this.tracker.send('event',\n createFieldsObj(defaultFields, this.opts.fieldsObj,\n this.tracker, this.opts.hitFilter));\n }\n\n /**\n * Detects changes to the tracker object and triggers an update if the page\n * field has changed.\n * @param {function(...*)} originalMethod A reference to the overridden\n * method.\n * @return {function(...*)}\n */\n trackerSetOverride(originalMethod) {\n return (...args) => {\n /** @type {!FieldsObj} */\n const fields = isObject(args[0]) ? args[0] : {[args[0]]: args[1]};\n if (fields.page && fields.page !== this.tracker.get('page')) {\n if (this.lastPageState == VISIBLE) {\n this.handleChange();\n }\n }\n originalMethod(...args);\n };\n }\n\n /**\n * Calculates the time since the last visibility change event in the current\n * session. If the session has expired the reported time is zero.\n * @param {PageVisibilityStoreData} lastStoredChange\n * @param {number=} hitTime The timestamp of the current hit, defaulting\n * to now.\n * @return {number} The time (in ms) since the last change.\n */\n getTimeSinceLastStoredChange(lastStoredChange, hitTime = now()) {\n const isSessionActive = !this.session.isExpired();\n const timeSinceLastStoredChange = lastStoredChange.time &&\n Math.round((hitTime - lastStoredChange.time) / SECONDS);\n\n return isSessionActive &&\n timeSinceLastStoredChange > 0 ? timeSinceLastStoredChange : 0;\n }\n\n /**\n * Handles responding to the `storage` event.\n * The code on this page needs to be informed when other tabs or windows are\n * updating the stored page visibility state data. This method checks to see\n * if a hidden state is stored when there are still visible tabs open, which\n * can happen if multiple windows are open at the same time.\n * @param {PageVisibilityStoreData} newData\n * @param {PageVisibilityStoreData} oldData\n */\n handleExternalStoreSet(newData, oldData) {\n // If the change times are the same, then the previous write only\n // updated the active page ID. It didn't enter a new state and thus no\n // hits should be sent.\n if (newData.time == oldData.time) return;\n\n // Page Visibility events must be sent by the tracker on the page\n // where the original event occurred. So if a change happens on another\n // page, but this page is where the previous change event occurred, then\n // this page is the one that needs to send the event (so all dimension\n // data is correct).\n if (oldData.pageId == PAGE_ID &&\n oldData.state == VISIBLE) {\n this.sendPageVisibilityEvent(oldData, newData.time);\n }\n }\n\n /**\n * Handles responding to the `unload` event.\n * Since some browsers don't emit a `visibilitychange` event in all cases\n * where a page might be unloaded, it's necessary to hook into the `unload`\n * event to ensure the correct state is always stored.\n */\n handleWindowUnload() {\n // If the stored visibility state isn't hidden when the unload event\n // fires, it means the visibilitychange event didn't fire as the document\n // was being unloaded, so we invoke it manually.\n if (this.lastPageState != HIDDEN) {\n this.handleChange();\n }\n }\n\n /**\n * Removes all event listeners and restores overridden methods.\n */\n remove() {\n this.session.destroy();\n MethodChain.remove(this.tracker, 'set', this.trackerSetOverride);\n window.removeEventListener('unload', this.handleWindowUnload);\n document.removeEventListener('visibilitychange', this.handleChange);\n }\n}\n\n\nprovide('pageVisibilityTracker', PageVisibilityTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj} from '../utilities';\n\n\n/**\n * Class for the `socialWidgetTracker` analytics.js plugin.\n * @implements {SocialWidgetTrackerPublicInterface}\n */\nclass SocialWidgetTracker {\n /**\n * Registers social tracking on tracker object.\n * Supports both declarative social tracking via HTML attributes as well as\n * tracking for social events when using official Twitter or Facebook widgets.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.SOCIAL_WIDGET_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!window.addEventListener) return;\n\n /** @type {SocialWidgetTrackerOpts} */\n const defaultOpts = {\n fieldsObj: {},\n hitFilter: null,\n };\n\n this.opts = /** @type {SocialWidgetTrackerOpts} */ (\n assign(defaultOpts, opts));\n\n this.tracker = tracker;\n\n // Binds methods to `this`.\n this.addWidgetListeners = this.addWidgetListeners.bind(this);\n this.addTwitterEventHandlers = this.addTwitterEventHandlers.bind(this);\n this.handleTweetEvents = this.handleTweetEvents.bind(this);\n this.handleFollowEvents = this.handleFollowEvents.bind(this);\n this.handleLikeEvents = this.handleLikeEvents.bind(this);\n this.handleUnlikeEvents = this.handleUnlikeEvents.bind(this);\n\n if (document.readyState != 'complete') {\n // Adds the widget listeners after the window's `load` event fires.\n // If loading widgets using the officially recommended snippets, they\n // will be available at `window.load`. If not users can call the\n // `addWidgetListeners` method manually.\n window.addEventListener('load', this.addWidgetListeners);\n } else {\n this.addWidgetListeners();\n }\n }\n\n\n /**\n * Invokes the methods to add Facebook and Twitter widget event listeners.\n * Ensures the respective global namespaces are present before adding.\n */\n addWidgetListeners() {\n if (window.FB) this.addFacebookEventHandlers();\n if (window.twttr) this.addTwitterEventHandlers();\n }\n\n /**\n * Adds event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons. Note: this does not capture tweet or\n * follow events emitted by other Twitter widgets (tweet, timeline, etc.).\n */\n addTwitterEventHandlers() {\n try {\n window.twttr.ready(() => {\n window.twttr.events.bind('tweet', this.handleTweetEvents);\n window.twttr.events.bind('follow', this.handleFollowEvents);\n });\n } catch(err) {\n // Do nothing.\n }\n }\n\n /**\n * Removes event handlers for the \"tweet\" and \"follow\" events emitted by the\n * official tweet and follow buttons.\n */\n removeTwitterEventHandlers() {\n try {\n window.twttr.ready(() => {\n window.twttr.events.unbind('tweet', this.handleTweetEvents);\n window.twttr.events.unbind('follow', this.handleFollowEvents);\n });\n } catch(err) {\n // Do nothing.\n }\n }\n\n /**\n * Adds event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\n addFacebookEventHandlers() {\n try {\n window.FB.Event.subscribe('edge.create', this.handleLikeEvents);\n window.FB.Event.subscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {\n // Do nothing.\n }\n }\n\n /**\n * Removes event handlers for the \"like\" and \"unlike\" events emitted by the\n * official Facebook like button.\n */\n removeFacebookEventHandlers() {\n try {\n window.FB.Event.unsubscribe('edge.create', this.handleLikeEvents);\n window.FB.Event.unsubscribe('edge.remove', this.handleUnlikeEvents);\n } catch(err) {\n // Do nothing.\n }\n }\n\n /**\n * Handles `tweet` events emitted by the Twitter JS SDK.\n * @param {TwttrEvent} event The Twitter event object passed to the handler.\n */\n handleTweetEvents(event) {\n // Ignores tweets from widgets that aren't the tweet button.\n if (event.region != 'tweet') return;\n\n const url = event.data.url || event.target.getAttribute('data-url') ||\n location.href;\n\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Twitter',\n socialAction: 'tweet',\n socialTarget: url,\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n\n /**\n * Handles `follow` events emitted by the Twitter JS SDK.\n * @param {TwttrEvent} event The Twitter event object passed to the handler.\n */\n handleFollowEvents(event) {\n // Ignore follows from widgets that aren't the follow button.\n if (event.region != 'follow') return;\n\n const screenName = event.data.screen_name ||\n event.target.getAttribute('data-screen-name');\n\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Twitter',\n socialAction: 'follow',\n socialTarget: screenName,\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n\n /**\n * Handles `like` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the like event.\n */\n handleLikeEvents(url) {\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Facebook',\n socialAction: 'like',\n socialTarget: url,\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n\n /**\n * Handles `unlike` events emitted by the Facebook JS SDK.\n * @param {string} url The URL corresponding to the unlike event.\n */\n handleUnlikeEvents(url) {\n /** @type {FieldsObj} */\n const defaultFields = {\n transport: 'beacon',\n socialNetwork: 'Facebook',\n socialAction: 'unlike',\n socialTarget: url,\n };\n this.tracker.send('social', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n\n /**\n * Removes all event listeners and instance properties.\n */\n remove() {\n window.removeEventListener('load', this.addWidgetListeners);\n this.removeFacebookEventHandlers();\n this.removeTwitterEventHandlers();\n }\n}\n\n\nprovide('socialWidgetTracker', SocialWidgetTracker);\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport MethodChain from '../method-chain';\nimport provide from '../provide';\nimport {plugins, trackUsage} from '../usage';\nimport {assign, createFieldsObj} from '../utilities';\n\n\n/**\n * Class for the `urlChangeTracker` analytics.js plugin.\n * @implements {UrlChangeTrackerPublicInterface}\n */\nclass UrlChangeTracker {\n /**\n * Adds handler for the history API methods\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?Object} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n trackUsage(tracker, plugins.URL_CHANGE_TRACKER);\n\n // Feature detects to prevent errors in unsupporting browsers.\n if (!history.pushState || !window.addEventListener) return;\n\n /** @type {UrlChangeTrackerOpts} */\n const defaultOpts = {\n shouldTrackUrlChange: this.shouldTrackUrlChange,\n trackReplaceState: false,\n fieldsObj: {},\n hitFilter: null,\n };\n\n this.opts = /** @type {UrlChangeTrackerOpts} */ (assign(defaultOpts, opts));\n\n this.tracker = tracker;\n\n // Sets the initial page field.\n // Don't set this on the tracker yet so campaign data can be retreived\n // from the location field.\n this.path = getPath();\n\n // Binds methods.\n this.pushStateOverride = this.pushStateOverride.bind(this);\n this.replaceStateOverride = this.replaceStateOverride.bind(this);\n this.handlePopState = this.handlePopState.bind(this);\n\n // Watches for history changes.\n MethodChain.add(history, 'pushState', this.pushStateOverride);\n MethodChain.add(history, 'replaceState', this.replaceStateOverride);\n window.addEventListener('popstate', this.handlePopState);\n }\n\n /**\n * Handles invocations of the native `history.pushState` and calls\n * `handleUrlChange()` indicating that the history updated.\n * @param {!Function} originalMethod A reference to the overridden method.\n * @return {!Function}\n */\n pushStateOverride(originalMethod) {\n return (...args) => {\n originalMethod(...args);\n this.handleUrlChange(true);\n }\n }\n\n /**\n * Handles invocations of the native `history.replaceState` and calls\n * `handleUrlChange()` indicating that history was replaced.\n * @param {!Function} originalMethod A reference to the overridden method.\n * @return {!Function}\n */\n replaceStateOverride(originalMethod) {\n return (...args) => {\n originalMethod(...args);\n this.handleUrlChange(false);\n }\n }\n\n /**\n * Handles responding to the popstate event and calls\n * `handleUrlChange()` indicating that history was updated.\n */\n handlePopState() {\n this.handleUrlChange(true);\n }\n\n /**\n * Updates the page and title fields on the tracker and sends a pageview\n * if a new history entry was created.\n * @param {boolean} historyDidUpdate True if the history was changed via\n * `pushState()` or the `popstate` event. False if the history was just\n * modified via `replaceState()`.\n */\n handleUrlChange(historyDidUpdate) {\n // Calls the update logic asychronously to help ensure that app logic\n // responding to the URL change happens prior to this.\n setTimeout(() => {\n const oldPath = this.path;\n const newPath = getPath();\n\n if (oldPath != newPath &&\n this.opts.shouldTrackUrlChange.call(this, newPath, oldPath)) {\n this.path = newPath;\n this.tracker.set({\n page: newPath,\n title: document.title,\n });\n\n if (historyDidUpdate || this.opts.trackReplaceState) {\n /** @type {FieldsObj} */\n const defaultFields = {transport: 'beacon'};\n this.tracker.send('pageview', createFieldsObj(defaultFields,\n this.opts.fieldsObj, this.tracker, this.opts.hitFilter));\n }\n }\n }, 0);\n }\n\n /**\n * Determines whether or not the tracker should send a hit with the new page\n * data. This default implementation can be overrided in the config options.\n * @param {string} newPath The path after the URL change.\n * @param {string} oldPath The path prior to the URL change.\n * @return {boolean} Whether or not the URL change should be tracked.\n */\n shouldTrackUrlChange(newPath, oldPath) {\n return !!(newPath && oldPath);\n }\n\n /**\n * Removes all event listeners and restores overridden methods.\n */\n remove() {\n MethodChain.remove(history, 'pushState', this.pushStateOverride);\n MethodChain.remove(history, 'replaceState', this.replaceStateOverride);\n window.removeEventListener('popstate', this.handlePopState);\n }\n}\n\n\nprovide('urlChangeTracker', UrlChangeTracker);\n\n\n/**\n * @return {string} The path value of the current URL.\n */\nfunction getPath() {\n return location.pathname + location.search;\n}\n"]}