Flag Analytics in Flagsmith
A complete, plain-English guide to seeing how your feature flags are actually used: what an evaluation is, how counts travel from your apps to the dashboard, how to read the charts, where the numbers can mislead you, and how to use them to roll out safely, find dead flags and connect flags to product analytics.
Imagine you own a shop with a hundred light switches on a panel in the back room. Over the years, staff have added switches for sales, signs, heaters and fans. One day you ask a simple question: which of these switches does anybody still use? Nobody knows. Some may be wired to nothing. Some may be flipped a thousand times a day. Without a counter on each switch, you can only guess, and guessing is how people switch off the wrong thing on a busy afternoon.
Feature flags have exactly this problem. A feature flag is a switch, stored outside your code, that decides whether some behaviour is active. Teams create flags easily and forget them just as easily. Flag analytics is the counter beside each switch. It tells you how often each flag is asked about, in which environment and when, so you can answer questions such as “is this flag still used?”, “did traffic really reach the new code path?” and “how big is our flag footprint?”.
This guide starts from the first idea and builds step by step. You will learn what an evaluation is, how the counts are collected and sent, how to read the Analytics view, why the numbers are close to the truth but never exactly the truth, how to use them for rollouts, clean-up, capacity planning and experiments, and how to connect Flagsmith to your wider analytics tools. No prior knowledge is assumed and no code is needed. Features, menu labels and plan limits change between Flagsmith versions, and some analytics options depend on plan or SDK, so treat the screens described here as signposts and confirm details in your own dashboard and the official documentation.
1Why Measure Flags at All?
A flag you cannot measure is a switch in the dark. You do not know if it works, if it matters, or if it is safe to remove.
Flags are easy to make and hard to forget
Creating a flag takes a minute. Removing one takes a conversation, a code change, a deployment and some courage. So flags pile up. Teams that ship quickly often end up with hundreds, many of them finished long ago. Each leftover flag is a small risk: it adds a branch to the code, a name to the dashboard and a chance that someone switches it by mistake.
Four questions analytics can answer
Is it used?
Does any application still ask about this flag, or is it dead weight?
Is it reached?
After a rollout, did the new code path actually receive traffic?
How much?
How many evaluations per day, and how does that grow with your product?
What happened?
Did a change coincide with a jump or drop in usage?
The cost of not knowing
Without measurement, teams make two opposite mistakes. They keep flags for ever “just in case”, because nobody can prove they are unused. Or they remove a flag that looked unused and break a rarely visited feature, such as a yearly report. Both mistakes are cheap to avoid with a few weeks of evidence.
A building manager who reads the electricity meter can see that the east wing uses nothing at night and the lift uses a great deal at nine in the morning. Without the meter, they can only guess. Flag analytics is the meter for your switches.
Real-world example: clean-up of stale toggles
Engineering teams at many software companies have written publicly about the burden of old feature toggles, and about adding usage tracking so they can retire toggles that no longer fire. The common theme is that deletion is only safe when you have evidence of silence.
Before creating a flag, ask when it will be removed. Before removing it, ask what the evidence says. Analytics supplies the second answer.
2The Vocabulary: Twelve Words You Need
A small set of terms explains the whole subject. Learn them once and every later chapter reads easily.
Feature flag
A named switch, with an optional value, whose state lives in Flagsmith instead of your code.
Evaluation
One moment when your application asks “what is the state of this flag?” and gets an answer.
SDK
A software development kit: the small library your application uses to talk to Flagsmith.
Environment
A separate copy of flag states, such as Development, Staging or Production. Counts are kept per environment.
Identity
Flagsmith’s record of one end user of your product, used for targeting.
Batch
A group of counts sent together after a short wait, instead of one message per evaluation.
Time bucket
A fixed span of time, such as an hour or a day, into which counts are added for a chart.
API usage
The number of requests your apps make to Flagsmith, which is different from the number of evaluations.
Cache
A stored recent answer, so the SDK does not ask again. Caches change what is counted.
Integration
A connection that sends flag information to another tool, such as an analytics or monitoring service.
Experiment
A planned comparison of two or more versions of a feature to learn which works better.
Stale flag
A flag that is no longer needed, because its decision has been made or its code removed.
flowchart LR
A["Your application asks about a flag"] --> E["Evaluation happens"]
E --> C["SDK counts it"]
C --> B["Counts are batched"]
B --> F["Sent to Flagsmith"]
F --> D["Dashboard shows charts"]
Read the figure from the left. Your application asks about a flag, and that question is an evaluation. If analytics is enabled, the SDK adds one to a local counter for that flag. After a short wait, the SDK sends the batch of counters to Flagsmith, which stores them by flag, environment and time. The dashboard then draws charts from the stored counts. The key lesson is that the chart is a summary of messages sent by your apps, so it can only be as complete as those messages.
A bus conductor tallies passengers on paper during the route, then hands the tally sheet to the depot at the end of the trip. The depot builds its charts from the sheets. If a conductor forgets to hand in a sheet, the chart is lower than reality. SDK batches are the tally sheets.
Names and menus vary between versions. The ideas above are stable even when labels change.
3What Flag Analytics Is, and What It Is Not
Several kinds of measurement sit near feature flags. Knowing which one you are looking at prevents wrong conclusions.
The core idea
Flag analytics answers one narrow question: how often was each flag evaluated, where and when? It describes the use of the flags themselves. It does not directly tell you whether customers liked a feature, whether sales rose or whether the site was fast. Those are different questions, answered by different tools.
Four neighbouring tools
| Kind of measurement | Question it answers | Typical tool | Relation to flags |
|---|---|---|---|
| Flag analytics | How often is each flag asked about? | Flagsmith dashboard | The subject itself |
| Product analytics | What do users do, and does it differ by feature? | Amplitude, Mixpanel, Segment-like tools | Needs flag state attached to events |
| Observability | Is the system healthy, fast and error-free? | Datadog, Grafana, New Relic-like tools | Needs flag changes marked on charts |
| Experimentation | Which version wins, with statistical confidence? | Dedicated experiment tools | Uses flags to split users |
What flag analytics cannot tell you
- It does not tell you if a feature is liked. A flag can be evaluated a million times for a feature nobody wants.
- It does not prove a flag is correct. It counts questions, not whether the answers were right.
- It does not usually list each user who received each value. It is mainly a count, not a per-person record.
- It is not an audit log. It records usage, not who changed what.
A restaurant can count how many times the kitchen door opens. That tells you the kitchen is busy. It does not tell you if the food was good, whether customers came back or whether the chef is happy. For those you need reviews, repeat bookings and a chat with the chef. The door counter is useful, and it is only one instrument.
Do not read evaluation counts as “number of users”. One user can cause hundreds of evaluations in a session. A high count may mean many users, or one busy page that asks often.
4What Exactly Is an Evaluation?
Everything in analytics is built on one small event. Understanding it removes most confusion about the numbers.
The moment of asking
Somewhere in your code is a line that says, in effect, “is the new checkout enabled for this user?”. That line asks the SDK for a flag. The SDK looks up the state, from a stored copy or from Flagsmith, and returns the answer. That whole step is one evaluation. If the code asks ten times on one page, there are ten evaluations, unless the code is written to ask once and remember.
Evaluation is not a request
Two numbers are often mixed up. An API request is a network call from your application to Flagsmith, such as “give me all flags for this user”. An evaluation is a single question about one flag, usually answered from data the SDK already holds. One request can supply the data for hundreds of evaluations. So evaluation counts are normally far higher than request counts, and the two charts measure different things.
| Measure | What it counts | Typical size | Used for |
|---|---|---|---|
| Evaluations | Questions about a flag in your code | Very high | Flag usage, clean-up, rollouts |
| API requests | Network calls to Flagsmith | Lower | Plan limits, capacity, cost |
| Identities | Distinct end users known to Flagsmith | Varies | Targeting, privacy review |
Why this matters
If a flag shows zero evaluations, that is strong evidence that no running code asks about it, but only if analytics was enabled in all the places that could ask. If a flag shows ten thousand evaluations an hour, that is evidence of heavy use in code, not of ten thousand customers. Every interpretation must keep the definition in mind.
A librarian fetches a whole box of books for a student once (the request). The student then looks at those books a hundred times during the afternoon (the evaluations). Counting how often the librarian walked to the shelf tells you about the librarian’s workload. Counting how often the student opened a book tells you about reading.
Whenever you see a number on a chart, say its unit aloud: “evaluations per hour”, “requests per day”. If you cannot, you are not ready to draw a conclusion from it.
5How Evaluation Data Travels
Between the question in your code and the bar on the chart lie several small steps. Each one can add delay or lose a little data.
The five steps
The app asks
Code checks a flag through the SDK.
The SDK counts
If analytics is on, it adds one to a local tally for that flag.
The tally waits
Counts collect for a short interval so one message can carry many.
The batch is sent
The SDK posts the tallies to Flagsmith, using the environment key.
Flagsmith stores and charts
Counts are added to time buckets and appear in the dashboard, after processing delay.
sequenceDiagram
participant App as Your application
participant SDK as Flagsmith SDK
participant FS as Flagsmith service
participant UI as Dashboard
App->>SDK: Is flag X enabled?
SDK-->>App: Yes or no
SDK->>SDK: Add one to the tally for X
Note over SDK: Wait for the batch interval
SDK->>FS: Send the batch of tallies
FS->>FS: Add to time buckets
UI->>FS: Request chart data
FS-->>UI: Counts by time
Where delay and loss come from
- Batch wait. Counts sit in memory for a short period before being sent, so the chart lags a little behind real time.
- Processing. Flagsmith may add counts to storage in the background, so there is a further short lag.
- Sudden shutdown. If an application stops before sending its latest batch, those last counts can be lost.
- Network failure. A failed send may drop or retry the batch, depending on the SDK.
A parcel service collects letters in a van, drives to the sorting office every hour, and the sorting office updates its tracking page. A letter posted at ten past will appear on the tracking page perhaps an hour later. If the van breaks down, a few letters are late or missing. Counts follow a similar delivery route.
The exact batch interval and retry behaviour depend on the SDK and its version. Check your SDK’s documentation if the precision of the latest few minutes matters.
6Switching Analytics On in Your Applications
Flag analytics does not appear by magic. Each application, through its SDK, must be told to collect and send counts.
It is an SDK setting
Most Flagsmith SDKs have an option, commonly named something like “enable analytics”, set when the SDK is created. When it is off, the SDK does not count. When it is on, it keeps tallies and sends them. Because it is a per-application setting, you may find that some of your services report and others do not. The chart will then show only what the reporting ones saw.
A rollout checklist
| Step | Why |
|---|---|
| List every application that uses Flagsmith | You cannot judge silence unless you know who might speak |
| Enable analytics in each SDK configuration | Each service reports only if told to |
| Deploy to a test environment first | Check counts appear before touching Production |
| Confirm in the dashboard that counts arrive | An enabled setting is not proof of data |
| Roll to Production gradually | Watch for any performance side effect |
| Record which services report | So future readers know the coverage |
Coverage is the heart of trust
The statement “this flag has zero evaluations” means nothing until you know every place that could evaluate it reports data. Old mobile app versions, batch jobs that run monthly, partner integrations and rarely used admin tools are the usual silent corners. A flag can look dead when one forgotten script quietly depends on it.
A shop counts visitors with door sensors, but the staff entrance and the loading bay have none. The count says “no one used the loading bay”, which is false. The count is only trusted once you know every door has a sensor.
Old mobile app versions can stay in customers’ pockets for years. If they were released before analytics was enabled, they will never report. Treat mobile coverage as partial for a long time.
7Reading the Analytics View in the Dashboard
The dashboard presents flag usage as simple charts. Learn what each part shows and what it hides.
Where to look
Open a project, choose an environment and open a flag. In versions that include flag analytics, an Analytics area, tab or panel for that flag shows evaluation counts over time. There is also usage reporting at the organisation level, covering API traffic for the whole account. Menu names differ between versions, so look for words such as Analytics, Usage or Evaluations.
The chart in plain words
The horizontal axis is time. The vertical axis is a count. Each bar or point is the number of evaluations that arrived in that slice of time. A flat line at zero means nothing reported. A steady line means steady use. A sudden step up means a release, a campaign or a new service began asking. A sudden drop to zero means something stopped: a deployment, an outage or a change that bypassed the flag.
Flat at zero
No reports. Either unused, or no reporting application is asking.
Daily wave
Rises in the day and falls at night. Normal for products with human traffic.
Step up
A new release or audience began evaluating the flag.
Sudden drop
Code stopped asking, or reporting broke. Investigate both.
Spiky
Batch jobs, retries or bursty traffic. Compare with the system’s own pattern.
Weekly rhythm
Quiet weekends, busy weekdays. Typical for business tools.
A heart-rate trace is read by shape. A steady rhythm is reassuring, a flat line is alarming, and a sudden spike deserves a question. Nobody reads a single number in isolation. Flag charts are read the same way.
Open the chart of a flag you know well first. Seeing how a familiar flag looks makes unfamiliar ones easier to read.
8Time Ranges, Buckets and Aggregation
The same data looks very different at different zoom levels. Choose the range for the question you are asking.
Time ranges
Dashboards usually offer a few ranges, such as the last day, the last week or the last month. Available choices and retention depend on your plan and version. The short range suits “did the rollout just work?”. The long range suits “is anything still using this flag?”.
Buckets
A bucket is a slice of time, say one hour or one day, into which counts are added. In a day-by-day chart, each bar is a day’s total. Larger buckets smooth out noise but hide short events. Smaller buckets reveal bursts but look jagged.
| Question | Best range | Why |
|---|---|---|
| Did my rollout take effect just now? | Last day, fine buckets | You need minutes and hours |
| Is this flag in regular use? | Last month | Weekly rhythms and rare jobs show up |
| Is this flag safe to delete? | Longest range available, plus checking rare jobs | Monthly or yearly tasks hide in short windows |
| Did traffic change after a release? | A week, around the release time | Compare before and after |
Time zones
Charts may group by days in UTC, the neutral world clock, or in your browser’s local zone, depending on version. A “day” boundary can therefore fall in the middle of your afternoon. When comparing with other tools, make sure both use the same zone.
flowchart TD
Q["What do I want to know?"] --> A["Right now: short range"]
Q --> B["Regular use: month range"]
Q --> C["Safe to delete: longest range plus rare-job check"]
A --> D["Fine buckets show minutes"]
B --> E["Daily buckets show rhythm"]
C --> F["Look for monthly and yearly spikes"]
A weather report can show the next hour, the next week or the whole season. If you are deciding whether to carry an umbrella now, the season is useless. If you are planning a farm, the next hour is useless. Charts have the same trade-off.
9Evaluations, Users and Requests: Three Easy Confusions
Most wrong conclusions from flag charts come from mixing up what is being counted. Here are the three classic traps.
Trap 1: “ten thousand evaluations means ten thousand users”
One user can trigger many evaluations. A page that checks a flag each time a component draws will produce hundreds from a single visit. Conversely, a flag checked once per session produces one. So the same number of users can give wildly different evaluation counts depending on how the code was written.
Trap 2: “evaluations equal API calls”
An SDK typically fetches flags once and answers many evaluations from memory. Evaluations can be a thousand times more frequent than requests. If you try to predict your bill from evaluations, you will overestimate. If you try to predict flag usage from request counts, you will underestimate.
Trap 3: “the enabled count equals the audience”
A flag may be evaluated and return “off” for most users. The number of evaluations tells you the flag was asked about, not that the feature was shown. To learn how many users saw the feature, you need the product’s own events, tagged with the flag state, as Chapter 17 explains.
| You see | You may be tempted to say | A safer reading |
|---|---|---|
| 50,000 evaluations today | 50,000 people used it | Code asked 50,000 times |
| Evaluations doubled | Twice the users | More traffic, or a new code path asking more often |
| Zero evaluations | Nobody uses it | No reporting application asked in the period |
| Steady evaluations | The feature is popular | The flag is being asked about steadily |
A shop’s door counter clicks every time the door opens. A customer who goes in and out four times is counted four times. A delivery person with a trolley counts too. The click count is not the customer count. It is only a count of the door opening.
When you present flag numbers to managers, always label the unit. “Evaluations per day” and “users per day” look alike on a slide, and mixing them up leads to wrong decisions.
10Organisation Usage: Counting API Traffic
Besides per-flag charts, Flagsmith shows how much your whole account talks to it. This view is about capacity and cost.
What usage reporting shows
Organisation-level usage typically breaks traffic into kinds of request: calls that fetch flags, calls that fetch or update identities and traits, calls that download an environment document for local evaluation, and calls to the management API. Exact categories differ by version. Plans often include a monthly allowance, and the usage view shows how close you are to it.
Why this differs from flag analytics
| View | Counts | Main audience | Main question |
|---|---|---|---|
| Flag analytics | Evaluations of a particular flag | Developers, product owners | Is this flag used? |
| Organisation usage | API requests across the account | Platform leads, finance | Are we within plan, and what is growing? |
What drives request volume
- The number of users and how often each opens your app.
- Whether SDKs refresh flags frequently or cache them for longer.
- Whether you use identity-based requests, which are made per user, or environment-wide requests.
- Whether servers use local evaluation, which replaces many requests with periodic downloads.
- Retries and misbehaving clients, such as an app stuck in a loop.
Reading the trend
Plot usage against your own business numbers, such as daily active users. If requests per user steadily rise, something has become chattier. If they fall sharply, a cache or a bug may have stopped traffic. The ratio is usually more informative than the raw total.
A household reads its electricity bill monthly for the total, but looks at appliance readings to find which device uses most. Organisation usage is the bill. Flag analytics is the per-appliance reading.
Review the usage view monthly, and set a reminder when you pass about eighty per cent of your allowance. Surprises are cheaper when you see them coming.
11Client SDKs, Server SDKs and Local Evaluation
How your application evaluates flags changes what analytics sees. The same flag can look different depending on who asks.
Two families of SDK
Client-side SDKs run in browsers and mobile apps. They usually ask Flagsmith for the flags of one user and then answer evaluations from the result. Server-side SDKs run in your backend. They can either ask Flagsmith for each answer, or download the whole rule set and evaluate locally. The second approach is called local evaluation. It saves network calls and makes answers faster.
What changes for analytics
| Mode | Where evaluation happens | How counts arrive | Careful about |
|---|---|---|---|
| Client SDK | On the user’s device, from fetched flags | Batches from many devices | Closed browsers, sleeping phones, blockers |
| Server SDK, remote | Flagsmith answers each request | Batches from servers | Request volume and cost |
| Server SDK, local evaluation | Inside your server process | Batches from servers, reported by the SDK | Check analytics is enabled in this mode too |
Behaviour varies between SDK languages and versions. Some report analytics in local mode and some need a separate setting. Verify with a test flag rather than assuming.
flowchart LR
B["Browser or phone"] -->|"fetch flags, send batches"| F["Flagsmith"]
S1["Server, remote mode"] -->|"ask per request, send batches"| F
S2["Server, local evaluation"] -->|"download rules, send batches"| F
F --> D["Analytics charts"]
A phone call to ask every time whether a shop is open is the remote mode. A printed opening-hours sheet pinned in the window is local evaluation. The sheet is faster, but you need another way to count how often passers-by read it. SDK analytics is that counting.
After switching a service to local evaluation, watch the flag chart. If its line suddenly drops to zero, analytics may not be reported in the new mode, rather than the flag being unused.
12Accuracy: Batching, Loss and Sampling
Flag charts are reliable for trends and for yes-or-no questions. They are not an accounting ledger. Know where they blur.
Sources of error
Unsent batches
An app that stops suddenly may lose counts it had not yet sent.
Blocked requests
Browser privacy tools can block analytics calls from client apps.
Batch interval
The newest minutes are always incomplete.
Silent apps
Services without analytics enabled never appear.
Bucketing
Counts are added into slices, so exact moments are hidden.
Retention
Old detail may be summarised or dropped, depending on plan.
What the errors mean in practice
For trends, shape and presence, small losses do not matter. A flag with a million evaluations is clearly used whether the true figure is 950,000 or 1,050,000. The danger lies at the edges. A flag with five evaluations a month might be a vital rare job, or noise. An apparent zero might be a small loss. For deletion decisions, absence of evidence is not enough, so combine analytics with a search of the code and a conversation with the owner.
flowchart TD
Z["Chart shows near zero"] --> C1["Is analytics enabled in every app that could ask?"]
C1 --> C2["Does the code still mention the flag?"]
C2 --> C3["Is there a rare job: monthly, yearly, seasonal?"]
C3 --> C4["Does the owner agree?"]
C4 --> R["Safe to retire"]
A weighing scale in a kitchen is accurate to a few grams. That is fine for baking a cake, and not fine for measuring a medicine. Flag analytics is a kitchen scale: excellent for the big picture, unsuitable where a single unit matters.
13Finding Stale and Dead Flags
The most popular use of flag analytics is spring-cleaning. Done carefully, it shrinks risk and complexity.
Kinds of stale
| Kind | Evidence | Action |
|---|---|---|
| Never evaluated | Zero counts since creation; code never shipped | Ask the owner; delete if abandoned |
| Stopped being evaluated | Counts fell to zero after a release | Confirm code removed; then delete the flag |
| Fully on for everyone | Evaluated often, always on, no targeting | Make behaviour permanent in code; remove flag |
| Fully off for everyone | Evaluated often, always off | Remove the dead branch and the flag |
| Rare but real | Occasional spikes, monthly or yearly | Keep; add a note on its schedule |
A clean-up routine
List candidates
Sort flags by age and by recent evaluations; note the quiet ones.
Check coverage
Confirm every app that could ask reports analytics.
Search the code
Find mentions of the flag name across repositories and jobs.
Ask the owner
Confirm the purpose is complete and the decision is final.
Remove code first
Delete the branches in code, deploy, and watch evaluations fall.
Delete the flag last
Only after quiet confirmation, remove the flag from Flagsmith.
Clearing a loft means first checking who still owns the boxes, then looking inside, then asking the family, and only then taking things to the tip. Throwing away a box because it looked dusty is how wedding photographs get lost.
Delete the code first and the flag second. The falling count after the code is gone is the best proof that nothing else was asking.
14Monitoring a Rollout with Analytics
When you release a feature gradually, flag analytics tells you whether the release is reaching the places you expect.
What to watch
During a staged rollout, the flag’s evaluation line shows whether the new code path is being asked about at all. If the evaluations never rise after deployment, either the new build is not live, the code never calls the flag, or reporting is off. This is a fast sanity check, long before business results appear.
A rollout view
| Stage | Expect on the chart | If not |
|---|---|---|
| Code deployed, flag off | Evaluations begin, all returning off | Build not live, or code path not reached |
| Staff only | Evaluations continue; a few on | Segment not matching, or traits missing |
| Ten per cent | Evaluations stay steady | A drop suggests errors or a crash on the new path |
| Fifty per cent, hundred per cent | Evaluations stay steady or rise with traffic | A sudden fall means something stopped asking |
Remember that evaluation counts do not show how many users received “on”. Pair the chart with your product metrics and error rates, which tell the real story of health.
sequenceDiagram
participant R as Release owner
participant F as Flagsmith
participant A as Analytics chart
participant M as Monitoring
R->>F: Raise rollout to ten per cent
F-->>A: Evaluations continue
R->>A: Check the flag is being asked about
R->>M: Check errors and speed
M-->>R: Healthy or not
R->>F: Proceed, hold or roll back
When a new bus route opens, the first check is whether buses are actually running on it. Only later do you ask whether passengers are happy. A flat line on the evaluation chart is the empty road: nobody has come.
Evaluation counts can look perfect while the feature is broken. They show the flag was asked, not that the experience was good. Always watch errors and latency beside them.
15Capacity, Cost and Performance Planning
Usage numbers help you predict next quarter’s bill and next year’s infrastructure. They are an early warning system.
Forecasting from trends
Plot monthly API requests alongside active users. Divide one by the other to get requests per user. If your user base is expected to double and the ratio is stable, expect roughly double the requests. If the ratio is rising, find out why before the bill does it for you.
Ways to reduce request volume
Cache in the SDK
Hold flags for a sensible time instead of fetching often.
Use local evaluation on servers
Replace per-request calls with periodic downloads.
Fetch once per session
Avoid re-fetching on every page or screen.
Fix retry loops
A faulty client can multiply traffic unnoticed.
If you self-host
If you run Flagsmith yourself, the same numbers drive server sizing, database growth and the task processor workload that handles analytics writes. Analytics data accumulates. Plan storage, retention and cleaning so it does not slowly consume the database. Settings and defaults differ by version, so check the self-hosting documentation.
A town council counts cars on a road to decide how wide to make it and when to resurface it. It does not wait for the traffic jam. Usage charts let you widen the road in time.
Keep a single sheet with three numbers each month: active users, requests, requests per user. Three numbers, tracked monthly, catch most surprises.
16Sending Flag Data to Other Tools: Integrations
Flagsmith’s built-in charts answer simple questions. For richer questions, connect flags to the tools you already use.
The two directions
Flagsmith offers integrations of several types, which vary by version and plan. Some send flag change events to monitoring and chat tools, so a flag change appears as a marker on your performance charts or a message in a channel. Others send flag state or evaluation information to product analytics and data tools, so you can analyse behaviour by flag value. Check your own list of integrations for the tools that are currently supported.
| Type of integration | Example of purpose | Benefit |
|---|---|---|
| Monitoring and observability | Mark flag changes on performance charts | See whether a change coincided with errors or slowness |
| Product analytics | Attach flag state to user events | Compare behaviour between variants |
| Chat and ticketing | Announce changes to a team channel | Shared awareness, fewer surprises |
| Data warehouse or pipeline | Store flag events for later analysis | Long-term history under your control |
flowchart LR
F["Flagsmith"] -->|"flag change events"| M["Monitoring tool"]
F -->|"flag state or identity data"| P["Product analytics"]
F -->|"notifications"| C["Chat channel"]
F -->|"events"| W["Data warehouse"]
M --> I["Insight: did the change cause a problem?"]
P --> J["Insight: did behaviour differ?"]
A hospital ward monitor shows heart rate, but the doctor also reads blood tests and the nurse’s notes. Combining them gives the full picture. Flagsmith is one instrument that feeds the wider chart.
Every integration sends data out of Flagsmith. Check what it sends, who can see it at the destination and whether it includes user information. Chapter 24 covers privacy.
17Linking Flags to Product Analytics
The question “did the new feature help?” needs flag state and user behaviour in the same place. Here is how teams get there.
The idea
Your product analytics tool records events like “clicked buy” or “finished onboarding”. If each event also carries the value of the relevant flag for that user, such as “new checkout: on”, you can compare groups. Did users with the flag on finish onboarding more often than users with it off? That comparison is the heart of measuring a feature’s effect.
Three ways to attach the flag
Add it to each event
Your code reads the flag and includes its value as a property on events it sends.
Set a user property
Store the flag value on the user’s profile in the analytics tool, once per session.
Use an integration
Let Flagsmith send flag or identity information to the tool, where supported.
Keep the groups honest
For a fair comparison, the groups must be alike apart from the flag. If staff are in the “on” group and customers in the “off” group, any difference may be about who they are. Percentage splits, which assign users randomly by a stable calculation, give similar groups. Remember also that a user must have actually seen the feature to be compared, not only been assigned to the group.
Define the question
“Does the new checkout raise completed purchases?”
Choose the measure
Completed purchases per visitor, with a clear definition.
Split fairly
Use a percentage split rather than hand-picking users.
Tag the events
Attach the flag value to every relevant event.
Run long enough
Wait for enough users and a full weekly cycle.
Compare and decide
Read the difference with caution and agree the next step.
A bakery tries a new recipe on every other customer and notes which loaf each person bought again the next week. The note on each sale saying “recipe A” or “recipe B” is what makes the comparison possible. Without that note, the data is just a pile of sales.
18Experiments and A/B Testing with Flags
A flag splits users. An experiment asks which side did better. The split is easy. The reading of results is the hard part.
What an experiment needs
An experiment compares two or more versions of a feature using a fair split, a clear measure, enough users and a planned length. Flags handle the split. The measurement and the statistics usually live in a product analytics or dedicated experimentation tool. Flagsmith’s own capabilities for experiments and the exact tools it connects with differ between versions and plans, so check what yours offers.
Common ways to go wrong
Stopping early
Peeking at a promising result and ending the test too soon.
Too few users
Small groups give noisy results that look like findings.
Unfair groups
Different kinds of users in each group.
Too many measures
Checking twenty metrics and celebrating the one that moved.
Changing mid-test
Editing the percentage or rules while the test runs.
Ignoring the calendar
A holiday week can distort everything.
Where flag analytics fits
The evaluation chart is a health check for the experiment: is the flag being asked about by both groups, and is traffic steady? It cannot tell which version won. That answer lives in your outcome data.
A school trying two teaching methods in two classes must make sure the classes are similar, teach for a full term and compare marks fairly. Counting how many lessons were taught is useful for the timetable, but it does not say which method worked.
Write the question, the measure and the end date before the experiment begins. The most trusted results are the ones where the rules were fixed in advance.
19Multivariate Flags and Value-level Questions
Not every flag is on or off. Some return one of several values. Counting then becomes a question of which value.
What multivariate means
A multivariate flag has more than two possible values, for example a button colour of “blue”, “green” or “orange”, each assigned to a share of users. Flagsmith manages the split. For analytics, the new question is not only how often the flag was evaluated but how often each value was returned.
What you can and cannot see
Built-in flag analytics is primarily about evaluation counts per flag. Depending on version, richer breakdowns by value may or may not be available. Where they are not, attach the returned value to your own events, as Chapter 17 describes, and analyse the split there. Check your version’s documentation for what the Analytics view shows for multivariate flags.
| Question | Where to answer it |
|---|---|
| How often is the flag asked about? | Flagsmith flag analytics |
| What share is configured for each value? | The flag’s settings in Flagsmith |
| How many users actually got each value? | Your own events, tagged with the value |
| Which value performs best? | Product analytics or an experiment tool |
An ice-cream van offers three flavours. The till tells you how many cones were sold in total, but only the flavour tally on the sales sheet tells you which one people chose. You need the second record to know their preference.
Configured percentages are intentions, not outcomes. Real shares depend on who actually showed up, so measure the real split before drawing conclusions.
20Designing a Useful Flag Dashboard
Charts that nobody looks at are decoration. A small, purposeful dashboard turns numbers into habits.
Start from questions, not data
Write down the three or four questions people actually ask: Are my flags used? Is the rollout reaching traffic? Are we near our plan limit? Which flags are old? Each question becomes one panel. Anything that does not answer a question is left out.
A sensible starter dashboard
| Panel | Shows | For whom |
|---|---|---|
| Monthly API requests versus allowance | Trend against plan limit | Platform lead |
| Requests per active user | Chattiness of apps | Platform and mobile leads |
| Top flags by evaluations | Which flags matter most | Everyone |
| Flags with zero evaluations for thirty days | Clean-up candidates | Flag owners |
| Flag change events on error charts | Correlation of changes and trouble | On-call |
| Age of oldest flags | Backlog of stale flags | Engineering managers |
Design habits
- Label units on every chart: “evaluations per day”, not just “count”.
- Use the same time zone everywhere.
- Put the most important panel top left, where people look first.
- Keep it to one screen. A long scroll hides the very thing you wanted to show.
- Show a note about coverage: which services report.
A car dashboard shows speed, fuel and warnings, not every sensor in the engine. The driver glances at it dozens of times a trip. A flag dashboard should be readable in the same glance.
21Alerts: Letting the Numbers Tap You on the Shoulder
Nobody watches a dashboard all day. Alerts watch for you and speak only when something deserves attention.
Useful alerts
Usage near plan limit
Warn at eighty per cent of the monthly allowance, with time to react.
Sudden traffic spike
Requests far above normal may reveal a retry loop.
Critical flag stopped reporting
For a flag that must always be asked about, silence is a signal.
Unusual change timing
A Production flag change at odd hours deserves a glance.
Where to build them
Flagsmith itself offers limited alerting in some places, such as notifications about usage in some plans. For fine-grained alerts, send the numbers or events to your monitoring tool through an integration or the API, and create alerts there, where on-call rotas and notification channels already exist. Check what your version supports.
Avoiding alert fatigue
An alert that fires too often is soon ignored. Set thresholds from real history, give each alert an owner and an action, and delete alerts nobody acts on. Fewer, trusted alerts beat many noisy ones.
flowchart LR
N["Numbers from Flagsmith"] --> T["Threshold from real history"]
T --> A["Alert fires"]
A --> O["Named owner"]
O --> X["Documented action"]
X --> L["Review: keep, tune or delete the alert"]
A smoke alarm that never rings is useless, and one that rings every time you make toast gets its battery removed. Good alerts sit between the two: quiet until they matter.
22Building a Flag Hygiene Programme
Cleaning once is a project. Cleaning every month is a habit. Analytics makes the habit cheap.
The monthly rhythm
Week 1: list
Export or view flags sorted by age and by evaluations, and mark candidates.
Week 2: confirm
Owners check code and decide: keep, finish or retire.
Week 3: remove
Code is cleaned and deployed; flags are made permanent or scheduled for removal.
Week 4: delete and report
After quiet confirmation, flags are deleted and the count of removals is shared.
Making it stick
- Give every flag an owner and an expected end date when it is created, using the description or tags.
- Publish one number each month: flags created, flags removed, flags older than ninety days.
- Make removal part of the “definition of done” for any feature behind a flag.
- Keep deletion rights narrow so removals are deliberate.
| Flag type | Typical life | Retirement trigger |
|---|---|---|
| Release flag | Days to weeks | Feature fully released |
| Experiment flag | Weeks | Decision made |
| Operational kill switch | Long-lived | Component retired |
| Permission or plan flag | Long-lived | Business model changes |
A kitchen with a weekly “use the old food” rule never fills with forgotten jars. A kitchen cleaned once a year needs a skip. Flag hygiene is the weekly rule.
Real-world example: toggle debt
Engineering writers have long described unremoved feature toggles as a form of technical debt, because each adds a code path that must be tested and understood. Teams that track toggle age and set removal dates report fewer surprises and simpler code.
23Analytics Versus the Audit Log
Two records sit near each other and are often confused. One says what was used. The other says what was changed.
| Aspect | Flag analytics | Audit log |
|---|---|---|
| Records | How often a flag was asked about | Who changed which setting, and when |
| Source | SDKs in your applications | Actions in the dashboard or API |
| Volume | Large, continuous | Small, event-by-event |
| Typical question | Is this flag used? | What changed before the incident? |
| Accuracy | Approximate, aggregated | Exact, event-level |
Using them together
The two records answer the classic incident question when combined. The audit log says “at 14:02 someone raised the rollout to fifty per cent”. Flag analytics, alongside your error charts, shows “at 14:03 evaluations rose and errors followed”. Neither alone would tell the story as clearly.
flowchart TD
I["Incident: errors rise at 14:03"] --> AL["Audit log: change at 14:02"]
I --> FA["Flag analytics: evaluations rose at 14:03"]
AL --> C["Cause: rollout step"]
FA --> C
C --> R["Roll back and review"]
A shop has a staff rota (who did what, when) and a till record (how many sales occurred). After a puzzling busy afternoon, you read both: the rota shows who changed the window display, and the till shows when the queue grew.
24Privacy, Security and Compliance of Analytics Data
Flag counts feel harmless, but the data around them can touch people. Handle it with the same care as other analytics.
What data is involved
Built-in evaluation counts are mostly numbers by flag, environment and time, which carry little personal information. But the wider picture includes identities and traits, which may describe real people, and integrations, which send data to other tools. Those are where privacy questions arise.
Safe habits
Opaque identifiers
Use internal IDs rather than names or emails as user identifiers.
Minimal traits
Store only what targeting needs, such as plan tier.
Check each integration
Know what leaves Flagsmith and who sees it at the destination.
Limit who can view
Reading analytics and identities is a permission, not a right.
Respect consent
If your law or policy requires consent for analytics, apply it to flag-related data too.
Plan retention
Decide how long to keep data and how to delete it on request.
Security of the pipeline
SDKs send counts using your environment key. A client-side key is public by nature, so assume anyone could send false counts with it. Do not make business decisions that depend on these counts being tamper-proof. Treat them as helpful signals, not as audited facts.
A suggestion box outside a shop can be filled by anyone, so the notes are useful as feedback but not as proof. Public-facing counts have the same nature: useful, never fully authoritative.
Data protection law depends on your country and on what you store. Ask your privacy or legal team before sending user-linked flag data into other tools.
25Debugging Missing or Strange Numbers
When a chart looks wrong, the cause is usually one of a handful of ordinary things. Work through them in order.
flowchart TD
S["Chart shows nothing or looks wrong"] --> A["Is analytics enabled in the SDK?"]
A --> B["Is the app using the right environment key?"]
B --> C["Is the app version deployed and running?"]
C --> D["Can the app reach Flagsmith: network, blockers, firewall?"]
D --> E["Is the time range and time zone right?"]
E --> F["Has enough time passed for batches?"]
F --> G["Is the flag name spelled the same in code and dashboard?"]
Common symptoms and causes
| Symptom | Likely cause | Cure |
|---|---|---|
| No counts at all | Analytics setting off | Enable in the SDK and redeploy |
| Counts only from some services | Partial rollout of the setting | List services and fix the missing ones |
| Counts in Staging but not Production | Wrong key or older build in Production | Check key and deployed version |
| Counts dropped after a release | New mode, such as local evaluation, without reporting | Check mode-specific analytics setting |
| Browser users missing | Blockers or privacy tools stopping calls | Accept partial coverage, rely on server counts |
| Spike with no explanation | Retry loop, test script or bot | Look at the source and rate-limit |
| Chart disagrees with another tool | Different units or time zones | Align definitions before comparing |
When a tap runs dry, a plumber checks in order: is the main tap on, is the pipe blocked, is the supply cut? Jumping to the last possibility wastes the afternoon. The same order saves time with charts.
Create a harmless test flag in a test environment, evaluate it a few times from a test app and check that counts arrive. This tiny rehearsal proves the pipeline works before you rely on it.
26Anti-patterns to Avoid
An anti-pattern is a habit that looks sensible and causes trouble later. These five are the most common with flag analytics.
What it looks like
A slide says “50,000 users enabled the feature” when the chart shows 50,000 evaluations.
Why it hurts
Decisions are made on a number that means something else. Credibility suffers when someone checks.
Do this instead
Label units and measure users in product analytics with the flag value attached.
What it looks like
A flag with zero counts in the last week is deleted straight away.
Why it hurts
Monthly jobs, silent services and old mobile apps do not appear in a short window, and a rare feature breaks.
Do this instead
Use the longest range, check coverage, search the code, ask the owner and remove code before the flag.
What it looks like
Analytics is enabled in two services out of seven, but conclusions are drawn for the whole company.
Why it hurts
The charts silently omit most of the traffic, so the conclusions are wrong in unknown ways.
Do this instead
Keep a coverage list on the dashboard and enable analytics everywhere before trusting absence.
What it looks like
Twenty panels are built once, admired, and never used again.
Why it hurts
Effort is wasted and real problems are missed because nobody looks.
Do this instead
Build around four real questions, add a monthly review and alerts that tap people on the shoulder.
What it looks like
Flags are never removed because “we might need them”. Hundreds accumulate.
Why it hurts
Code paths multiply, tests balloon, mistakes become likely and new people cannot tell which flags matter.
Do this instead
Set an end date at creation, run a monthly hygiene routine and measure flag age.
Real-world example: metrics that misled
Many companies have shared stories of dashboards that looked healthy because a counter measured activity, not value. The consistent advice is to define what a number means, who it is for, and what decision it supports, before putting it on a screen.
27Advantages, Disadvantages and Trade-offs
Flag analytics is cheap, simple and very useful. It is also approximate and narrow. Seeing both sides helps you use it well.
Advantages
- Shows at a glance which flags are alive and which are quiet
- Gives early evidence that a rollout is reaching traffic
- Makes clean-up evidence-based, not guesswork
- Helps plan capacity and cost
- Needs only a setting in the SDK
- Pairs easily with monitoring and product analytics
Disadvantages
- Counts questions, not users or outcomes
- Approximate: batching, blockers and shutdowns lose some data
- Coverage gaps can fake silence
- Breakdowns and retention depend on plan and version
- Adds a little network and processing cost
- Cannot prove a feature is good
Built-in analytics compared with other ways
| Approach | Strength | Weakness | Best for |
|---|---|---|---|
| Flagsmith built-in flag analytics | Zero extra tooling; per-flag view | Coarse; limited breakdowns | Usage, clean-up, rollout sanity checks |
| Product analytics with flag properties | User-level behaviour by variant | Needs careful tagging of events | Measuring feature impact |
| Observability with flag-change markers | Links changes to errors and speed | Does not count flag usage well | Incident response |
| Your own logging of flag decisions | Exact, under your control | Cost, volume, privacy burden | Audited or regulated decisions |
Cost and overhead
Counting costs very little: a tally in memory and an occasional message. For most applications the extra load is negligible. In extremely busy services, check that analytics does not add noticeable load, and if it does, consider enabling it on a sample of instances. Always test the effect before widening.
A pedometer is cheap, light and useful for knowing roughly how far you walked. It is not a medical device and should not be used to prescribe medicine. Know the instrument, and use it for what it is good at.
Use the built-in charts for the big, simple questions and a richer tool for the careful ones. Needing both is normal.
28Best Practices and Common Mistakes
Experienced teams repeat a short list of habits. New teams repeat a short list of mistakes. Here are both.
Habits worth building
Enable analytics everywhere early
Turn it on in every SDK from the start, so history exists when you need it.
Keep a coverage list
Write down which services and app versions report, and update it.
Label every unit
Evaluations, requests and users are different things.
Use analytics as a first check, not a final verdict
Pair with error rates, latency and product metrics.
Retire flags by evidence
Long range, code search, owner confirmation, then code before flag.
Mark flag changes on charts
Use integrations so changes appear beside performance graphs.
Review usage monthly
Track requests per user and plan allowance.
Set owners and end dates
Every flag has a person and a planned removal date.
Mistakes to catch early
Trusting short windows
A week of data hides monthly and seasonal use.
Mixing time zones
Comparing a UTC chart with a local-time chart.
Forgetting old apps
Ignoring mobile versions that never report.
Checking the flag, not the result
A busy flag does not mean a working feature.
Changing mode silently
Switching to local evaluation without checking analytics still reports.
Over-alerting
Alerts so frequent that people ignore them.
Pin the habits next to your team’s flag checklist. A short, visible list is repeated more reliably than a long document.
29Ownership and Governance of Flag Data
Numbers need owners. Without them, charts are admired once and then forgotten.
Who owns what
| Duty | Owner | Rhythm |
|---|---|---|
| Enabling analytics in each service | The service’s team | At creation and on SDK upgrades |
| Coverage list | Platform lead | Updated when services change |
| Per-flag clean-up | Flag owner | Monthly routine |
| Usage and plan review | Platform lead with finance | Monthly |
| Alerts | On-call lead | Reviewed quarterly |
| Privacy review of integrations | Security or privacy officer | When adding or changing an integration |
Permissions around data
Viewing analytics, identities and integration settings are all permissions in Flagsmith, and plans may offer fine-grained control. Give read access widely to those who need to understand usage, and keep changes to integrations and keys narrow. A short written policy of one page, covering who may enable integrations and what data may leave, avoids arguments later.
Documentation that helps
- A one-page glossary: evaluation, request, identity, coverage.
- A runbook for “chart looks wrong” with the path from Chapter 25.
- A list of integrations with owners and purposes.
- A statement of retention: how long analytics are kept and why.
A building has a caretaker who reads the meters, keeps the register of keys and checks the fire extinguishers on a schedule. Nobody remembers to do it unless one person is named. Flag data needs a named caretaker too.
30A Maturity Path for Flag Analytics
Teams do not need everything at once. Grow in steps, and take the next step when the current one feels comfortable.
flowchart LR
L1["Level 1: analytics on, charts viewed ad hoc"] --> L2["Level 2: coverage list, monthly usage review"]
L2 --> L3["Level 3: hygiene routine, owners and end dates"]
L3 --> L4["Level 4: integrations, flag markers, alerts"]
L4 --> L5["Level 5: flag-tagged product events and experiments"]
| Level | You can answer | Next step |
|---|---|---|
| 1 | Is this flag asked about? | List every service and confirm they all report |
| 2 | Are we within plan, and what is growing? | Give each flag an owner and an end date |
| 3 | Which flags can we safely retire? | Connect monitoring to see changes beside errors |
| 4 | Did a change cause a problem? | Attach flag values to product events |
| 5 | Did the feature help our users? | Refine experiments and share the learning |
A new gardener first learns to water, then to weed, then to prune, then to plan the seasons. Trying to plan the seasons before learning to water kills the plants. Each skill is built on the one before.
Ask which level you are on and what question you cannot yet answer. That question is the reason for the next step.
31A Complete Worked Scenario
To finish, here is one imaginary company taken from “we have no idea” to a calm, measured flag practice, using everything in this guide.
BrightCart, the imaginary online shop, has grown to ninety engineers and about three hundred flags, a web app, an Android app, an iOS app and nine backend services. Nobody knows which flags are alive. A recent incident, in which an engineer removed an apparently unused flag that a monthly invoicing job still read, has made the team nervous. The platform lead is asked to bring order.
Week 1: take stock of coverage
The lead lists all thirteen applications. Analytics is enabled in only four. The lead asks each team to enable it, starting with the invoicing job, and keeps a coverage sheet.
Week 2: test the pipeline
A harmless test flag is created in Staging and read from each app. Counts appear for twelve apps. One backend, recently moved to local evaluation, reports nothing; a missing setting is found and fixed.
Weeks 3 to 6: gather evidence
The team waits through a full month, including month-end, so rare jobs have a chance to appear. Mobile coverage is noted as partial, since old versions will never report.
Week 7: list candidates
Flags are sorted by recent evaluations. Ninety have zero counts for thirty days. Of these, owners confirm sixty are finished, twenty belong to rare jobs (including the invoicing flag, now visibly spiking at month-end) and ten are unknown.
Week 8: remove code first
For the sixty finished flags, teams delete the dead branches and deploy. Evaluations fall to zero as expected. Only then are the flags deleted, over two weeks.
Week 10: connect to monitoring
Flag change events are sent to the monitoring tool, so each change appears as a marker on error and latency charts. The on-call engineers find it immediately useful.
Week 12: build the dashboard
One screen shows requests against plan allowance, requests per active user, top flags, zero-evaluation flags and flag age. An alert warns at eighty per cent of the allowance.
Ongoing: the monthly routine
Each month the team reviews usage and the clean-up list. New flags must have an owner and an end date. After a quarter, the flag count has fallen to 190 and nobody is afraid of deleting.
Next: measure impact
For a new checkout, the product team attaches the flag value to purchase events in their product analytics tool, uses a fair percentage split and waits two full weeks before deciding.
Notice the rescue of the invoicing flag. A short window would have declared it dead. A full month, with analytics enabled in the invoicing job, showed the spike. Evidence needs both coverage and time.
What would have gone wrong without the routine?
Without it, the team would have kept adding flags until the dashboard became unreadable, or deleted by hunch until another job broke. Plan limits would have arrived as a surprise bill. The next experiment would have been argued from opinion, because nobody could say which users saw what. Each risk is ordinary, and each is closed by a habit in this guide.
32Reading Charts: Five Short Stories
Rules are easier to remember as stories. Here are five typical chart shapes, what they meant and what the team did.
Story 1: the line that never rose
A team released a new search feature behind a flag and raised the rollout to twenty per cent. An hour later the evaluation line was still flat. The release owner did not celebrate or panic. She checked the path: the flag was spelled with a capital letter in the code and a lower-case letter in the dashboard. The code was asking for a flag that did not exist, and was quietly using its default. A one-letter fix brought the line to life. The lesson is that a flat line right after a release is a cheap, early warning that the code never reached the flag.
Story 2: the cliff after Tuesday
A flag that normally showed steady evaluations dropped to zero on a Tuesday afternoon. The team feared an outage. Looking at the deployment history, they saw that a backend service had been upgraded the same day and moved to local evaluation. The service was working perfectly. It just was not reporting counts in its new mode. Enabling the right setting restored the line. The lesson is to check analytics after changing how a service evaluates flags.
Story 3: the monthly heartbeat
A flag showed zero for twenty-seven days and then a burst of thousands of evaluations on the last night of the month. An engineer new to the team had marked it for deletion. The owner explained that it controlled month-end invoicing. The chart, viewed over a longer range, showed a perfectly regular heartbeat. The lesson is that the range you view decides whether you see the heartbeat at all.
Story 4: the sawtooth
One flag’s chart looked like a saw, with sharp spikes every five minutes. The cause was a mobile app that refreshed flags on a timer, with thousands of phones set to the same schedule after a common release. Counts were fine, but the burst loaded the service. The team added a small random delay to the refresh so phones no longer all arrived together. The lesson is that charts reveal patterns in your own code, not just in your users.
Story 5: the double staircase
During a percentage rollout, evaluation counts rose in two clear steps, matching the two times the release manager increased the percentage. The counts rose even though the flag was evaluated for everyone, so the team was puzzled. The reason was a new page that asked about the flag more often when the feature was on, because of the extra interface it drew. The lesson is that evaluation counts can change because behaviour changed, not just because traffic did.
| Shape | First suspicion | First check |
|---|---|---|
| Flat after release | Code not reaching the flag | Flag name spelling, build live |
| Cliff to zero | Reporting stopped | Recent changes in SDK mode or version |
| Rare bursts | A periodic job | Longer time range |
| Regular spikes | Timers or scheduled refreshes | Client refresh settings |
| Steps with rollout | Code asks more when feature is on | The feature’s own code |
A doctor learns to recognise patterns: a certain kind of cough, a certain kind of rash. After seeing enough cases, a glance at the shape says where to look first. Reading flag charts is a practised eye, built by seeing many shapes and asking why.
33Mobile Apps, Offline Devices and Slow Updates
Mobile apps are the hardest place to count. People forget to update, phones go offline and the operating system sleeps your app.
Why mobile data looks thin
A server runs all day and sends its batches on time. A phone does not. The app may be closed within seconds of opening, before a batch is sent. The phone may be in a tunnel, on aeroplane mode or short of battery. Mobile operating systems often pause background activity to save power. As a result, counts from mobile apps tend to arrive later and in smaller amounts than the real number of evaluations.
The long tail of old versions
When you ship a new mobile version, only part of your users upgrade quickly. Others keep old versions for months or years. An old version released before analytics was enabled will never report. An old version that uses a different flag name will evaluate a flag you think is dead. This is why flags that mobile apps depend on should be retired slowly and with care.
| Mobile issue | Effect on counts | Practical response |
|---|---|---|
| App closed quickly | Batches lost | Use shorter batch waits or send on background, per SDK guidance |
| Device offline | Counts delayed or lost | Accept partial data; rely on trends |
| Old app versions | Never report, or ask for old flags | Track version spread; keep flags until old versions fade |
| Different SDK versions | Different batch behaviour | Standardise upgrades |
| Battery and privacy settings | Background sends blocked | Do not treat counts as complete |
A safe rule for mobile flags
Do not remove a flag that a mobile app might read until you have measured how many users still run versions that read it. Your app store consoles or product analytics can tell you the share of users on each version. When the oldest version that reads the flag falls below a level you are comfortable with, plan the removal, and make the code’s default behaviour safe for those who remain.
A company that prints a paper catalogue cannot recall old copies from people’s homes. Years after a product is withdrawn, someone still orders it from an old catalogue. Old mobile apps are the old catalogues: they keep asking for things you stopped selling.
Never remove a flag only because it is quiet in server data. A mobile app version in the wild may still be reading it.
34Comparing Environments and Projects
Charts are kept per environment. Comparing them tells you whether your stages behave alike, and whether what you test is what you ship.
Staging versus Production
If a flag is evaluated thousands of times a day in Production but never in Staging, your tests are not exercising that code path. That is a finding, not just a statistic. It suggests missing test coverage for a feature customers use. If a flag is evaluated in Staging and never in Production, a feature may not have been deployed there, or may be reached only by a path real users never take.
Useful comparisons
Staging and Production
Are the same flags alive in both? Differences reveal test gaps.
Before and after a release
Does usage change in the way the release intended?
Weekday and weekend
Is the rhythm what your users’ behaviour suggests?
Project to project
Which products are heavy on flags, and which are tidy?
Across projects
If your organisation has several projects, compare their flag counts, flag ages and request volumes. A project with three hundred flags and almost no traffic is a clean-up target. A project with twenty flags and enormous traffic is a capacity target. Uniform dashboards across projects make this easy to see at a glance, and a monthly one-page comparison is often enough to start good conversations.
flowchart LR
D["Development counts"] --> C["Compare"]
S["Staging counts"] --> C
P["Production counts"] --> C
C --> G["Gap: flag live in Production but untested in Staging"]
C --> H["Healthy: same flags alive in all stages"]
A theatre rehearses on a practice stage and performs on the main stage. If a prop is used every night in the performance but never in rehearsal, the director knows rehearsals are missing something important. Comparing environments is that director’s glance.
35Kill Switches and Operational Flags
Some flags exist to be switched in emergencies. Their analytics tell a different story: here, being busy is good and being silent is suspicious.
What a kill switch is
A kill switch is a flag that lets you turn off a risky or expensive part of your system quickly, such as a recommendation engine, a third-party payment option or a heavy report. Normally the flag is on and the feature runs. In trouble, someone turns it off and the system protects itself. These flags are meant to live for years.
What to watch
| Observation | Healthy meaning | Worrying meaning |
|---|---|---|
| Steady evaluations, always on | Code path is live and protected | None: this is the expected state |
| Evaluations drop to zero | Feature intentionally removed | Code no longer checks the switch; the kill switch is dead |
| Evaluations continue after switching off | Code asks and obeys the answer | None, if the feature stopped |
| Feature still runs after switching off | None | Caches, or code ignores the answer |
Rehearse the emergency
The scariest kill switch is the one that does not work when needed. Test them on a calm day in a safe environment: switch off, watch evaluations and behaviour, switch on again. Flag analytics supports the rehearsal by showing that the code is asking, but you must also confirm the feature really stops, using the application itself or its own metrics.
Protect these flags from clean-up
Because kill switches may be evaluated quietly for years, a naive hygiene routine might treat them as ordinary. Tag them clearly as operational, give them named owners and exclude them from automatic removal lists. A removal should require a written decision.
A fire extinguisher hangs on the wall for years and is never used. Nobody counts that as waste. They check it on a schedule, make sure the pin is in and that it still works. Kill switches deserve the same quiet attention.
Rehearse each kill switch twice a year, record the result and note how long the effect took to reach users. Knowing the delay in advance is worth more than guessing during an incident.
36Getting the Data Out: APIs, Exports and Your Own Reports
The dashboard answers common questions. Your own questions may need the data in your own tools.
Why export
Dashboards are limited by their design and by the retention of your plan. If you want to keep two years of history, join flag usage with sales, or draw a chart the dashboard does not offer, you need the numbers elsewhere. Flagsmith provides a management API, and depending on version and plan there may be endpoints for usage and flag analytics, along with integrations that stream events outward. Check the documentation for what is available to you.
A simple reporting pipeline
Choose the question
For example, “which flags had zero evaluations for ninety days?”
Fetch on a schedule
A small job reads the data through the API, using a limited credential.
Store it
Save the daily numbers in a table or a data warehouse, so history is yours.
Report
A simple dashboard or email lists candidates and trends.
Act and review
Owners respond; the team checks that the report is read and useful.
Safe habits for automation
- Use a dedicated credential with read-only rights where possible, never a person’s personal token.
- Respect rate limits, and avoid fetching more often than the data changes.
- Store the date of each fetch, so gaps are visible later.
- Document the pipeline so someone else can repair it.
A bank gives you a monthly statement, but if you want to track your spending over five years you copy the numbers into your own notebook. The statement is the dashboard, and the notebook is your own history.
37Explaining Flag Numbers to Non-technical People
Managers, product owners and executives need conclusions, not definitions. A few habits make numbers understandable and honest.
Say what it means in one sentence
Instead of “evaluations rose forty per cent”, say “the new checkout is being asked about much more, which means the release reached the busy pages as planned”. Always connect the number to a decision or a meaning. If you cannot, the number may not be worth showing.
Choose honest wording
| Instead of | Say |
|---|---|
| “Nobody uses this flag.” | “No reporting application has asked about it in ninety days, and we are checking the rest.” |
| “Fifty thousand users saw it.” | “The flag was checked fifty thousand times; we are measuring users separately.” |
| “The rollout is healthy.” | “The flag is being reached and errors are steady.” |
| “We saved money.” | “Requests per user fell by a third, which should lower next quarter’s usage.” |
Show uncertainty plainly
Because flag counts are approximate, say so in a short note: “Counts may miss a few per cent due to batching and blocked requests”. People trust numbers more when limits are admitted. They trust them less when a limit is discovered by surprise.
One message per chart
A title that states the point: “Checkout flag now reaches all traffic”.
Plain units
“Checks per day”, not “evaluations per bucket”.
Before and after
People understand change better than absolute numbers.
A named next step
End with who will do what by when.
A pilot tells passengers “we are cruising smoothly and will land on time”, not the readings of forty instruments. The instruments matter to the crew. The passenger needs the meaning. Share the meaning, and keep the instruments handy for anyone who asks.
38Seasonal Flags and the Calendar of Exceptions
Some flags are silent for most of the year and vital for a few days. Analytics alone will call them dead. A calendar will not.
Flags with a rhythm
Think of tax season features, festival sales, year-end reports, school-term logic and holiday banners. Their charts show long flat stretches and short, intense bursts. A hygiene routine that looks only at the last thirty days will propose deleting them every month, and will be wrong each time.
Mark them clearly
| Technique | How it helps |
|---|---|
| Tag as seasonal | Filters them out of automatic clean-up lists |
| Write the active period in the description | Newcomers see the rhythm without guessing |
| Add a calendar reminder | The team tests the flag before the season begins |
| Review after each season | Decide whether to keep, simplify or retire it |
Test before the season, not during
A flag that has been silent for ten months may depend on code that nobody has run since. Before its season, switch it on in Staging, run through the feature and confirm the evaluation counts appear. Finding a broken seasonal feature in the first minutes of the sale is the most expensive way to discover it.
flowchart LR
Q["Quiet months"] --> R["Rehearse in Staging before the season"]
R --> L["Launch: bursts of evaluations"]
L --> V["Review after the season"]
V --> K["Keep, simplify or retire"]
K --> Q
A family keeps Christmas decorations in the loft for eleven months. Nobody calls them clutter in March. But in early December they take the boxes down and test the lights before hanging them. The calendar, not the dust, decides whether they stay.
Keep one shared page listing seasonal flags with their dates and owners. It is the cheapest insurance against a well-meaning clean-up.
39Designing Code So Analytics Stays Meaningful
The numbers you get depend on how your code asks. A few small habits in the code make the charts far easier to trust.
Ask once, near the decision
If a page checks the same flag in twelve places, the evaluation count is twelve times the number of page views, and it tells you little. Where practical, ask once at the point where the decision is made, keep the answer for the rest of that request or screen, and pass it along. Counts then look like real decisions, and charts are easier to compare over time.
Use clear, stable flag names
A flag name is a promise between code and dashboard. Use names that describe the feature, avoid spelling variations and keep one name per concept. If two flags secretly mean the same thing, analytics will split their counts and mislead you. When a flag must be renamed, create the new one, change the code, wait until the old one falls silent, and only then remove it.
Choose safe defaults
When Flagsmith cannot be reached, your code falls back to a default. Choose defaults that are safe: usually “off” for new features, and “on” for protective behaviour. Remember that defaults can hide problems from analytics, because a request that fell back to the default may not be counted the same way as a normal evaluation. Watch for flags that look steady while the service is actually failing to reach Flagsmith.
One question per decision
Keep counts close to real choices, not to how many times a screen redraws.
One name per idea
No duplicates or spelling variants that split counts.
Safe defaults
Decide what happens when the answer is not available.
Remove dead branches promptly
Short-lived flags keep both code and charts simple.
Keep flag logic thin
The more complicated the code around a flag, the harder it is to remove and the harder its counts are to interpret. A flag that guards one clear decision, such as which checkout page to show, is easy to measure and easy to retire. A flag woven through twenty functions makes every evaluation ambiguous: which decision was this count for? Prefer one flag per decision, and keep the branch small, so that when the flag’s work is done, deleting it is a short, safe edit rather than a risky rewrite.
It also helps to add a comment next to each flag check naming its owner and its planned removal date. When a future engineer meets the flag at three in the morning, that single comment answers two questions at once: whom to ask, and whether this flag is meant to stay. Small notes like this turn analytics findings into quick, confident actions.
Make the flag easy to find in code
Keep flag names in one place, such as a shared list or constants file in each application, rather than scattered strings. A single list makes it easy to search for every use of a flag before removal, and ensures spelling matches the dashboard. Teams that do this report that the Story 1 mistake in Chapter 32, a misspelt name, almost never happens again.
A librarian who files every book under one clear title can answer “how many times was this borrowed?” in seconds. If the same book is filed under three spellings, the answer is three smaller numbers and a puzzled librarian. Naming is bookkeeping for flags.
40A Checklist for Trusting a Flag Chart
Before you act on a number, run through a short list. It takes two minutes and prevents most wrong conclusions.
The ten questions
What is being counted?
Evaluations, requests or something else? Say the unit aloud.
Which environment?
Production and Staging tell different stories.
Which time range and zone?
Is the range long enough for rare jobs? Is the zone what you expect?
Who reports?
Check the coverage list: which services and app versions send counts.
What changed recently?
Releases, SDK upgrades or mode changes can move a line without any user change.
What does the audit log say?
Did someone change the flag just before the shape changed?
What do other charts say?
Errors, speed and product metrics confirm or contradict the story.
Is the newest data complete?
The last few minutes are always thin because of batching.
What would prove me wrong?
Name one observation that would change your mind, and look for it.
Who should I ask?
The flag’s owner often knows a reason that charts cannot show.
Using the checklist as a team habit
The checklist works best when it is shared. In a review meeting, ask the person presenting a chart to answer the first four questions out loud before showing any conclusion. Over a few weeks, this becomes automatic, and the quality of discussion rises: people stop arguing about what a number means and start discussing what to do. New joiners also learn the vocabulary quickly, because they hear the same questions asked of every chart, whether it is a small flag or a major launch.
Keep a short log of times the checklist caught a mistake, such as a missing service in the coverage list or a time zone mix-up. These stories are the best training material you will ever have, because they are real, local and recent. Share one at each monthly review, and the habit will sustain itself.
Why the last two matter most
People tend to look for evidence that agrees with what they already believe. Asking what would prove you wrong is a simple discipline that breaks the habit. Asking the owner reminds you that a number is a clue to a human story: a launch, a quirk, a deadline. Charts rarely explain themselves.
| Decision | Minimum evidence |
|---|---|
| Declare a rollout reached traffic | Rising evaluations plus steady errors |
| Retire a flag | Long quiet range, full coverage, code search, owner agreement |
| Claim a feature improved a metric | Fair split, flag-tagged product events, enough users and time |
| Change a plan or budget | Several months of usage per active user |
| Blame a flag change for an incident | Audit log time, chart shape and error timing agree |
A pilot runs through a checklist before every flight, even after thousands of flights, because small omissions cause large problems. The two minutes spent on a chart checklist are the same kind of cheap protection.
Print the ten questions and keep them near the team’s dashboard. When a number surprises someone, start at question one and walk down.
41Frequently Asked Questions
Short, direct answers to the questions people ask most often about flag analytics in Flagsmith.
42Summary and Key Takeaways
Flag analytics is a counter beside every switch. It is simple, approximate and very useful, as long as you know exactly what it counts.
Key Takeaways
- Know the unit. An evaluation is one question about a flag. It is not a user and it is not an API request, and mixing them up leads to wrong decisions.
- Coverage comes first. Counts exist only where analytics is enabled in the SDK. Keep a list of every service and app version that reports before you trust silence.
- Numbers are close, not exact. Batching, blockers and sudden shutdowns lose a little data. Use charts for trends and presence, not for accounting.
- Retire by evidence. Use the longest window, check coverage, search the code, ask the owner, remove the code first and delete the flag last.
- Use it as a first check in rollouts. A rising line shows the flag is being asked about. Errors, speed and product metrics decide whether the release is healthy.
- Connect to other tools. Mark flag changes on monitoring charts and attach flag values to product events to learn what a feature actually did.
- Make it a habit with owners. A small dashboard, a few trusted alerts, a monthly hygiene routine and named owners turn charts into safer, simpler software.