@walkeros/web-destination-meta
Version:
Meta pixel web destination for walkerOS
162 lines (147 loc) • 5.46 kB
TypeScript
import * as _walkeros_core_dev from '@walkeros/core/dev';
import { z } from '@walkeros/core/dev';
import { Mapping as Mapping$2 } from '@walkeros/core';
import { DestinationWeb } from '@walkeros/web-core';
/**
* Meta Pixel ID
* Must be a numeric string (Facebook Pixel IDs are numeric)
*/
declare const PixelId: z.ZodString;
/**
* Meta Pixel Standard Event Names
* https://developers.facebook.com/docs/meta-pixel/reference
*/
declare const StandardEventName: z.ZodEnum<{
PageView: "PageView";
AddPaymentInfo: "AddPaymentInfo";
AddToCart: "AddToCart";
AddToWishlist: "AddToWishlist";
CompleteRegistration: "CompleteRegistration";
Contact: "Contact";
CustomizeProduct: "CustomizeProduct";
Donate: "Donate";
FindLocation: "FindLocation";
InitiateCheckout: "InitiateCheckout";
Lead: "Lead";
Purchase: "Purchase";
Schedule: "Schedule";
Search: "Search";
StartTrial: "StartTrial";
SubmitApplication: "SubmitApplication";
Subscribe: "Subscribe";
ViewContent: "ViewContent";
}>;
/**
* Custom Event Name
* Any string for custom tracking
*/
declare const CustomEventName: z.ZodString;
declare const SettingsSchema: z.ZodObject<{
pixelId: z.ZodString;
}, z.core.$strip>;
type Settings = z.infer<typeof SettingsSchema>;
declare const MappingSchema: z.ZodObject<{
track: z.ZodOptional<z.ZodEnum<{
PageView: "PageView";
AddPaymentInfo: "AddPaymentInfo";
AddToCart: "AddToCart";
AddToWishlist: "AddToWishlist";
CompleteRegistration: "CompleteRegistration";
Contact: "Contact";
CustomizeProduct: "CustomizeProduct";
Donate: "Donate";
FindLocation: "FindLocation";
InitiateCheckout: "InitiateCheckout";
Lead: "Lead";
Purchase: "Purchase";
Schedule: "Schedule";
Search: "Search";
StartTrial: "StartTrial";
SubmitApplication: "SubmitApplication";
Subscribe: "Subscribe";
ViewContent: "ViewContent";
}>>;
trackCustom: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type Mapping$1 = z.infer<typeof MappingSchema>;
declare const settings: _walkeros_core_dev.JSONSchema;
declare const mapping$1: _walkeros_core_dev.JSONSchema;
declare const index$1_CustomEventName: typeof CustomEventName;
declare const index$1_MappingSchema: typeof MappingSchema;
declare const index$1_PixelId: typeof PixelId;
type index$1_Settings = Settings;
declare const index$1_SettingsSchema: typeof SettingsSchema;
declare const index$1_StandardEventName: typeof StandardEventName;
declare const index$1_settings: typeof settings;
declare namespace index$1 {
export { index$1_CustomEventName as CustomEventName, type Mapping$1 as Mapping, index$1_MappingSchema as MappingSchema, index$1_PixelId as PixelId, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_StandardEventName as StandardEventName, mapping$1 as mapping, index$1_settings as settings };
}
declare global {
interface Window {
_fbq?: facebook.Pixel.Event;
fbq?: facebook.Pixel.Event;
}
}
interface Mapping {
track?: StandardEventNames;
trackCustom?: string;
}
interface Env extends DestinationWeb.Env {
window: {
fbq: facebook.Pixel.Event;
_fbq?: facebook.Pixel.Event;
};
document: {
createElement: (tagName: string) => Element;
head: {
appendChild: (node: unknown) => void;
};
};
}
type Rule = Mapping$2.Rule<Mapping>;
type StandardEventNames = 'PageView' | 'AddPaymentInfo' | 'AddToCart' | 'AddToWishlist' | 'CompleteRegistration' | 'Contact' | 'CustomizeProduct' | 'Donate' | 'FindLocation' | 'InitiateCheckout' | 'Lead' | 'Purchase' | 'Schedule' | 'Search' | 'StartTrial' | 'SubmitApplication' | 'Subscribe' | 'ViewContent' | string;
declare const init: Env | undefined;
declare const push: Env;
declare const env_init: typeof init;
declare const env_push: typeof push;
declare namespace env {
export { env_init as init, env_push as push };
}
declare function Purchase$1(): unknown[];
declare function AddToCart$1(): unknown[];
declare function InitiateCheckout$1(): unknown[];
declare function ViewContent$1(): unknown[];
declare namespace events {
export { AddToCart$1 as AddToCart, InitiateCheckout$1 as InitiateCheckout, Purchase$1 as Purchase, ViewContent$1 as ViewContent };
}
declare const Purchase: Rule;
declare const AddToCart: Rule;
declare const InitiateCheckout: Rule;
declare const ViewContent: Rule;
declare const config: {
order: {
complete: Rule;
};
product: {
view: Rule;
add: Rule;
};
cart: {
view: Rule;
};
};
declare const mapping_AddToCart: typeof AddToCart;
declare const mapping_InitiateCheckout: typeof InitiateCheckout;
declare const mapping_Purchase: typeof Purchase;
declare const mapping_ViewContent: typeof ViewContent;
declare const mapping_config: typeof config;
declare namespace mapping {
export { mapping_AddToCart as AddToCart, mapping_InitiateCheckout as InitiateCheckout, mapping_Purchase as Purchase, mapping_ViewContent as ViewContent, mapping_config as config };
}
declare const index_env: typeof env;
declare const index_events: typeof events;
declare const index_mapping: typeof mapping;
declare namespace index {
export { index_env as env, index_events as events, index_mapping as mapping };
}
export { index as examples, index$1 as schemas };