Skip to main content

Record conversions for advertisers

The Rokt SDK for Flutter can be executed to record conversion events that occur within your app.

Before you begin

Ensure that the Rokt Flutter SDK has been integrated into your application.

Import the SDK

Import the SDK into your application's dart file:

import 'package:rokt_sdk/rokt_sdk.dart';

Execute the SDK

Execute the SDK at the desired point by passing the appropriate consumer attributes. At this point, a conversion event is recorded.

You can choose what customer attributes to include in your Rokt integration. More information on available data fields can be found on the attributes page. If you want to add more attributes, you can add additional lines of code for each new attribute to the samples below.

When recording conversion events, it is recommended that the attribute conversiontype is sent to Rokt with an appropriate value for the conversion that is being recorded.

The Rokt Flutter SDK is also used to integrate Rokt placements into partner applications. There are optional callbacks available in the SDK when displaying Rokt placements. However, as this guide is specifically referring to recording conversion events, these callbacks do not need to be taken into consideration.

void executeRokt() {
// Replace RoktExperience with your viewName
RoktSdk.execute(
viewName: "RoktConversion",
attributes: {"email": "j.smith@example.com",
"conversiontype": "appinstall",
"firstname": "Jenny",
"lastname": "Smith",
"mobile": "(555)867-5309",
"postcode": "90210",
"country": "US"});
}
note

The ViewName (“RoktConversion”) can be modified when executing the SDK in multiple locations in order to display a different experience according to the context of where in the app the SDK is being executed. If modifying the ViewName, please work with the Rokt team to ensure matching adjustments are made within the Rokt System.

Was this article helpful?