Skip to main content

Record conversions for advertisers

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

Before you begin

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

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.


RoktSDK.execute(
"RoktConversion",
{
"email" : "j.smith@example.com",
"firstname": "Ginger",
"lastname": "Smith",
"mobile": "(555)867-5309",
"postcode": "90210",
"country": "US"
},
function(msg) {
console.log(msg);

// msg can be any of these
// 1. onLoad - your placement loads
// 2. onUnload - your placement unloads
// 3. onShouldHideLoadingIndicator - hook to show a loading indicator
// 4. onShouldShowLoadingIndicator - hook to hide a loading indicator
},
function(err) {
console.log(err);
}
);
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?