Last active
November 12, 2025 12:37
-
-
Save btg5679/b4f2e9cfa0b898cfe2aa9a91beec78cd to your computer and use it in GitHub Desktop.
Partners Advertising Event
This file contains hidden or 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
| // SAMPLE Event Contract | |
| interface CampaignEvent { | |
| // Event Metadata | |
| eventType: 'impression' | 'click'; | |
| timestamp: number; | |
| searchId?: string; | |
| sessionId?: string; | |
| userId?: string; | |
| // Surface Context | |
| surface: { | |
| type: 'search_results' | 'property_details' | 'email' | 'external_site' | 'mobile_app'; | |
| url: string; | |
| referrer?: string; | |
| placement: string; // 'top-left', 'header', 'sidebar', etc. | |
| }; | |
| // System Context | |
| system: { | |
| applicationId: 'members' | 'groups' | 'spaces' | 'cars' | 'suppliers'; | |
| version: string; // consuming app version | |
| environment: 'dev' | 'staging' | 'prod'; | |
| }; | |
| // Campaign Identity | |
| campaign: { | |
| id: string; | |
| type: 'spotlight' | 'double_rewards' | 'deals'; | |
| treatment?: string; // 'position_one', 'sponsored', 'badgeless' | |
| partnerId: string; // Who's paying for this | |
| budgetCategory: 'property_owned' | 'externally_sponsored'; | |
| }; | |
| // Content Identity (for Ads - this is theoretical) | |
| advertisement?: { | |
| id: string; | |
| creativeId: string; | |
| contentType: 'destination_marketing' | 'property_promotion' | 'brand_awareness'; | |
| title?: string; | |
| }; | |
| // Property Context | |
| property: { | |
| id: number; | |
| position: number; // Position in search results/list | |
| vertical: 'lodging' | 'groups' | 'spaces' | 'cars'; | |
| }; | |
| // Engagement Metrics (GTM-inspired) | |
| engagement?: { | |
| viewDuration?: number; // ms the element was visible | |
| scrollDepth?: number; // How far user scrolled | |
| interactionType?: 'hover' | 'focus' | 'click' | 'form_submit'; | |
| }; | |
| // Attribution Data | |
| attribution: { | |
| touchpointSequence: number; // 1st, 2nd, 3rd interaction in journey | |
| attributionWindow: '1d' | '7d' | '30d'; | |
| conversionValue?: number; | |
| }; | |
| // Experiment Context | |
| experiments?: { | |
| [experimentName: string]: string; // variant assignments | |
| }; | |
| // Technical Context | |
| technical: { | |
| packageVersion: string; | |
| browser: string; | |
| deviceType: 'desktop' | 'mobile' | 'tablet'; | |
| viewportSize: { width: number; height: number }; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment