import { ServerStandardEvent } from '../track/rdt.js'; import { TrackEvent, UserProvidedData } from '../track/types.js'; import '../track/gtag.js'; /** * https://ads-api.reddit.com/docs/v3/operations/Post%20Conversion%20Events * https://business.reddithelp.com/s/article/map-a-catalog-to-a-signal-source */ interface RedditEvent { /** Match keys: Share user identifiers to match conversions to a Reddit ad engagement. */ click_id?: string; /** Unix epoch timestamp in milliseconds, event_at can't be older than seven days. */ event_at: number; action_source: 'WEBSITE' | 'APP' | string; type: { tracking_type: ServerStandardEvent | 'CUSTOM'; custom_event_name?: string; }; /** * Event metadata * Share as much additional information about your conversion event as you'd like. If you're * using the Conversions API with the pixel, conversion_id is required for deduplication. */ metadata?: { conversion_id?: string; currency?: string; item_count?: number; value?: number; products?: { id: string; name?: string; category?: string; }[]; }; user?: { email?: string; external_id?: string; ip_address?: string; phone_number?: string; user_agent?: string; /** The Identifier for Advertisers (IDFA) of the user's Apple device. */ idfa?: string; /** The Android Advertising ID (AAID) of the user's Android device. */ aaid?: string; /** * The value from the first-party Pixel _rdt_uuid cookie on your domain. Note that it is in * the {timestamp}.{uuid} format. You may use the full value or just the UUID portion. * Example: 1684189007728.7c73f2ae-a433-4d7b-9838-f467da98f48e */ uuid?: string; screen_dimensions?: { width: number; height: number; }; /** * A structure of data processing options to specify the processing type for the event * https://business.reddithelp.com/s/article/Limited-Data-Use */ data_processing_options?: { country: string; region: string; modes: string[] | ['LDU']; }; }; } interface CreateRedditEventDTO { data: { test_id?: string; events: RedditEvent[]; }; } declare function getServerEvent(event: TrackEvent, data: UserProvidedData): RedditEvent; declare function sendEvents(accessToken: string, pixelId: string, events: TrackEvent[], data?: UserProvidedData, testId?: string): Promise; export { type CreateRedditEventDTO, type RedditEvent, getServerEvent, sendEvents };