Appearance
Streaks
What are Streaks?
A streak represents a sequence of consecutive actions performed by a user within a specific timeframe. Think of it like:
- Daily Login Streak - User logs in every day for 7 consecutive days
- Weekly Exercise Streak - User completes workouts every week for 4 consecutive weeks
- Monthly Purchase Streak - User makes a purchase every month for 3 consecutive months
Streaks are powerful engagement tools that:
- Motivate Users - Create a sense of achievement and progress
- Build Habits - Encourage regular app usage through consistency
- Increase Retention - Users don't want to "break" their streak
- Gamify Experience - Add competitive and achievement elements
How Streaks Work
Streak Mechanics
- Action Trigger - User performs a specific activity (login, purchase, etc.)
- Frequency Check - System verifies if action meets the required frequency
- Continuity Validation - Confirms the action maintains the consecutive pattern
- Streak Update - Increments the streak count or resets if pattern is broken
Example Scenario
Day 1: User logs in → Streak starts (Day 1)
Day 2: User logs in → Streak continues (Day 2)
Day 3: User logs in → Streak continues (Day 3)
Day 4: User doesn't log in → Streak breaks (resets to 0)
Day 5: User logs in → New streak starts (Day 1)
Streak Parameters
Streaks are tracked using 3 key metrics:
1. Current Streak Length
- Definition: The ongoing active streak count
- Example: User has logged in for 5 consecutive days (Current = 5)
2. Recent Streak Length
- Definition: The most recent completed streak before the current one
- Example: User had a 10-day streak that ended yesterday (Recent = 10)
- Purpose: Shows past achievement even if current streak is broken
3. Max Streak Length (Longest Streak)
- Definition: The highest streak count ever achieved by the user
- Example: User's best performance was a 30-day streak (Max = 30)
- Purpose: Personal record and long-term achievement tracking
Streak Types by Frequency
1. Everytime Action Performed
- Requirement: Streak increments on every successful action, regardless of time duration between actions
- Use Cases: Consecutive correct answers, successful task completions, perfect game rounds
javascript
// Example: Consecutive quiz answers streak
{
"streakFrequency": "everytime",
"displayName": "Perfect Quiz Streak",
"currentStreak": { "length": 25 }, // 25 consecutive correct answers
"desc": "Answer questions correctly to build your streak"
}
// Example: Perfect game rounds streak
{
"streakFrequency": "everytime",
"displayName": "Flawless Victory Streak",
"currentStreak": { "length": 12 }, // 12 consecutive perfect rounds
"desc": "Complete rounds without mistakes to maintain streak"
}
Key Characteristics:
- ✅ Action-Based: Increments only when action is performed
- ✅ Time-Independent: No daily/weekly/monthly requirements
2. Daily Streaks (onceaday
)
- Requirement: Action must be performed every day
- Use Cases: Daily login, daily check-in, daily workout
- Reset Window: Typically 24-48 hours (with grace period)
javascript
// Example: Daily login streak
{
"streakFrequency": "onceaday",
"displayName": "Daily Login Streak",
"currentStreak": { "length": 7 } // 7 consecutive days
}
3. Weekly Streaks (onceaweek
)
- Requirement: Action must be performed every week
- Use Cases: Weekly goal completion, weekly purchases, weekly challenges
- Reset Window: 7-10 days (with grace period)
javascript
// Example: Weekly workout streak
{
"streakFrequency": "onceaweek",
"displayName": "Weekly Fitness Streak",
"currentStreak": { "length": 12 } // 12 consecutive weeks
}
4. Monthly Streaks (onceamonth
)
- Requirement: Action must be performed every month
- Use Cases: Monthly subscription, monthly activity, monthly goals
- Reset Window: 30-35 days (with grace period)
javascript
// Example: Monthly subscription streak
{
"streakFrequency": "onceamonth",
"displayName": "Monthly Subscriber",
"currentStreak": { "length": 6 } // 6 consecutive months
}
5. Yearly Streaks (onceayear
)
- Requirement: Action must be performed every year
- Use Cases: Annual renewals, yearly events, anniversary activities
- Reset Window: 365-400 days (with grace period)
javascript
// Example: Annual membership renewal streak
{
"streakFrequency": "onceayear",
"displayName": "Loyal Member Streak",
"currentStreak": { "length": 3 } // 3 consecutive years
}
How to Fetch Streaks Data
Request user streaks information:
objective-c
// Fetch streaks data
[[BrandKinesis sharedInstance] getStreaksDataWithCompletionBlock:^(NSDictionary * _Nullable response, NSString * _Nullable errorMessage) {
}];
swift
// Fetch streaks data
BrandKinesis.sharedInstance().getStreaksData() { (response, error) in
}
Sample Response
The streaks data response contains detailed information about user streaks:
json
{
"streakData": [
{
"streakType": "length",
"displayName": "Production Streak",
"tags": ["tag"],
"streakId": "646bd7f287a53c85028b4000",
"timeZone": "usertimezone",
"name": "Production Streak",
"desc": "The Streak collection for production",
"streakFrequency": "onceaday",
"logo": "https://media.goupshot.com/bk-purpletalk/5d4d3f3f4ce8f387208b4585/si/56af50e0eaea3.jpg",
"recentStreak": {
"startDate": 1685973327,
"length": 1,
"endDate": 1685973327
},
"longestStreak": {
"startDate": 1685973327,
"length": 1,
"endDate": 1685973327
},
"currentStreak": {
"startDate": 1685973327,
"length": 1,
"endDate": 1685973327
}
}
]
}
Streak Properties
Basic Information
- streakId - Unique identifier for the streak
- displayName - User-friendly name for display
- name - Internal streak name
- desc - Description of the streak
- tags - Associated tags for the streak
- logo - Image URL for the streak icon
Streak Configuration
- streakType - Type of streak (e.g., "length")
- streakFrequency - How often the streak can be updated (e.g., "onceaday")
- timeZone - User's timezone for streak calculations
Streak Metrics
- currentStreak - The ongoing active streak
- recentStreak - The most recently completed streak
- longestStreak - The longest streak ever achieved
Each streak period contains:
- startDate - Timestamp when the streak began
- endDate - Timestamp when the streak ended (or current for active streaks)
- length - Number of consecutive periods achieved