forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfacebook-pixel.d.ts
120 lines (103 loc) · 3.78 KB
/
facebook-pixel.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Type definitions for the Facebook Pixel Tag API
// Project: https://developers.facebook.com/docs/ads-for-websites/tag-api/
// Definitions by: Noctis Hsu <https://github.com/noctishsu/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var fbq:facebook.Pixel.Event;
declare module facebook.Pixel {
interface Event {
(eventType:string, InitialAppId:string):void;
(eventType:string, eventName:string):void;
(eventType:string, eventName:string, parameters:facebook.Pixel.ViewContentParameters):void;
(eventType:string, eventName:string, parameters:ViewContentParameters):void;
(eventType:string, eventName:string, parameters:SearchParameters):void;
(eventType:string, eventName:string, parameters:AddToCartParameters):void;
(eventType:string, eventName:string, parameters:AddToWishlistParameters):void;
(eventType:string, eventName:string, parameters:InitiateCheckoutParameters):void;
(eventType:string, eventName:string, parameters:AddPaymentInfoParameters):void;
(eventType:string, eventName:string, parameters:PurchaseParameters):void;
(eventType:string, eventName:string, parameters:LeadParameters):void;
(eventType:string, eventName:string, parameters:CompleteRegistrationParameters):void;
(eventType:string, eventName:string, parameters:facebook.Pixel.DPA.AddToCartParameters):void;
(eventType:string, eventName:string, parameters:facebook.Pixel.DPA.PurchaseParameters):void;
(eventType:string, eventName:string, parameters:facebook.Pixel.DPA.ViewContentParameters):void;
}
interface ViewContentParameters {
value?:number;
currency?:string;
content_name?:string;
content_type?:string;
content_ids?:string[];
content_category?:string;
}
interface SearchParameters {
value?:number;
currency?:string;
content_category?:string;
content_ids?:string[];
search_string?:string;
}
interface AddToCartParameters {
value?:number;
currency?:string;
content_name?:string;
content_type?:string;
content_ids?:string[];
}
interface AddToWishlistParameters {
value?:number;
currency?:string;
content_name?:string;
content_category?:string;
content_ids?:string[];
}
interface InitiateCheckoutParameters {
value?:number;
currency?:string;
content_name?:string;
content_category?:string;
content_ids?:string[];
num_items?:number;
}
interface AddPaymentInfoParameters {
value?:number;
currency?:string;
content_category?:string;
content_ids?:string[];
}
interface PurchaseParameters {
value:number;
currency:string;
content_name?:string;
content_type?:string;
content_ids?:string[];
num_items?:number;
order_id?:string;
}
interface LeadParameters {
value?:number;
currency?:string;
content_name?:string;
content_category?:string;
}
interface CompleteRegistrationParameters {
value?:number;
currency?:string;
content_name?:string;
status?:string;
}
}
// For Facebook Tag API using Dynamic Product Ads
declare module facebook.Pixel.DPA {
interface ViewContentParameters extends facebook.Pixel.ViewContentParameters {
content_type:string;
content_ids:string[];
}
interface AddToCartParameters extends facebook.Pixel.AddToCartParameters {
content_type:string;
content_ids:string[];
}
interface PurchaseParameters extends facebook.Pixel.PurchaseParameters {
content_type:string;
content_ids:string[];
}
}