Advanced
Log Only What Is Allowed
Each click on #fire sends the next event to your track(props) function and prints what you decided to keep on a new line of #logged as JSON. ALLOWED lists the keys and the values each may have.
Write track so it keeps only allowed keys with allowed values. For the first event the line must be {"outcome":"answered","ttft":"fast"}. For the second it must be {"outcome":"failed"}: a raw number like 812 is not an allowed ttft value.
What Check tests
- The first event keeps only
outcomeandttft - The second event drops the raw
812 - Nothing the user typed or their email appears in the log
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.