Skip to main content

Sandbox integration

With a sandbox integration, you can pass a configuration flag to test against a sandbox environment. The sandbox environment follows a normal offers, bidding, and matching process against your production configuration. While a sandbox environment is part of the Rokt production environment, it does not charge advertisers or generate revenue. As a result, you can use it for acceptance testing before deploying to production.

The integration follows exactly the same steps as in previous examples, with an additional sandbox attribute required to be passed to the execute function.

Execute placement example#

To run an overlay placement in the sandbox environment, the list of attributes passed to Rokt needs to be updated to include "sandbox": "true". This can be done by updating the code from the example in the launching an overlay placement documentation to include the following:

import 'package:rokt_sdk/rokt_sdk.dart';
void executeRokt() {    // Replace RoktExperience with your viewName    RoktSdk.execute(                    viewName: "RoktExperience",                    attributes: {"email": "",                        "firstname": "Jenny",                        "lastname": "Smith",                        "mobile": "(555)867-5309",                        "postcode": "90210",                        "country": "US"},                    onLoad: () {                        // Optional callback for when the Rokt placement loads                    },                    onUnLoad: () {                        // Optional callback for when the Rokt placement unloads                    },                    onShouldShowLoadingIndicator: () {                        // Optional callback to show a loading indicator                    },                    onShouldHideLoadingIndicator: () {                        // Optional callback to hide a loading indicator                    });}
Was this article helpful?