1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
15 * @param {!function(this:T,VALUE):?} cb
16 * @param {T=} opt_scope
17 * @return {!goog.async.Deferred}
20 goog
.async
.Deferred
.prototype.addCallback
;
24 /** @typedef {string} */
27 /** @enum {analytics.HitType} */
28 analytics
.HitTypes
= {
32 TRANSACTION
: 'transaction',
35 EXCEPTION
: 'exception'
42 * valueType: analytics.ValueType,
43 * maxLength: (number|undefined),
44 * defaultValue: (string|undefined)
49 /** @typedef {string|number|boolean} */
52 /** @typedef {string} */
57 * @param {string} appName
58 * @param {string=} opt_appVersion
59 * @return {!analytics.GoogleAnalytics}
65 analytics
.GoogleAnalytics
;
68 * @param {string} trackingId
69 * @return {!analytics.Tracker}
71 analytics
.GoogleAnalytics
.prototype.getTracker
;
73 /** @return {!goog.async.Deferred.<!analytics.Config>} */
74 analytics
.GoogleAnalytics
.prototype.getConfig
;
80 /** @typedef {function(!analytics.Tracker.Hit)} */
81 analytics
.Tracker
.Filter
;
84 * @param {!analytics.HitType|!analytics.EventBuilder} hitType
85 * @param {(!analytics.ParameterMap|
86 * !Object.<string, !analytics.Value>)=} opt_extraParams
87 * @return {!goog.async.Deferred}
89 analytics
.Tracker
.prototype.send
;
92 * @param {string} description
93 * @return {!goog.async.Deferred}
95 analytics
.Tracker
.prototype.sendAppView
;
98 * @param {string} category
99 * @param {string} action
100 * @param {string=} opt_label
101 * @param {number=} opt_value
102 * @return {!goog.async.Deferred}
104 analytics
.Tracker
.prototype.sendEvent
;
107 * @param {string} network Specifies the social network, for example Facebook
109 * @param {string} action Specifies the social interaction action.
110 * For example on Google Plus when a user clicks the +1 button,
111 * the social action is 'plus'.
112 * @param {string} target Specifies the target of a social interaction.
113 * This value is typically a URL but can be any text.
114 * @return {!goog.async.Deferred}
116 analytics
.Tracker
.prototype.sendSocial
;
119 * @param {string=} opt_description Specifies the description of an exception.
120 * @param {boolean=} opt_fatal Was the exception fatal.
121 * @return {!goog.async.Deferred}
123 analytics
.Tracker
.prototype.sendException
;
126 * @param {string} category Specifies the category of the timing.
127 * @param {string} variable Specifies the variable name of the timing.
128 * @param {number} value Specifies the value of the timing.
129 * @param {string=} opt_label Specifies the optional label of the timing.
130 * @param {number=} opt_sampleRate
131 * @return {!goog.async.Deferred}
133 analytics
.Tracker
.prototype.sendTiming
;
135 analytics
.Tracker
.prototype.forceSessionStart
;
138 * @param {string} category
139 * @param {string} variable
140 * @param {string=} opt_label
141 * @param {number=} opt_sampleRate
142 * @return {!analytics.Tracker.Timing}
144 analytics
.Tracker
.prototype.startTiming
;
147 analytics
.Tracker
.Timing
;
149 /** @return {!goog.async.Deferred} */
150 analytics
.Tracker
.Timing
.prototype.send
;
152 /** @param {!analytics.Tracker.Filter} filter */
153 analytics
.Tracker
.prototype.addFilter
;
156 analytics
.Tracker
.Hit
;
158 /** @return {!analytics.HitType} */
159 analytics
.Tracker
.Hit
.prototype.getHitType
;
161 /** @return {!analytics.ParameterMap} */
162 analytics
.Tracker
.Hit
.prototype.getParameters
;
164 analytics
.Tracker
.Hit
.prototype.cancel
;
168 analytics
.Config = function() {};
170 /** @param {boolean} permitted */
171 analytics
.Config
.prototype.setTrackingPermitted
;
173 /** @return {boolean} */
174 analytics
.Config
.prototype.isTrackingPermitted
;
176 /** @param {number} sampleRate */
177 analytics
.Config
.prototype.setSampleRate
;
181 analytics
.ParameterMap
;
185 * key: !analytics.Parameter,
186 * value: !analytics.Value
189 analytics
.ParameterMap
.Entry
;
192 * @param {!analytics.Parameter} param
193 * @param {!analytics.Value} value
195 analytics
.ParameterMap
.prototype.set;
198 * @param {!analytics.Parameter} param
199 * @return {?analytics.Value}
201 analytics
.ParameterMap
.prototype.get;
203 /** @param {!analytics.Parameter} param */
204 analytics
.ParameterMap
.prototype.remove
;
206 /** @return {!Object.<string, analytics.Value>} */
207 analytics
.ParameterMap
.prototype.toObject
;
211 analytics
.EventBuilder
;
213 /** @typedef {{ index: number, value: string }} */
214 analytics
.EventBuilder
.Dimension
;
216 /** @typedef {{ index: number, value: number }} */
217 analytics
.EventBuilder
.Metric
;
219 /** @return {!analytics.EventBuilder} */
220 analytics
.EventBuilder
.builder
;
223 * @param {string} category
224 * @return {!analytics.EventBuilder}
226 analytics
.EventBuilder
.prototype.category
;
229 * @param {string} action
230 * @return {!analytics.EventBuilder}
232 analytics
.EventBuilder
.prototype.action
;
235 * @param {string} label
236 * @return {!analytics.EventBuilder}
238 analytics
.EventBuilder
.prototype.label
;
241 * @param {number} value
242 * @return {!analytics.EventBuilder}
244 analytics
.EventBuilder
.prototype.value
;
247 * @param {!analytics.EventBuilder.Dimension} dimension
248 * @return {!analytics.EventBuilder}
250 analytics
.EventBuilder
.prototype.dimension
;
253 * @param {!analytics.EventBuilder.Metric} metric
254 * @return {!analytics.EventBuilder}
256 analytics
.EventBuilder
.prototype.metric
;
259 * @param {!analytics.Tracker} tracker
260 * @return {!goog.async.Deferred}
262 analytics
.EventBuilder
.prototype.send
;
264 /** @param {!analytics.ParameterMap} parameters */
265 analytics
.EventBuilder
.prototype.collect
;