For the complete documentation index, see llms.txt. This page is also available as Markdown.

Challenges & Missions

Building missions, milestones and streaks with challenges, showing members their progress, and the limits to design around.

A challenge is a goal made of milestones — "scan 3 different products", "buy 5 times this month", "check in every day this week". Progress comes from the transactions and custom events your integration already sends; milestone rules pay points, badges or spins along the way. Members usually see challenges as missions.

For the Admin Panel side, see Creating challenges and Managing challenges. Events that feed challenges are covered in Transactions and Custom events.

Who does what

Area
Responsibility

Admin Panel

Challenges with milestones, rules, activity dates, completion limits and display attributes (images, per-day rewards)

Integration layer

Sends the events that count — usually nothing extra; reads challenge lists and progress for the channels

Website / app

Mission cards (locked, in progress, completed), progress bars, check-in buttons

CRM / marketing automation

Progress and completion messages from webhooks

Design decisions

Decision
Options
Recommendation

What counts

Number of events, or unique values of an attribute (product, flavour, colour)

Unique attributes for collection mechanics ("3 different flavours"); event counts for frequency ("5 purchases"). Make sure the attribute is in the event.

Period

Overall, or reset weekly / monthly

Use resetting periods for recurring missions instead of creating a new challenge each week. Decide before launch — see the warning below.

Rewards

On completion only, or per milestone step

A challenge has at most 6 milestones, and a campaign at most 6 rules. Group steps that pay the same into one rule.

Daily streaks

A streak milestone, or a counting milestone with one event per day

Counting milestone — see Daily check-in streak.

Display content

Hard-coded, or on the challenge

Store images, per-step rewards and texts as challenge custom attributes, so the front end needs no release for a new mission.

Public missions

Only for members, or also logged-out visitors

Label public missions (e.g. public = true) and list them with the campaigns list to invite visitors to join.

1

Design the mechanics

For each mission: what counts, the goal, the period, what each step pays, how often the whole challenge can be completed, and the activity dates. Check it fits in 6 milestones and 6 rules.

2

Make sure the events carry the attributes

A milestone that counts unique flavours needs the flavour in every event. Add missing attributes to the custom event schema and the integration before configuring the challenge.

3

Configure and test

Build the challenge on staging with display attributes, then drive it with test events: partial progress, completion, the completion limit, and the period reset.

4

Show missions and progress

List the member's challenges with GET /api/{storeCode}/member/{member}/campaign?trigger=challenge (active challenges, display attributes, limitReached) and progress with GET /api/{storeCode}/member/{member}/challenge (per milestone currentPeriodValue, periodGoal, completedCount). For completed missions, use member history types ChallengeCompleted and BadgeCompleted.

5

Correct or migrate progress

To carry over progress from a previous programme, or fix it for a member, use PATCH /api/{storeCode}/member/{member}/challenge/{challenge}/progress.

Sequence diagrams

A member opens the missions page. When logged in, the integration layer reads in parallel the member's active challenges with display labels and limitReached, the progress per milestone, and the member's badges, and returns mission cards as locked, in progress or completed. When logged out, it reads the public mission list by label and shows cards with a join prompt. Progress itself comes from events the member already sends.
Missions page

Daily check-in streak

A "check in every day" mission is tempting to build on a streak milestone. In testing, rules on a streak milestone don't fire on the intermediate days — only on completion, so daily rewards aren't paid. Build it like this instead:

Setting
Value

Milestone

Custom event daily_check_in, counting occurrences, goal Weekly, at least N times, event frequency limit 1 per day (counted in the tenant's timezone)

Rules

Milestone progression = k → add the day's reward; consecutive days with the same reward share one rule (between)

Completion limit

1 per calendar week

Activity window

Starts on a Monday, so the week and the streak line up

Display

Custom attributes day1 … dayN with each day's reward

The "missed a day" check is done by the front end against the calendar: with n = days done this week and dayIndex = today's day of the week (Monday = 1), the streak is lost when n < dayIndex − 1.

The integration layer reads the member's challenge progress n and computes dayIndex as the day of the week. If the limit is reached, the mission shows as completed this week; if n is less than dayIndex minus 1, the streak is lost and the mission is hidden until next week; if n equals dayIndex, today is done; if n equals dayIndex minus 1, the check-in button shows today's reward. A check-in sends a daily_check_in custom event with the customer ID and date as eventId; the counting milestone moves on by one, the rule for that day pays the reward, and the last day completes the challenge.
Daily check-in streak

Go-live checklist

Admin Panel

Integration layer

Website / app

Validation

Key endpoints

Webhooks: MemberChallengeProgressWasChanged, ChallengesWereProcessed, CampaignEffectWasApplied

Last updated

Was this helpful?