Recording a Brand Conversion
The Rokt SDK for React Native can be executed to record conversion events that occur within your app. These instructions assume that the Rokt SDK for React Native has already been integrated into your application by following steps 1 to 4 here.
Step 5: Import the Rokt SDK into the JS file
Import the Rokt SDK into the JS file:
import { Rokt, RoktEmbeddedView } from "@rokt/react-native-sdk";
Step 6: Execute the Rokt React Native SDK
Execute the SDK at the desired point by passing the appropriate consumer attributes. At this point, a conversion event will be recorded.
Your app dictates which consumer attributes are passed through to Rokt. More information on the data fields that are able to be passed through the SDK can be found under the Attributes section. You can add additional code lines into the below sections containing consumer attributes in order to build up the data package that will be sent through to Rokt.
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.
Note that the Rokt React Native 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.
attributes = {
"email": "j.smith@example.com",
"conversiontype": "appinstall",
"firstname": "Jenny",
"lastname": "Smith",
"mobile": "(323) 867-5309",
"postcode": "90210",
"country": "US"
}
Rokt.execute("RoktConversion", attributes, null, () => console.log("Placement Loaded"));
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.