@mntm/stats
Version:
A package for integrating analytics tools
34 lines (33 loc) • 1.42 kB
TypeScript
type VKProductEvent = 'view_home' | 'view_category' | 'view_product' | 'view_search' | 'view_other' | 'add_to_wishlist' | 'add_to_cart' | 'remove_from_wishlist' | 'remove_from_cart' | 'init_checkout' | 'add_payment_info' | 'purchase';
type VKProduct = Partial<{
id: string;
group_id: string;
recommended_ids: string;
price: number;
price_old: number;
price_from: boolean;
}>;
type VKProductPrams = Partial<{
products: VKProduct[];
products_recommended_ids: string;
category_ids: string;
business_value: number;
currency_code: string;
total_price: number;
search_string: string;
}>;
type VKGoalEvent = 'add_to_cart' | 'add_to_wishlist' | 'customize_product' | 'initiate_checkout' | 'add_payment_info' | 'purchase' | 'contact' | 'lead' | 'schedule' | 'complete_registration' | 'submit_application' | 'start_trial' | 'subscribe' | 'page_view' | 'view_content' | 'search' | 'find_location' | 'donate' | 'conversion';
type VKPixel = {
hit: () => Promise<boolean>;
event: (event: string) => Promise<boolean>;
audience: (id: number) => Promise<boolean>;
product: (id: number, event: VKProductEvent, params?: VKProductPrams) => Promise<boolean>;
goal: (goal: VKGoalEvent, value?: number) => Promise<boolean>;
};
/**
* Implement VK Pixel
*
* @param code VK-RTRG-XXXXXXX-YYYYY
*/
export declare const createPixelVK: (code: string) => VKPixel;
export {};