Event Collection Methodology
Overview
This document outlines Topsort’s methodology for collecting, validating, and processing advertising events in compliance with IAB/MRC Retail Media Measurement Guidelines. All event data flows through standardized collection pipelines with built-in quality controls and validation.
Event Types Collected
Topsort collects four primary event types:
- Impressions - User viewed an ad asset (listing or banner)
- Clicks - User clicked on an ad asset
- Purchases - User completed a transaction
- Page Views - User visited a page (for context and analytics)
All events require either a resolvedBidId (for sponsored events from auction responses) or an entity descriptor (for organic events).
Collection Methods
API-Based Event Reporting
Primary collection method using the /events endpoint:
{ "impressions": [{ "id": "event_uuid", "resolvedBidId": "auction_response_token", "placement": { "path": "/category/shoes", "location": "top_banner" }, "occurredAt": "2024-12-01T10:30:00.000Z", "opaqueUserId": "user_hash_value" }], "clicks": [{ "id": "event_uuid", "resolvedBidId": "auction_response_token", "placement": { "path": "/product/12345" }, "occurredAt": "2024-12-01T10:31:15.000Z", "opaqueUserId": "user_hash_value" }], "purchases": [{ "id": "event_uuid", "occurredAt": "2024-12-01T10:45:00.000Z", "opaqueUserId": "user_hash_value", "items": [{ "productId": "sku_12345", "unitPrice": 49.99, "quantity": 1 }] }]}Data Capture Requirements
Each event type captures specific required and optional fields:
Impressions:
- Required:
resolvedBidIdorentity,occurredAt,opaqueUserId - Optional:
placement,viewabilitydata,deviceinfo
Clicks:
- Required:
resolvedBidIdorentity,occurredAt,opaqueUserId - Optional:
placement,additionalAttribution
Purchases:
- Required:
occurredAt,opaqueUserId,itemsarray - Optional:
resolvedBidId(for direct attribution),orderId
Data Flow Pipeline
-
Event Submission
- Client submits event via POST to
/eventsendpoint - Request authenticated with API key
- Timestamp recorded at server ingestion
- Client submits event via POST to
-
Schema Validation
- JSON structure validated against event schema
- Required fields presence verified
- Data types and formats checked
-
Real-time Quality Checks
- SIVT detection algorithms applied
- Duplicate detection (by event ID)
- Timestamp validation (within acceptable window)
-
Enrichment
- Auction data joined via
resolvedBidId - Campaign and vendor metadata attached
- Geographic and device data normalized
- Auction data joined via
-
Storage
- Raw events stored in event log (90 days retention)
- Validated events written to attribution database
- Aggregated metrics updated in reporting datastore
-
Processing
- Attribution calculations executed
- Metrics aggregated by campaign/product/vendor
- Reports updated for dashboard access
Validation and Quality Controls
Timestamp Validation
Events are validated for temporal consistency:
- Future events: Rejected if
occurredAtis more than 5 minutes in future - Past events: Accepted up to 7 days in past for late-arriving data
- Clock skew: Server timestamp compared to client timestamp with tolerance
- Out-of-order: Events processed with consideration for delivery order vs occurrence order
Duplicate Detection
Prevention of duplicate event counting:
// Event deduplication by UUID{ "id": "550e8400-e29b-41d4-a716-446655440000", // Client-generated UUID "resolvedBidId": "...", "occurredAt": "2024-12-01T10:30:00.000Z"}- Event IDs must be unique UUIDs
- Duplicate IDs within 24-hour window rejected
- Idempotent processing ensures same event not counted twice
Attribution Token Validation
All sponsored events validated against auction records:
resolvedBidIddecoded and verified against auction database- Auction expiration checked (typically 24-hour validity)
- Campaign status verified (active at time of event)
- Bid amount and auction parameters retrieved for billing
Data Sources and Identity
User Identity
User identification via:
- opaqueUserId: Hashed user identifier provided by marketplace
- No PII: Topsort never receives raw personal information
- Consistent hashing: Marketplace must use stable hashing algorithm
- Cross-session: Same user must receive same hash across sessions
First-Party Data
All event data is first-party:
- Reported directly by marketplace via API
- No third-party pixels or tags
- No data brokers or panel extrapolation
- Direct measurement only
Event Attribution Logic
Attribution Windows
Default windows applied unless customized:
- Click attribution: 14 days
- View attribution: 1 day
- Multi-touch: Last click wins (configurable to last impression)
Conversion Matching
Purchase events matched to ad exposures:
IF purchase.opaqueUserId == click.opaqueUserIdAND purchase.occurredAt - click.occurredAt <= attribution_windowAND purchase.items contains product from campaignTHEN attribute conversion to campaignMultiple touchpoints handled via configured attribution model (last-click, last-impression, or position-based).
Privacy and Compliance
Data Handling
- Pseudonymization: All user IDs are hashed before transmission
- No tracking: Topsort does not place cookies or trackers on end-user devices
- Marketplace control: Marketplace owns all user data and identity
- Data minimization: Only required fields collected
Retention Policies
| Data Type | Retention Period | Purpose |
|---|---|---|
| Raw event logs | 90 days | Debugging and SIVT analysis |
| Aggregated metrics | 24 months | Reporting and analytics |
| Campaign data | 24 months | Historical performance |
| SIVT detection logs | 180 days | Audit and appeals |
Compliance Standards
Event collection meets:
- GDPR - Lawful basis via marketplace’s data processing agreement
- CCPA - No sale of personal information
- IAB/MRC - Transparent methodology disclosure
- SOC 2 Type II - Security and availability controls
Error Handling
Event Rejection
Events may be rejected for:
- Schema validation failures
- Invalid authentication
- Expired
resolvedBidId - Future timestamp beyond tolerance
- SIVT detection
Rejected events return HTTP 4xx with detailed error message.
Partial Success
Batch submissions processed atomically per event type:
- Valid events accepted
- Invalid events rejected with specific errors
- Response indicates success/failure per event
{ "impressions": { "accepted": 98, "rejected": 2, "errors": [ { "id": "event_123", "reason": "Invalid resolvedBidId" } ] }}Audit and Verification
Access to Event Logs
Marketplaces can request:
- Sample of raw event logs for specific campaigns
- Event-level detail for specific user journeys
- Attribution calculation breakdowns
- SIVT filtration decisions
Third-Party Verification
For MRC accreditation:
- Independent auditors have access to event collection code
- Sample event logs provided for verification
- Validation logic auditable
- Audit trail maintained for all changes
Technical Specifications
API Endpoint
POST https://api.topsort.com/v2/eventsContent-Type: application/jsonAuthorization: Bearer {marketplace_api_key}Rate Limits
- 1,000 requests per second per marketplace
- 10,000 events per batch request
- Automatic retry with exponential backoff recommended
Latency Targets
- p50: < 50ms response time
- p95: < 200ms response time
- p99: < 500ms response time
Best Practices for Marketplaces
Implementation
-
Generate Unique Event IDs
- Use UUID v4 for all events
- Never reuse event IDs
- Client-side generation recommended
-
Batch Event Submission
- Collect events client-side
- Submit in batches every 5-30 seconds
- Include multiple event types in single request
-
Handle Errors Gracefully
- Implement retry logic for failed submissions
- Log rejected events for debugging
- Monitor submission success rates
-
Timestamp Accuracy
- Use ISO 8601 format with timezone
- Capture client-side occurrence time
- Account for network latency in analysis
Monitoring
Track these metrics:
- Event submission success rate
- Event acceptance rate (post-validation)
- Average submission latency
- SIVT filtration rate
Frequently Asked Questions
-
How quickly must events be reported?
- Events should be reported within minutes of occurrence. Late-arriving events accepted up to 7 days for attribution purposes.
-
What happens to events during API downtime?
- Implement client-side queuing and retry logic. Events can be submitted retroactively once service restored.
-
Can events be edited or deleted after submission?
- No. Events are immutable once accepted. Submit correction events if needed.
-
How are viewability standards applied to impression events?
- Marketplaces should only report impressions meeting IAB viewability criteria (50% pixels, 1+ second). Topsort assumes reported impressions are viewable.
-
What user identifier should be used?
- Use a stable, pseudonymous hash of user ID. Must be consistent across sessions for same user. Do not send PII.