Why Isn't My Server-side Experiment Counting Visitors?
Work through the usual reasons a server-assigned experiment shows a variant but records no visitors or conversions, from a missing seed to a refused key.
2 min read
Work through these in order. Most of them take a minute to check.
The seed is missing, or comes after the Pertento script
Without window.PertentoSeed before the snippet, the visitor sees the variant your server rendered but is never enrolled. View the page source and check that the seed's script tag is in the head, above the Pertento script. Every page that renders the experiment needs it, including the pages that render control. If only some variants' pages carry it, those arms are counted and the others are not, and the split will look wrong.
The visitor ID is not carried between requests
If your server makes a new visitor ID on each request, every page view is a new visitor, bucketed again. Visitor counts climb, conversions land on unrelated variants, and the split looks random. Store the ID once and send it back every time. See Installing the Pertento server SDK.
Every decision is control
Check decision.reason:
unknown-key: the flag key is spelled differently from the one on the experiment, or the client has no setup yet. Ifready()returnedfalse,pertento.lastErrorsays why.not-running: the experiment has not been started.no-idorwrong-id-kind: no ID was passed, or the experiment buckets on the other kind of ID.targeting: the attributes did not match the rules. Check the names, the values and the types; the text"5"is not the number5. See Attribute rules and bucketing on a customer ID.
The key is refused
A key created moments ago can take about 30 seconds to work, and a revoked key stops within about 30 seconds. After 2 minutes of refusals the SDK stops trying until it is restarted: check the key, or create a new one and restart. Also check that the key belongs to the website in websiteId, because a key for another website gives no setup at all. See Server keys: creating, rotating and revoking.
A change in the dashboard has not arrived yet
Starting, stopping or editing an experiment reaches your servers within about 45 seconds.
Conversions are not recorded
- The website's tracking method is not Server-side, so
track()answerswrong-tracking-method. keysis missing, or lists flag keys this person was never decided on.- The attributes differ from the ones used for the decision.
- The visitor never loaded a page carrying the seed, so there is no visitor for the conversion to count against.
With the tracking method set to Server-side, the browser reports nothing by design, so conversions from pertentoReportConversion no longer appear. See Reporting conversions from your server.