-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: joe-pritchard <joe@joe-pritchard.uk>
- Loading branch information
1 parent
92d6167
commit eb2c9cd
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* eslint-disable camelcase */ | ||
import Vue from 'vue'; | ||
|
||
type FacebookEvent = | ||
| 'AddPaymentInfo' | ||
| 'AddToCart' | ||
| 'AddToWishlist' | ||
| 'CompleteRegistration' | ||
| 'Contact' | ||
| 'CustomizeProduct' | ||
| 'Donate' | ||
| 'InitiateCheckout' | ||
| 'Lead' | ||
| 'PageView' | ||
| 'Purchase' | ||
| 'Schedule' | ||
| 'Search' | ||
| 'StartTrial' | ||
| 'SubmitApplication' | ||
| 'Subscribe' | ||
| 'ViewContent' | ||
| string; | ||
|
||
interface FacebookContentObject { | ||
id: string; | ||
quantity: number; | ||
[prop: string]: string | number; | ||
} | ||
|
||
interface FacebookEventParameters { | ||
content_category?: string; | ||
content_ids?: Array<number | string>; | ||
content_name?: string; | ||
content_type?: 'product' | 'product_group'; | ||
contents?: FacebookContentObject[]; | ||
currency?: string; // The currency for the value specified. | ||
num_items?: number; // Used with InitiateCheckout event. The number of items when checkout was initiated. | ||
predicted_ltv?: number; // Predicted lifetime value of a subscriber as defined by the advertiser and expressed as an exact value. | ||
search_string?: string; // Used with the Search event. The string entered by the user for the search. | ||
status?: boolean; // Used with the CompleteRegistration event, to show the status of the registration. | ||
value?: number; // The value of a user performing this event to the business. | ||
} | ||
|
||
interface NuxtFacebookPixel { | ||
enable(): void; | ||
init(): void; | ||
track(event: null | FacebookEvent, parameters?: FacebookEventParameters): void; | ||
query<T extends object>(key: string, value: string, parameters?: T): void; | ||
} | ||
|
||
declare module 'vue/types/vue' { | ||
interface Vue { | ||
$fb: NuxtFacebookPixel; | ||
} | ||
} |