-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
27 lines (24 loc) · 997 Bytes
/
index.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
export declare interface PageViewParam {
hostname : string; // Document Hostname.
pagePath : string; // Page Path.
pageTitle: string; // Title.
}
export declare interface EventParam {
hostname : string; // Document Hostname.
pagePath : string; // Page Path.
pageTitle : string; // Title.
eventCategory: string; // Event Category.
eventAction : string; // Event Action.
eventLabel? : string; // Event label.
eventValue? : number; // Event value.
}
export declare type hitType = 'event' | 'pageview';
export declare class GA {
constructor(propertyId: String);
setClientId(clientId: number): void;
setVersion(version: number): void;
assemblePayloadWithAccount(payload: PageViewParam | EventParam, hitType: hitType) : String;
hit(payload: PageViewParam | EventParam, hitType: hitType): Promise<Boolean>;
pageView(payload: PageViewParam) : Promise<Boolean>;
event(payload: EventParam) : Promise<Boolean>;
}