@vizertech/nextjs-capi
Version:
NextJS 13 Wrapper for fb pixel and capi for graph v17.0 API
47 lines (45 loc) • 1.22 kB
text/typescript
export type FacebookEvent = {
event_name: FB_EVENTS,
event_time?: number, //unix time
action_source?: "website", //TODO: ver que valores son estos,
event_id?: string,
event_source_url?: string,
currency?: 'mxn',
custom_data?: {
content_type?: 'product_group',
currency?: 'MXN',
value?: number,
contents?: ContenidoCompra[]
},
user_data?: {
client_ip_address?: string,
ct?: string[], //hash
external_id?: string[], //hash
fn?: string[], //asj
ph?: string[], //hash
zp?: string[], //hash
client_user_agent?: string,
st?: string[], //hash
country?: string[], //hash
em?: string[] //hash,
fbc?: string,
fbp?: string
},
test_event_code?: string
}
export enum FB_EVENTS {
ADD_TO_CART = 'AddToCart',
ADD_TO_WISHLIST = 'AddToWishlist',
COMPLETE_REGISTRATION = 'CompleteRegistration',
CONTACT = 'Contact',
FIND_LOCATION = 'FindLocation',
PURCHASE = 'Purchase',
SEARCH = 'Search',
LEAD = 'Lead',
VIEW_CONTENT = 'ViewContent'
}
export type ContenidoCompra = {
id: number,
quantity: number,
item_price: number
}