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;
22 /** @param {VALUE=} opt_result */
23 goog.async.Deferred.prototype.callback;
26 * @param {?(function(this:THIS, VALUE):
27 * (RESULT|IThenable<RESULT>|Thenable))=} opt_onFulfilled
28 * @param {?(function(this:THIS, *): *)=} opt_onRejected
29 * @param {THIS=} opt_context
30 * @return {!Promise<RESULT>}
31 * @template RESULT,THIS
33 goog.async.Deferred.prototype.then;
37 /** @typedef {string} */
40 /** @enum {analytics.HitType} */
41 analytics.HitTypes = {
45 TRANSACTION: 'transaction',
48 EXCEPTION: 'exception'
55 * valueType: analytics.ValueType,
56 * maxLength: (number|undefined),
57 * defaultValue: (string|undefined)
62 /** @typedef {string|number|boolean} */
65 /** @typedef {string} */
70 * @param {string} appName
71 * @param {string=} opt_appVersion
72 * @return {!analytics.GoogleAnalytics}
78 analytics.GoogleAnalytics;
81 * @param {string} trackingId
82 * @return {!analytics.Tracker}
84 analytics.GoogleAnalytics.prototype.getTracker;
86 /** @return {!goog.async.Deferred.<!analytics.Config>} */
87 analytics.GoogleAnalytics.prototype.getConfig;
93 /** @typedef {function(!analytics.Tracker.Hit)} */
94 analytics.Tracker.Filter;
97 * @param {!analytics.HitType|!analytics.EventBuilder} hitType
98 * @param {(!analytics.ParameterMap|
99 * !Object.<string, !analytics.Value>)=} opt_extraParams
100 * @return {!goog.async.Deferred}
102 analytics.Tracker.prototype.send;
105 * @param {string} description
106 * @return {!goog.async.Deferred}
108 analytics.Tracker.prototype.sendAppView;
111 * @param {string} category
112 * @param {string} action
113 * @param {string=} opt_label
114 * @param {number=} opt_value
115 * @return {!goog.async.Deferred}
117 analytics.Tracker.prototype.sendEvent;
120 * @param {string} network Specifies the social network, for example Facebook
122 * @param {string} action Specifies the social interaction action.
123 * For example on Google Plus when a user clicks the +1 button,
124 * the social action is 'plus'.
125 * @param {string} target Specifies the target of a social interaction.
126 * This value is typically a URL but can be any text.
127 * @return {!goog.async.Deferred}
129 analytics.Tracker.prototype.sendSocial;
132 * @param {string=} opt_description Specifies the description of an exception.
133 * @param {boolean=} opt_fatal Was the exception fatal.
134 * @return {!goog.async.Deferred}
136 analytics.Tracker.prototype.sendException;
139 * @param {string} category Specifies the category of the timing.
140 * @param {string} variable Specifies the variable name of the timing.
141 * @param {number} value Specifies the value of the timing.
142 * @param {string=} opt_label Specifies the optional label of the timing.
143 * @param {number=} opt_sampleRate
144 * @return {!goog.async.Deferred}
146 analytics.Tracker.prototype.sendTiming;
148 analytics.Tracker.prototype.forceSessionStart;
151 * @param {string} category
152 * @param {string} variable
153 * @param {string=} opt_label
154 * @param {number=} opt_sampleRate
155 * @return {!analytics.Tracker.Timing}
157 analytics.Tracker.prototype.startTiming;
160 analytics.Tracker.Timing;
162 /** @return {!goog.async.Deferred} */
163 analytics.Tracker.Timing.prototype.send;
165 /** @param {!analytics.Tracker.Filter} filter */
166 analytics.Tracker.prototype.addFilter;
169 analytics.Tracker.Hit;
171 /** @return {!analytics.HitType} */
172 analytics.Tracker.Hit.prototype.getHitType;
174 /** @return {!analytics.ParameterMap} */
175 analytics.Tracker.Hit.prototype.getParameters;
177 analytics.Tracker.Hit.prototype.cancel;
181 analytics.Config = function() {};
183 /** @param {boolean} permitted */
184 analytics.Config.prototype.setTrackingPermitted;
186 /** @return {boolean} */
187 analytics.Config.prototype.isTrackingPermitted;
189 /** @param {number} sampleRate */
190 analytics.Config.prototype.setSampleRate;
192 /** @return {!goog.async.Deferred} Settles once the id has been reset. */
193 analytics.Config.prototype.resetUserId;
197 analytics.ParameterMap;
201 * key: !analytics.Parameter,
202 * value: !analytics.Value
205 analytics.ParameterMap.Entry;
208 * @param {!analytics.Parameter} param
209 * @param {!analytics.Value} value
211 analytics.ParameterMap.prototype.set;
214 * @param {!analytics.Parameter} param
215 * @return {?analytics.Value}
217 analytics.ParameterMap.prototype.get;
219 /** @param {!analytics.Parameter} param */
220 analytics.ParameterMap.prototype.remove;
222 /** @return {!Object.<string, analytics.Value>} */
223 analytics.ParameterMap.prototype.toObject;
227 analytics.EventBuilder;
229 /** @typedef {{ index: number, value: string }} */
230 analytics.EventBuilder.Dimension;
232 /** @typedef {{ index: number, value: number }} */
233 analytics.EventBuilder.Metric;
235 /** @return {!analytics.EventBuilder} */
236 analytics.EventBuilder.builder;
239 * @param {string} category
240 * @return {!analytics.EventBuilder}
242 analytics.EventBuilder.prototype.category;
245 * @param {string} action
246 * @return {!analytics.EventBuilder}
248 analytics.EventBuilder.prototype.action;
251 * @param {string} label
252 * @return {!analytics.EventBuilder}
254 analytics.EventBuilder.prototype.label;
257 * @param {number} value
258 * @return {!analytics.EventBuilder}
260 analytics.EventBuilder.prototype.value;
263 * @param {!analytics.EventBuilder.Dimension} dimension
264 * @return {!analytics.EventBuilder}
266 analytics.EventBuilder.prototype.dimension;
269 * @param {!analytics.EventBuilder.Metric} metric
270 * @return {!analytics.EventBuilder}
272 analytics.EventBuilder.prototype.metric;
275 * @param {!analytics.Tracker} tracker
276 * @return {!goog.async.Deferred}
278 analytics.EventBuilder.prototype.send;
280 /** @param {!analytics.ParameterMap} parameters */
281 analytics.EventBuilder.prototype.collect;