Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io

    Survey Targeting & Display Conditions

    See it in the demo — Target the right users with segments and rules (~60s)

    Show the right survey to the right person

    Survey targeting controls who sees a survey and when. BillDog evaluates every eligibility check server-side inside the bdsurvey-fetch edge function, so the SDK only ever receives a survey it is actually allowed to display. This guide enumerates the real display conditions, audience rules, and sampling controls available in the Survey Builder.

    1. How Eligibility Is Evaluated

    When the SDK requests a survey, bdsurvey-fetch runs a deterministic gauntlet of checks. The first check that fails short-circuits and returns a refusal reason — nothing else is evaluated.

    1

    Collector status & schedule

    If fetched via a collector, it must be active and not type-mismatched. Collector window is checked via opened_at / closed_at (reasons: collector_inactive, collector_not_opened, collector_closed).

    2

    Survey-level quota

    Survey-wide response cap (bdsurvey_quotas). If current_count >= max_responses the survey is withheld (reason: quota_exceeded).

    3

    Survey status

    Survey must have status 'active' (reason: survey_inactive).

    4

    Audience & display conditions

    resolveSurveyEligibility evaluates the targeting rules + display conditions (URL match, feature flag, person/group properties). Failures return the rule's reason.

    5

    Survey scheduling

    scheduled_start / scheduled_end window (reasons: not_started_yet, survey_ended).

    6

    A/B variant assignment

    If the survey is part of a variant_group, a stable hash of the customer/anonymous id picks one variant deterministically.

    7

    Show-once

    If show_once is enabled and this identity already has a completed response, the survey is withheld (reason: already_completed).

    8

    Presentation percentage (sampling)

    A stable 1–100 hash roll on the identity gates a percentage of traffic (reason: presentation_percentage_filtered).

    9

    Per-choice quotas

    Choices whose quota is full with action_on_full = 'hide_option' are stripped from the returned config.

    2. URL / Route Targeting

    The URL match display condition (display_conditions.url_match) restricts a survey to specific routes or screens. Set an operator (dcUrlOperator) and a value (dcUrlValue, e.g. /pricing).

    OperatorBuilder LabelBehavior
    exactExactURL must equal the value exactly.
    containsContainsURL contains the value as a substring (default).
    not_containsDoes not containURL must not contain the value.
    regexRegexURL matches the supplied regular expression.

    3. Audience & Property Targeting

    The Universal Audience Builder attaches a set of targeting rules combined with AND / OR logic. With no rules, everyone is eligible (subject to status, schedule, and sampling). Each rule has one of the following type values:

    segmentSegment

    Membership in a reusable saved segment (in_segment).

    attributeAttribute

    A known person property (e.g. plan, tier).

    custom_attributeCustom Attribute

    A free-form custom attribute key passed by the SDK.

    countryCountry

    Country code from request context.

    platformPlatform

    ios / android / web etc.

    app_versionApp Version

    Host app version (supports version comparisons).

    sdk_versionSDK Version

    BillDog SDK version.

    subscription_statusSubscription

    active, trial, canceled (still paid through the period), grace_period, billing_retry, paused, expired, refunded, access_restricted or none.

    entitlementEntitlement

    Whether the user holds a named entitlement.

    event_fired_in_windowEvent Window

    Whether a named event fired within a time window.

    experiment_variantExperiment Variant

    Assigned variant for a given experiment.

    4. Feature-Flag Targeting

    The feature flag display condition (display_conditions.feature_flag) gates a survey behind a flag. Set the flag key (dcFeatureFlagKey, e.g. my-flag) and, optionally, a required variant (dcFeatureFlagVariant, e.g. control). If the variant is left blank, the survey shows whenever the flag is simply enabled for the user.

    5. Sampling, Frequency & Show-Once

    Even after a user is eligible, you can throttle how often and to what fraction the survey actually appears.

    Presentation percentage presentationPercentage → settings.presentation_percentage

    A 0–100 slider (5% steps). The server hashes the customer/anonymous id into a stable 1–100 roll; if the roll exceeds the percentage, the survey is withheld with reason presentation_percentage_filtered. Because the hash is deterministic per identity, the same user consistently lands in or out of the sample.

    Show once showOnce → settings.show_once

    When enabled, a user who already has a completed response will never be shown the survey again (reason already_completed). The lookup fails safe — a lookup error is treated as "not yet completed" rather than blocking the fetch.

    Wait period waitPeriodDays → settings.wait_period_days

    A cool-down (in days) before a user becomes eligible / re-eligible, governing recurring re-display cadence. Pair with the recurring options (e.g. re-show on every trigger) to control repeat exposure.

    6. Event & Context Triggers

    Surveys are surfaced at known SDK collector contexts rather than from an arbitrary client event. The survey's type aligns the survey to a moment in the user journey:

    exitExit Survey

    Shown as the user leaves a flow (e.g. paywall_exit context).

    post_purchasePost-Purchase

    Shown immediately after a successful purchase.

    onboardingOnboarding

    Shown during the onboarding sequence.

    standaloneStandalone

    Fetched explicitly by the host app on demand.

    npsNPS

    Net Promoter Score prompt.

    csatCSAT

    Customer satisfaction prompt.

    customCustom

    Host-defined surfacing point.

    Was this page helpful?

    Or rate this page:

    We use cookies and process your data to provide our services. By continuing, you agree to our Terms and Privacy Policy.