forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-google-analytics-service.d.ts
62 lines (52 loc) · 2.28 KB
/
angular-google-analytics-service.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Type definitions for angular-google-analytics v1.1.0
// Project: https://github.com/revolunet/angular-google-analytics
// Definitions by: Matt Wheatley <https://github.com/terrawheat>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace angular.google.analytics {
interface AnalyticsService {
/**
* @summary If logging is enabled then all outbound calls are accessible via an in-memory array.
* This is useful for troubleshooting and seeing the order of outbound calls with parameters.
*/
log: Array<Object>;
/**
* @summary If in offline mode then all calls are queued to an in-memory array for future processing.
* All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log.
*/
offlineQueue: Array<Object>;
/**
* @summary Returns the current URL that would be sent if a `trackPage` call was made.
* @return {string} The URL
*/
getUrl: () => string;
/**
* @summary Manually create classic analytics (ga.js) script tag
*/
createScriptTag: () => void;
/**
* @summary Manually create universal analytics (analytics.js) script tag
*/
createAnalyticsScriptTag: () => void;
/**
* @summary Allows for advanced configuration and definitions in univeral analytics only. This is a no-op when using classic analytics.
*/
set: (key: string, value: any, accountName?: string) => void;
/**
* @summary Creates a new page view event
* @param {string} pageURL URL of page view
* @param {string} title Page Title
* @param {Object} dimensions Additional dimensions and metrics
*/
trackPage: (pageURL: string, title?: string, dimensions?: { [expr: string]: any }) => void;
/**
* @summary Create a new event
*/
trackEvent: (category: string, action: string, label: string, value?: any, nonInteractionFlag?: boolean, dimensions?: { [expr: string]: any }) => void;
trackException: (descrption: string, isFatal: boolean) => void;
/**
* @summary While in offline mode, no calls to the ga function or pushes to the gaq array are made.
* This will queue all calls for later sending once offline mode is reset to false.
*/
offline: (offlineMode: boolean) => void;
}
}