Rollout

Roll out new feature code gradually, with reduced risk

Rollout is an Experience OS app that enables you to release new features gradually, to reduce risk. Campaigns are targeted to a limited number of site visitors: If issues come up, you can roll back the campaign without redeploying. Contact your account team to install Rollout.

How it works

When you deploy code for a new feature, wrap it with a feature flag. Your team then creates a campaign in the Rollout app for the new feature, and sets a percentage of visitors who are in the rollout group. Until the feature is fully deployed, some visitors included in the rollout are assigned to a control group, for testing, and they don't see the new content.

If all goes well, the number of visitors who get the new feature is gradually increased, until full deployment (100% of users get the new feature).

📌

Remember: Rollout campaigns are meant to be temporary. When your feature is fully deployed and you're confident in its release, remove the feature flag from your code, then archive or delete the campaign.

The Rollout campaign is similar to the Experience Web Custom Code campaign, with the Rollout selector included in the Choose call. The Choose call's response then includes the flag’s state relevant to each user.

  • If the user is in the test, and should receive the test variation: The property is rollout_flag = 'true' (the flag is turned on for this user).
  • If the user is in the test, but should receive the control variation: The property is rollout_flag = 'false' (the flag is turned off for this user).
  • If the user isn't in the test, this property returns empty.

👍

Tips for optimizing your Choose call performance:

  • Use selector groups. A selector group enables you to fetch the statuses of all relevant campaigns upon the session's first page view. We recommend that you cache all flag statuses for the remainder of the session if they're not intended to change during the session. This eliminates firing an API call on every page view.
  • We recommend using only 1 Rollout selector group per Choose call.
  • Don't mix campaign types. Include only Rollout campaigns in a single Choose request.

Sample Choose call for a Rollout campaign

{
    "user": {
        "dyid": "3409225164475419889",
        "dyid_server": "3409225164475419889"
    },
    "session": {
        "dy": "2caf17bcabe3acdd12e042386ffb62c3"
    },
    "selector": {
        "names": [
            "rollout"
        ]
    },
    "context": {
        "listedItems": ["123","abc","abc","abc"],
        "page": {
            "type": "PRODUCT",
            "data": [
                "1217317-410"
            ],
            "location": "spa-test-site.local.dy.dev/?sectionId=225588",
            "lng": "en_gb"
        },
        "device": {
            "dateTime": "2023-08-06T14:00:00.000-00:00",
            "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1",
            "ip": "109.255.255.255"
        }
    },
    "options": {
        "isImplicitPageview": true
    }
}

Sample response with rollout flags

{
    "choices": [
        {
            "id": 1239291,
            "name": "Rollout",
            "type": "DECISION",
            "variations": [
                {
                    "id": 29924511,
                    "payload": {
                        "type": "CUSTOM_JSON"
                    },
                    "rollout_flag": true
                }
            ],
            "groups": [],
            "decisionId": "nLM0OTU5ODQ0NzQwOTg5NTEwOTM3zgAgl7yoMTQzNDYwNDMBkJHOAcicn6UzMzE3N8DAszMxMjUxMTMwOTQ3MzkxMzQ4NjTAwA=="
        }
    ],
    "cookies": [
        {
            "name": "_dyid_server",
            "value": "8511803537980494299",
            "maxAge": "31556926"
        },
        {
            "name": "_dyjsession",
            "value": "tqx788wwgdteimkjgjvs8smo5pb7lp7q",
            "maxAge": "1800"
        }
    ]
}