forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
piwik-tracker.d.ts
95 lines (80 loc) · 1.93 KB
/
piwik-tracker.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Type definitions for PiwikTracker v0.1.1
// Project: https://www.npmjs.com/package/piwik-tracker
// Definitions by: Guilherme Bernal <https://github.com/lbguilherme>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "piwik-tracker" {
import events = require('events');
export = PiwikTracker;
// refer to http://developer.piwik.org/api-reference/tracking-api
interface PiwikTrackOptions {
// Required parameters
url : string;
// Recommended parameters
action_name? : string;
_id? : string;
rand? : string;
apiv? : number;
// Optional User info
urlref? : string;
_cvar? : string;
_idvc? : string;
_viewts? : string;
_idts? : string;
_rcn? : string;
_rck? : string;
res? : string;
h? : number;
m? : number;
s? : number;
ua? : string;
lang? : string;
uid? : string;
cid? : string;
new_visit? : number;
// Optional Action info
cvar? : string;
link? : string;
download? : string;
search? : string;
search_cat? : string;
search_count? : number;
idgoal? : number;
revenue? : number;
gt_ms? : number;
cs? : string;
// Optional Event Tracking info
e_c? : string;
e_a? : string;
e_n? : string;
e_v? : string;
// Optional Content Tracking info
c_n? : string;
c_p? : string;
c_t? : string;
c_i? : string;
// Optional Ecommerce info
ec_id? : string;
ec_items? : string;
ec_st? : number;
ec_tx? : number;
ec_sh? : number;
ec_dt? : number;
_ects? : number;
// Other parameters (require authentication via token_auth)
token_auth? : string;
cip? : string;
cdt? : string;
country? : string;
region? : string;
city? : string;
lat? : string;
long? : string;
// Other parameters
send_image? : number;
}
class PiwikTracker extends events.EventEmitter {
constructor(siteId : number, trackerUrl : string);
track(options : PiwikTrackOptions) : void;
}
}