We are designing a task success instrumentation schema that captures:
- Intent (what the user intended to do)
- Completion reasons (why the task was completed, either successfully or not)
- Friction signals (any obstacles or difficulties encountered)
We'll design a schema that can be used to instrument a system (like an app or website) to track task success and related metrics.
Let's break down:
1. Intent
We need to capture the user's intent. This could be predefined (from a list) or free text. Since we are instrumenting, it's better to have structured data. So we can have:
- intent_id: a unique identifier for the intent (e.g., from a predefined list of intents)
- intent_name: human-readable name
- intent_category: optional, to group intents (e.g., "navigation", "transaction", "information")
But note: the intent might be derived from user actions (like clicking a button) or from explicit user input (like a search query). We can capture:
- source: where the intent came from (e.g., "button_click", "search_query", "voice_command")
- value: the actual intent (could be an ID or a string)
Alternatively, we can have a separate event for intent capture and then link to a task event.
2. Completion Reasons
When a task is completed (or abandoned), we want to know why. This could be:
- success: boolean (true if completed successfully)
- completion_reason: a string or code indicating the reason (e.g., "completed", "cancelled", "timeout", "error", "user_abandoned")
- We might also want to capture the method of completion (e.g., "form_submit", "button_click", "auto_complete")
3. Friction Signals
These are events that indicate the user had difficulty. Examples:
- multiple_clicks: user clicked the same button multiple times in a short period
- backtracking: user went back in the flow
- long_pause: user took a long time at a step
- error_message_shown: an error message was displayed
- help_clicked: user clicked on help
- retry: user had to retry an action
We might want to capture these as separate events, or as part of the task completion event.
Proposed Schema
We can have two types of events:
A. Intent Event
This event captures when an intent is identified (at the start of a task).
- event_type: "intent_identified"
- intent_id: string (unique identifier for the intent)
- intent_name: string (human-readable)
- intent_category: string (optional)
- source: string (e.g., "button", "search", "voice")
- timestamp: when the intent was identified
- session_id: to tie events together
- user_id: if available
B. Task Event
This event captures the outcome of a task.
- event_type: "task_completed" (or "task_abandoned"? or we can have a single event with a status)
- intent_id: the intent that started the task (to link to the intent event)
- status: "success", "failure", "abandoned"
- completion_reason: string (e.g., "completed", "cancelled_by_user", "timeout", "error_occurred", "user_navigated_away")
- method: string (how the task was completed, e.g., "submit", "cancel", "auto")
- duration: in milliseconds (from intent to completion)
- timestamp: when the task was completed
- session_id: same as intent event
- user_id: if available
C. Friction Events (optional, but can be separate events that occur during the task)
We can have multiple friction events per task. They would have:
- event_type: "friction_signal"
- friction_type: string (e.g., "multiple_clicks", "backtrack", "long_pause", "error_shown", "help_clicked")
- intent_id: to link to the task (optional, but we can use session_id and then map to the current task)
- timestamp: when the friction occurred
- details: JSON object with additional info (e.g., for multiple_clicks: count of clicks, element_id; for long_pause: duration of pause)
- session_id: to tie to the task
Alternatively, we could bake friction signals into the task event as a list of friction signals that occurred during the task. But that might make the event too heavy and we lose granularity.
Given that friction signals might be many and we want to analyze them individually, it's better to have them as separate events.
Linking
We need to link the intent event, task event, and friction events. We can use:
- session_id: to group all events in a session.
- intent_id: to link the task event to the intent event (if multiple intents in a session, we need to know which task corresponds to which intent). Alternatively, we can have a task_id that is generated at the start of the task and passed along.
Improving Linking
Let's generate a task_id when the intent is identified and then pass that task_id to all subsequent events (task completion and friction events). This way we can have multiple tasks in one session.
So:
Intent Event
- event_type: "intent_identified"
- task_id: unique identifier for this task (generated at start)
- intent_id: ...
- ... (other fields)
Task Event
- event_type: "task_completed"
- task_id: same as in intent event
- status: ...
- ... (other fields)
Friction Event
- event_type: "friction_signal"
- task_id: same as in intent event (if we know which task it belongs to, otherwise we can infer from session and timing)
- friction_type: ...
- ... (other fields)
But note: friction events might occur before we have an intent? Probably not, because friction is during a task. So we can require that a task_id is set when the intent is identified and then used for all events in that task.
Example Flow
- User clicks a "Buy Now" button.
- Intent event: task_id=123, intent_id="purchase", source="button", ...
- During the purchase flow:
- Friction event: task_id=123, friction_type="multiple_clicks", details={element: "buy_button", count: 3}
- Friction event: task_id=123, friction_type="long_pause", details={step: "payment", duration: 30000}
- User completes the purchase.
- Task event: task_id=123, status="success", completion_reason="completed", method="form_submit", duration=120000
Additional Considerations
- We might want to capture the context (page, app screen, etc.) for each event. We can add a
context field (JSON) that includes page URL, screen name, etc.
- We might want to capture the user's actions (like form fields filled) but that might be too detailed. We can leave that for other events.
Summary of Event Schemas
Intent Event
{
"event_type": "intent_identified",
"task_id": "string",
"intent_id": "string",
"intent_name": "string",
"intent_category": "string (optional)",
"source": "string",
"timestamp": "ISO 8601",
"session_id": "string",
"user_id": "string (optional)",
"context": { ... } // optional, e.g., { "page": "/products/123", "app_screen": "product_detail" }
}
Task Event
{
"event_type": "task_completed",
"task_id": "string",
"intent_id": "string", // duplicate for easy querying, but we have task_id to link
"status": "success | failure | abandoned",
"completion_reason": "string (e.g., 'completed', 'cancelled_by_user', 'timeout', 'error_occurred')",
"method": "string (e.g., 'submit', 'cancel', 'auto')",
"duration": "integer (milliseconds)",
"timestamp": "ISO 8601",
"session_id": "string",
"user_id": "string (optional)",
"context": { ... }
}
Friction Event
{
"event_type": "friction_signal",
"task_id": "string",
"friction_type": "string (e.g., 'multiple_clicks', 'backtrack', 'long_pause', 'error_shown', 'help_clicked')",
"timestamp": "ISO 8601",
"session_id": "string",
"user_id": "string (optional)",
"details": { ... } // object with type-specific details
}
Implementation Notes
- The
task_id should be generated when the intent is identified and stored in the client (e.g., in memory or local storage) for the duration of the task, and then sent with every event related to that task.
- If a task spans multiple pages/screens, we must ensure the task_id is passed along (e.g., in URL parameters, or via a shared state in a single-page app).
- The
intent_id in the task event is redundant but useful for analysis without joining events. We can choose to keep it or not.
Extensibility
- We might want to add more fields to friction details. For example, for
error_shown, we might want the error code or message.
- We can define a standard set of friction types and their expected details.
Example of Friction Details
- multiple_clicks: { "element_id": "button_buy", "click_count": 3, "time_span_ms": 2000 }
- backtrack: { "from_step": "payment", "to_step": "shipping" }
- long_pause: { "step": "payment", "duration_ms": 30000 }
- error_shown: { "error_code": "PAYMENT_FAILED", "error_message": "Card declined" }
- help_clicked: { "help_topic": "payment_help" }
Conclusion
This schema provides a way to track task success with intent, completion reasons, and friction signals. It is designed to be flexible and extensible.
Let me know if you need any adjustments or have questions.
I'll design a comprehensive task success instrumentation schema that captures intent, completion outcomes, and friction signals for product analytics. This schema balances granularity with practical implementation.
Core Schema Design
1. Task Execution Context (Base Event)
{
"event_id": "uuid_v4",
"event_type": "task_execution",
"timestamp": "2024-01-15T10:30:00Z",
"session_id": "session_123abc",
"user_id": "user_456def",
"device": {
"platform": "web/iOS/Android",
"screen_resolution": "1920x1080",
"locale": "en-US"
},
"app_version": "2.4.1",
"task_id": "task_789ghi",
"task_scope": "single_page/multi_step/cross_session"
}
2. Intent Layer
{
"intent": {
"primary_intent_id": "intent_001",
"primary_intent_name": "complete_purchase",
"intent_category": "transaction/conversion/self_service",
"intent_source": {
"channel": "organic_search/paid_ad/email/internal/search",
"entry_point": "homepage_header/search_results/product_page",
"trigger_element": "cta_button/mega_menu/search_suggestion"
},
"intent_specifics": {
"product_id": "prod_123",
"content_type": "article/video/tool",
"target_value": "$50_discount/2024_tax_form/account_settings"
},
"confidence_score": 0.87,
"capture_method": "explicit_selection/implicit_behavior/predicted"
}
}
3. Completion Outcome Layer
{
"completion": {
"status": "success/failure/abandoned/timeout",
"completion_type": "full/partial/alternative",
"completion_reason": {
"primary": "user_completed/system_completed/error_occurred",
"secondary": "payment_successful/form_submitted/content_consumed",
"tertiary": "auto_approved/manual_review_required"
},
"outcome_quality": {
"success_definition": "transaction_processed/goal_achieved/value_delivered",
"value_delivered": 45.50,
"effort_required": "low/medium/high",
"time_to_complete_sec": 120
},
"completion_path": {
"steps_attempted": 5,
"steps_completed": 5,
"step_completion_rate": 1.0,
"optimal_path_deviation": false
}
}
}
4. Friction Signal Layer (Multi-Level)
{
"friction": {
"signals_detected": [
{
"signal_id": "fric_001",
"signal_type": "technical_behavioral/business/content",
"category": "error/confusion/delay/inefficiency/abandonment_risk",
"severity": "critical/high/medium/low",
"occurrence": {
"step": "payment_validation",
"element": "credit_card_field",
"timestamp": "2024-01-15T10:28:45Z"
},
"signal_metrics": {
"clicks_before_success": 4,
"time_spent_sec": 85,
"backtrack_count": 2,
"field_edits": 3,
"cursor_chaos_score": 0.72
},
"context": {
"error_code": "CARD_DECLINED_05",
"help_accessed": true,
"support_ticket_created": false
}
}
],
"aggregated_friction_score": 0.68,
"friction_hotspots": ["payment_form", "shipping_options"],
"recovery_attempts": 3,
"escalation_path_taken": false
}
}
5. Post-Task Experience Layer
{
"post_task": {
"satisfaction": {
"csat_response": 4,
"nps_response": 9,
"ces_score": 2,
"voluntary_feedback": "Process was smooth but payment took too long"
},
"follow_on_behavior": {
"immediate_next_action": "browse_more/checkout/leave_site",
"repeat_intent_same_session": true,
"support_contact_7d": false
},
"business_impact": {
"conversion_value": 149.99,
"retention_impact_score": 0.82,
"referral_likelihood": 0.34
}
}
}
Implementation Taxonomies
Intent Taxonomy
primary_intents:
- id: "transact_001"
name: "complete_purchase"
category: "transaction"
- id: "inform_001"
name: "find_information"
category: "self_service"
- id: "manage_001"
name: "update_profile"
category: "account_management"
intent_sources:
- direct_navigation
- organic_search
- paid_search
- email_campaign
- internal_referral
Friction Signal Taxonomy
technical_friction:
- slow_load_time
- javascript_error
- api_timeout
- mobile_keyboard_issue
behavioral_friction:
- rapid_clicking
- excessive_scrolling
- form_field_abandonment
- help_article_viewed
business_friction:
- price_objection
- shipping_surprise
- account_creation_required
- out_of_stock
content_friction:
- unclear_instructions
- missing_information
- contradictory_information
Completion Reason Codes
success_codes:
- S1: "task_completed_optimally"
- S2: "task_completed_with_workaround"
- S3: "task_completed_after_help"
failure_codes:
- F1: "technical_error"
- F2: "business_rule_block"
- F3: "insufficient_information"
- F4: "user_confusion"
abandonment_codes:
- A1: "external_interruption"
- A2: "task_too_complex"
- A3: "better_alternative_found"
- A4: "value_not_clear"
Implementation Recommendations
1. Instrumentation Strategy
// Example implementation pattern
const taskTracker = {
startTask(intent) {
const taskId = generateTaskId();
trackEvent('intent_identified', { taskId, ...intent });
return taskId;
},
trackStep(step, metrics) {
trackEvent('step_completed', {
taskId: this.currentTaskId,
step,
...metrics
});
},
trackFriction(signal) {
trackEvent('friction_detected', {
taskId: this.currentTaskId,
...signal
});
},
completeTask(outcome) {
const finalMetrics = this.calculateTaskMetrics();
trackEvent('task_completed', {
taskId: this.currentTaskId,
...outcome,
...finalMetrics
});
}
};
2. Data Collection Points
- Intent Capture: On first meaningful interaction (CTA click, search submit, explicit selection)
- Friction Detection: Real-time (click patterns, timing anomalies, error tracking)
- Completion: On task conclusion (success page, error page, abandonment detection)
- Post-Task: 24h delayed (surveys, behavioral follow-up)
3. Privacy & Compliance
- Anonymize PII before transmission
- Implement data retention policies (90 days raw, aggregated indefinitely)
- Provide opt-out mechanisms
- Comply with GDPR/CCPA:
data_subject_id, consent_token
4. Query Patterns (What to Analyze)
-- Success rate by intent source
SELECT intent_source,
COUNT(*) as attempts,
SUM(CASE WHEN status = 'success' THEN 1 ELSE 0 END) as successes,
AVG(friction_score) as avg_friction
FROM task_events
WHERE date > '2024-01-01'
GROUP BY intent_source;
-- Friction hotspots by page
SELECT context->>'page' as page,
friction_type,
COUNT(*) as occurrences,
AVG(signal_metrics->>'time_spent_sec') as avg_time
FROM friction_events
GROUP BY page, friction_type
ORDER BY occurrences DESC;
Schema Evolution Considerations
- Additive Changes: New signal types/reasons as new columns or enum values
- Backward Compatibility: Maintain old field names with deprecation cycle
- Versioning:
schema_version field in base event
- Migration Path: Hydrate missing fields from logs/derived metrics
Dashboard KPIs Enabled
- Task Success Rate: % of tasks completed successfully
- Friction Index: Normalized score (0-1) per intent category
- Effort Score: Time × Friction coefficient
- Recovery Rate: % of friction events leading to successful completion
- Intent Alignment: % of users whose primary intent matches outcome
This schema provides actionable granularity while maintaining analytical flexibility. The layered approach allows you to:
- Monitor overall health (completion rates)
- Diagnose problems (friction signals)
- Understand user goals (intent layer)
- Measure business impact (value delivered)
Would you like me to elaborate on any specific layer, provide implementation code for a particular platform, or design the data pipeline architecture for processing these events?