Flag Analytics in Flagsmith

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

Use

Is it used?

Does any application still ask about this flag, or is it dead weight?

Use

Is it reached?

After a rollout, did the new code path actually receive traffic?

Use

How much?

How many evaluations per day, and how does that grow with your product?

Use

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.

Everyday analogy

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.

i
Tip

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.

The switch

Feature flag

A named switch, with an optional value, whose state lives in Flagsmith instead of your code.

The question

Evaluation

One moment when your application asks “what is the state of this flag?” and gets an answer.

The program

SDK

A software development kit: the small library your application uses to talk to Flagsmith.

The stage

Environment

A separate copy of flag states, such as Development, Staging or Production. Counts are kept per environment.

The user

Identity

Flagsmith’s record of one end user of your product, used for targeting.

The bundle

Batch

A group of counts sent together after a short wait, instead of one message per evaluation.

The slice

Time bucket

A fixed span of time, such as an hour or a day, into which counts are added for a chart.

The metre

API usage

The number of requests your apps make to Flagsmith, which is different from the number of evaluations.

The memory

Cache

A stored recent answer, so the SDK does not ask again. Caches change what is counted.

The bridge

Integration

A connection that sends flag information to another tool, such as an analytics or monitoring service.

The test

Experiment

A planned comparison of two or more versions of a feature to learn which works better.

The leftover

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"]
FIG 1 · The journey of a count: from a question in your app to a chart in the dashboard

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.

Everyday analogy

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.

i
Note

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 measurementQuestion it answersTypical toolRelation to flags
Flag analyticsHow often is each flag asked about?Flagsmith dashboardThe subject itself
Product analyticsWhat do users do, and does it differ by feature?Amplitude, Mixpanel, Segment-like toolsNeeds flag state attached to events
ObservabilityIs the system healthy, fast and error-free?Datadog, Grafana, New Relic-like toolsNeeds flag changes marked on charts
ExperimentationWhich version wins, with statistical confidence?Dedicated experiment toolsUses 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.
Everyday analogy

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.

!
Watch out

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.

MeasureWhat it countsTypical sizeUsed for
EvaluationsQuestions about a flag in your codeVery highFlag usage, clean-up, rollouts
API requestsNetwork calls to FlagsmithLowerPlan limits, capacity, cost
IdentitiesDistinct end users known to FlagsmithVariesTargeting, 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.

Everyday analogy

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.

i
Tip

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

1

The app asks

Code checks a flag through the SDK.

2

The SDK counts

If analytics is on, it adds one to a local tally for that flag.

3

The tally waits

Counts collect for a short interval so one message can carry many.

4

The batch is sent

The SDK posts the tallies to Flagsmith, using the environment key.

5

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
FIG 2 · The path of evaluation data, from a question in the app to a chart in the dashboard

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.
Everyday analogy

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.

i
Note

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

StepWhy
List every application that uses FlagsmithYou cannot judge silence unless you know who might speak
Enable analytics in each SDK configurationEach service reports only if told to
Deploy to a test environment firstCheck counts appear before touching Production
Confirm in the dashboard that counts arriveAn enabled setting is not proof of data
Roll to Production graduallyWatch for any performance side effect
Record which services reportSo 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.

Everyday analogy

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.

!
Watch out

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.

Shape

Flat at zero

No reports. Either unused, or no reporting application is asking.

Shape

Daily wave

Rises in the day and falls at night. Normal for products with human traffic.

Shape

Step up

A new release or audience began evaluating the flag.

Shape

Sudden drop

Code stopped asking, or reporting broke. Investigate both.

Shape

Spiky

Batch jobs, retries or bursty traffic. Compare with the system’s own pattern.

Shape

Weekly rhythm

Quiet weekends, busy weekdays. Typical for business tools.

Everyday analogy

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.

i
Tip

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.

QuestionBest rangeWhy
Did my rollout take effect just now?Last day, fine bucketsYou need minutes and hours
Is this flag in regular use?Last monthWeekly rhythms and rare jobs show up
Is this flag safe to delete?Longest range available, plus checking rare jobsMonthly or yearly tasks hide in short windows
Did traffic change after a release?A week, around the release timeCompare 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"]
FIG 3 · Choosing the right range: the question decides the zoom level
Everyday analogy

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 seeYou may be tempted to sayA safer reading
50,000 evaluations today50,000 people used itCode asked 50,000 times
Evaluations doubledTwice the usersMore traffic, or a new code path asking more often
Zero evaluationsNobody uses itNo reporting application asked in the period
Steady evaluationsThe feature is popularThe flag is being asked about steadily
Everyday analogy

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.

!
Watch out

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

ViewCountsMain audienceMain question
Flag analyticsEvaluations of a particular flagDevelopers, product ownersIs this flag used?
Organisation usageAPI requests across the accountPlatform leads, financeAre 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.

Everyday analogy

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.

i
Tip

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

ModeWhere evaluation happensHow counts arriveCareful about
Client SDKOn the user’s device, from fetched flagsBatches from many devicesClosed browsers, sleeping phones, blockers
Server SDK, remoteFlagsmith answers each requestBatches from serversRequest volume and cost
Server SDK, local evaluationInside your server processBatches from servers, reported by the SDKCheck 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"]
FIG 4 · Three ways an application can evaluate flags, and how each reports to the same charts
Everyday analogy

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.

!
Watch out

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

Loss

Unsent batches

An app that stops suddenly may lose counts it had not yet sent.

Loss

Blocked requests

Browser privacy tools can block analytics calls from client apps.

Delay

Batch interval

The newest minutes are always incomplete.

Gap

Silent apps

Services without analytics enabled never appear.

Blur

Bucketing

Counts are added into slices, so exact moments are hidden.

Blur

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"]
FIG 5 · Near zero is a clue, not a verdict: four checks before calling a flag unused
Everyday analogy

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

KindEvidenceAction
Never evaluatedZero counts since creation; code never shippedAsk the owner; delete if abandoned
Stopped being evaluatedCounts fell to zero after a releaseConfirm code removed; then delete the flag
Fully on for everyoneEvaluated often, always on, no targetingMake behaviour permanent in code; remove flag
Fully off for everyoneEvaluated often, always offRemove the dead branch and the flag
Rare but realOccasional spikes, monthly or yearlyKeep; add a note on its schedule

A clean-up routine

1

List candidates

Sort flags by age and by recent evaluations; note the quiet ones.

2

Check coverage

Confirm every app that could ask reports analytics.

3

Search the code

Find mentions of the flag name across repositories and jobs.

4

Ask the owner

Confirm the purpose is complete and the decision is final.

5

Remove code first

Delete the branches in code, deploy, and watch evaluations fall.

6

Delete the flag last

Only after quiet confirmation, remove the flag from Flagsmith.

Everyday analogy

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.

i
Tip

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

StageExpect on the chartIf not
Code deployed, flag offEvaluations begin, all returning offBuild not live, or code path not reached
Staff onlyEvaluations continue; a few onSegment not matching, or traits missing
Ten per centEvaluations stay steadyA drop suggests errors or a crash on the new path
Fifty per cent, hundred per centEvaluations stay steady or rise with trafficA 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
FIG 6 · Using the evaluation chart as a first check, and monitoring as the final judge
Everyday analogy

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.

!
Watch out

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

Lower

Cache in the SDK

Hold flags for a sensible time instead of fetching often.

Lower

Use local evaluation on servers

Replace per-request calls with periodic downloads.

Lower

Fetch once per session

Avoid re-fetching on every page or screen.

Lower

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.

Everyday analogy

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.

i
Tip

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 integrationExample of purposeBenefit
Monitoring and observabilityMark flag changes on performance chartsSee whether a change coincided with errors or slowness
Product analyticsAttach flag state to user eventsCompare behaviour between variants
Chat and ticketingAnnounce changes to a team channelShared awareness, fewer surprises
Data warehouse or pipelineStore flag events for later analysisLong-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?"]
FIG 7 · Flagsmith as the source of flag facts, and other tools as the place to answer larger questions
Everyday analogy

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.

!
Watch out

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

Way 1

Add it to each event

Your code reads the flag and includes its value as a property on events it sends.

Way 2

Set a user property

Store the flag value on the user’s profile in the analytics tool, once per session.

Way 3

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.

1

Define the question

“Does the new checkout raise completed purchases?”

2

Choose the measure

Completed purchases per visitor, with a clear definition.

3

Split fairly

Use a percentage split rather than hand-picking users.

4

Tag the events

Attach the flag value to every relevant event.

5

Run long enough

Wait for enough users and a full weekly cycle.

6

Compare and decide

Read the difference with caution and agree the next step.

Everyday analogy

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

Trap

Stopping early

Peeking at a promising result and ending the test too soon.

Trap

Too few users

Small groups give noisy results that look like findings.

Trap

Unfair groups

Different kinds of users in each group.

Trap

Too many measures

Checking twenty metrics and celebrating the one that moved.

Trap

Changing mid-test

Editing the percentage or rules while the test runs.

Trap

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.

Everyday analogy

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.

i
Tip

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.

QuestionWhere 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
Everyday analogy

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.

i
Note

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

PanelShowsFor whom
Monthly API requests versus allowanceTrend against plan limitPlatform lead
Requests per active userChattiness of appsPlatform and mobile leads
Top flags by evaluationsWhich flags matter mostEveryone
Flags with zero evaluations for thirty daysClean-up candidatesFlag owners
Flag change events on error chartsCorrelation of changes and troubleOn-call
Age of oldest flagsBacklog of stale flagsEngineering 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.
Everyday analogy

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

Alert

Usage near plan limit

Warn at eighty per cent of the monthly allowance, with time to react.

Alert

Sudden traffic spike

Requests far above normal may reveal a retry loop.

Alert

Critical flag stopped reporting

For a flag that must always be asked about, silence is a signal.

Alert

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"]
FIG 8 · A healthy alert has a threshold, an owner, an action and a review
Everyday analogy

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

1

Week 1: list

Export or view flags sorted by age and by evaluations, and mark candidates.

2

Week 2: confirm

Owners check code and decide: keep, finish or retire.

3

Week 3: remove

Code is cleaned and deployed; flags are made permanent or scheduled for removal.

4

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 typeTypical lifeRetirement trigger
Release flagDays to weeksFeature fully released
Experiment flagWeeksDecision made
Operational kill switchLong-livedComponent retired
Permission or plan flagLong-livedBusiness model changes
Everyday analogy

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.

AspectFlag analyticsAudit log
RecordsHow often a flag was asked aboutWho changed which setting, and when
SourceSDKs in your applicationsActions in the dashboard or API
VolumeLarge, continuousSmall, event-by-event
Typical questionIs this flag used?What changed before the incident?
AccuracyApproximate, aggregatedExact, 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"]
FIG 9 · Two records, one story: what changed, and what the system did next
Everyday analogy

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

Habit

Opaque identifiers

Use internal IDs rather than names or emails as user identifiers.

Habit

Minimal traits

Store only what targeting needs, such as plan tier.

Habit

Check each integration

Know what leaves Flagsmith and who sees it at the destination.

Habit

Limit who can view

Reading analytics and identities is a permission, not a right.

Habit

Respect consent

If your law or policy requires consent for analytics, apply it to flag-related data too.

Habit

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.

Everyday analogy

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.

!
Watch out

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?"]
FIG 10 · A path for finding why a flag chart is empty or odd

Common symptoms and causes

SymptomLikely causeCure
No counts at allAnalytics setting offEnable in the SDK and redeploy
Counts only from some servicesPartial rollout of the settingList services and fix the missing ones
Counts in Staging but not ProductionWrong key or older build in ProductionCheck key and deployed version
Counts dropped after a releaseNew mode, such as local evaluation, without reportingCheck mode-specific analytics setting
Browser users missingBlockers or privacy tools stopping callsAccept partial coverage, rely on server counts
Spike with no explanationRetry loop, test script or botLook at the source and rate-limit
Chart disagrees with another toolDifferent units or time zonesAlign definitions before comparing
Everyday analogy

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.

i
Tip

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.

ANTI-PATTERN 01 · COUNTS AS USERSAvoid
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.

ANTI-PATTERN 02 · DELETE ON ZEROAvoid
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.

ANTI-PATTERN 03 · PARTIAL COVERAGE, FULL CONFIDENCEAvoid
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.

ANTI-PATTERN 04 · THE DASHBOARD NOBODY OPENSAvoid
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.

ANTI-PATTERN 05 · FLAG HOARDINGAvoid
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

ApproachStrengthWeaknessBest for
Flagsmith built-in flag analyticsZero extra tooling; per-flag viewCoarse; limited breakdownsUsage, clean-up, rollout sanity checks
Product analytics with flag propertiesUser-level behaviour by variantNeeds careful tagging of eventsMeasuring feature impact
Observability with flag-change markersLinks changes to errors and speedDoes not count flag usage wellIncident response
Your own logging of flag decisionsExact, under your controlCost, volume, privacy burdenAudited 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.

Everyday analogy

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.

i
Tip

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

1

Enable analytics everywhere early

Turn it on in every SDK from the start, so history exists when you need it.

2

Keep a coverage list

Write down which services and app versions report, and update it.

3

Label every unit

Evaluations, requests and users are different things.

4

Use analytics as a first check, not a final verdict

Pair with error rates, latency and product metrics.

5

Retire flags by evidence

Long range, code search, owner confirmation, then code before flag.

6

Mark flag changes on charts

Use integrations so changes appear beside performance graphs.

7

Review usage monthly

Track requests per user and plan allowance.

8

Set owners and end dates

Every flag has a person and a planned removal date.

Mistakes to catch early

Mistake

Trusting short windows

A week of data hides monthly and seasonal use.

Mistake

Mixing time zones

Comparing a UTC chart with a local-time chart.

Mistake

Forgetting old apps

Ignoring mobile versions that never report.

Mistake

Checking the flag, not the result

A busy flag does not mean a working feature.

Mistake

Changing mode silently

Switching to local evaluation without checking analytics still reports.

Mistake

Over-alerting

Alerts so frequent that people ignore them.

i
Tip

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

DutyOwnerRhythm
Enabling analytics in each serviceThe service’s teamAt creation and on SDK upgrades
Coverage listPlatform leadUpdated when services change
Per-flag clean-upFlag ownerMonthly routine
Usage and plan reviewPlatform lead with financeMonthly
AlertsOn-call leadReviewed quarterly
Privacy review of integrationsSecurity or privacy officerWhen 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.
Everyday analogy

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"]
FIG 11 · A five-step path from simple counts to measured experiments
LevelYou can answerNext step
1Is this flag asked about?List every service and confirm they all report
2Are we within plan, and what is growing?Give each flag an owner and an end date
3Which flags can we safely retire?Connect monitoring to see changes beside errors
4Did a change cause a problem?Attach flag values to product events
5Did the feature help our users?Refine experiments and share the learning
Everyday analogy

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.

i
Tip

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.

1

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.

2

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.

3

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.

4

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.

5

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.

6

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.

7

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.

8

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.

9

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.

i
Note

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.

ShapeFirst suspicionFirst check
Flat after releaseCode not reaching the flagFlag name spelling, build live
Cliff to zeroReporting stoppedRecent changes in SDK mode or version
Rare burstsA periodic jobLonger time range
Regular spikesTimers or scheduled refreshesClient refresh settings
Steps with rolloutCode asks more when feature is onThe feature’s own code
Everyday analogy

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 issueEffect on countsPractical response
App closed quicklyBatches lostUse shorter batch waits or send on background, per SDK guidance
Device offlineCounts delayed or lostAccept partial data; rely on trends
Old app versionsNever report, or ask for old flagsTrack version spread; keep flags until old versions fade
Different SDK versionsDifferent batch behaviourStandardise upgrades
Battery and privacy settingsBackground sends blockedDo 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.

Everyday analogy

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.

!
Watch out

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

Compare

Staging and Production

Are the same flags alive in both? Differences reveal test gaps.

Compare

Before and after a release

Does usage change in the way the release intended?

Compare

Weekday and weekend

Is the rhythm what your users’ behaviour suggests?

Compare

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"]
FIG 12 · Comparing environments: differences between stages point to test gaps or deployment gaps
Everyday analogy

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

ObservationHealthy meaningWorrying meaning
Steady evaluations, always onCode path is live and protectedNone: this is the expected state
Evaluations drop to zeroFeature intentionally removedCode no longer checks the switch; the kill switch is dead
Evaluations continue after switching offCode asks and obeys the answerNone, if the feature stopped
Feature still runs after switching offNoneCaches, 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.

Everyday analogy

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.

i
Tip

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

1

Choose the question

For example, “which flags had zero evaluations for ninety days?”

2

Fetch on a schedule

A small job reads the data through the API, using a limited credential.

3

Store it

Save the daily numbers in a table or a data warehouse, so history is yours.

4

Report

A simple dashboard or email lists candidates and trends.

5

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.
Everyday analogy

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 ofSay
“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.

Habit

One message per chart

A title that states the point: “Checkout flag now reaches all traffic”.

Habit

Plain units

“Checks per day”, not “evaluations per bucket”.

Habit

Before and after

People understand change better than absolute numbers.

Habit

A named next step

End with who will do what by when.

Everyday analogy

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

TechniqueHow it helps
Tag as seasonalFilters them out of automatic clean-up lists
Write the active period in the descriptionNewcomers see the rhythm without guessing
Add a calendar reminderThe team tests the flag before the season begins
Review after each seasonDecide 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
FIG 13 · The yearly cycle of a seasonal flag: quiet, rehearse, launch, review
Everyday analogy

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.

i
Tip

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.

Code habit

One question per decision

Keep counts close to real choices, not to how many times a screen redraws.

Code habit

One name per idea

No duplicates or spelling variants that split counts.

Code habit

Safe defaults

Decide what happens when the answer is not available.

Code habit

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.

Everyday analogy

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

1

What is being counted?

Evaluations, requests or something else? Say the unit aloud.

2

Which environment?

Production and Staging tell different stories.

3

Which time range and zone?

Is the range long enough for rare jobs? Is the zone what you expect?

4

Who reports?

Check the coverage list: which services and app versions send counts.

5

What changed recently?

Releases, SDK upgrades or mode changes can move a line without any user change.

6

What does the audit log say?

Did someone change the flag just before the shape changed?

7

What do other charts say?

Errors, speed and product metrics confirm or contradict the story.

8

Is the newest data complete?

The last few minutes are always thin because of batching.

9

What would prove me wrong?

Name one observation that would change your mind, and look for it.

10

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.

DecisionMinimum evidence
Declare a rollout reached trafficRising evaluations plus steady errors
Retire a flagLong quiet range, full coverage, code search, owner agreement
Claim a feature improved a metricFair split, flag-tagged product events, enough users and time
Change a plan or budgetSeveral months of usage per active user
Blame a flag change for an incidentAudit log time, chart shape and error timing agree
Everyday analogy

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.

i
Tip

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.

Q1What is flag analytics?
It is a count of how often each flag is evaluated by your applications, by environment and over time, reported by SDKs and shown in the dashboard. It tells you whether a flag is used and how its use changes.
Q2Does it turn on automatically?
Usually not. It is a setting in each SDK. If it is off, that application contributes no counts. Check each service, and confirm that data arrives.
Q3What is the difference between an evaluation and an API request?
An evaluation is one question about one flag. An API request is one network call to Flagsmith. One request can supply the data for many evaluations, so evaluations are usually much more numerous.
Q4Does the count equal the number of users?
No. One user can cause many evaluations. To count users, tag your own product events with the flag value and analyse them in product analytics.
Q5Is the data real time?
Close to it, but not exactly. SDKs batch counts and Flagsmith processes them, so the newest minutes are incomplete. Look at older data for firm conclusions.
Q6Is it safe to delete a flag that shows zero evaluations?
Not on that evidence alone. Check the longest range, confirm every application reports, search the code, ask the owner, remove the code first and delete the flag last.
Q7Why do I see counts in Staging but not in Production?
Common causes are a different environment key, an older build in Production without analytics enabled, or network rules blocking the call. Work through the path in Chapter 25.
Q8Does local evaluation still report analytics?
It depends on the SDK and its version. Some report by default and some need a setting. Test with a harmless flag after switching modes.
Q9Can I see which users received which value?
Built-in analytics focuses on evaluation counts. For per-user views, attach the flag value to your own events, or use an integration that sends it to a product analytics tool, where available.
Q10How long is analytics data kept?
Retention depends on your plan and version, and on settings if you self-host. Check your documentation, and export what you need for long-term history.
Q11Does analytics slow my application?
The overhead is normally tiny: a counter in memory and an occasional batch message. Test in busy services before enabling everywhere, and watch for any change.
Q12Can I run an A/B test with Flagsmith alone?
Flags can split users, but reading which version won usually needs product analytics or an experimentation tool. Check what your version and plan offer for experiments.
Q13Can someone fake the counts?
A client-side key is public by nature, so assume anyone could send false counts with it. Use the data as a signal, not as audited evidence.
Q14What is the single best use of flag analytics?
Safe clean-up. Knowing which flags are alive, with evidence over a long window, keeps your code and your dashboard small and reduces the risk of accidents.

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.