Rokt Documentation
  • Documentation
  • User Guide
  • SDK
  • API
  • Third-Party Integrations
  • Help

›Android SDK

Getting Started

  • Introduction

Web SDK

  • Overview
  • Architecture
  • Integrating the Web SDK
  • Integration Examples

    • Confirmation Page Integration
    • Preparative Iframe
    • Page Identifier
    • Single Page Applications
    • Brand Conversion Integration
    • In Transaction/Cart Integration
    • Event-based Integration
    • Sandbox Integration
  • Integration Best Practices
  • Attributes
  • Security
  • Mobile In-App Web Pages
  • API

    • Rokt
    • Attributes
    • CartItem
    • Configuration
    • Placement
    • Subscriber
    • TriggerPageChangeOptions
    • Unsubscriber

iOS SDK

  • Overview
  • Version
  • Integrating the SDK

    • Integrating and Initializing the SDK
    • Launching an Overlay Placement
    • Launching an Embedded Placement
    • Recording a Brand Conversion
    • Sandbox Integration
  • Attributes
  • Security

Android SDK

  • Overview
  • Version
  • Integrating the SDK

    • Integrating and Initializing the SDK
    • Launching an Overlay Placement
    • Launching an Embedded Placement
    • Recording a Brand Conversion
    • Sandbox Integration
  • Attributes
  • Security

React Native SDK

  • Overview
  • Version
  • Integrating the SDK

    • Integrating and Initializing the SDK
    • Launching an Overlay Placement
    • Launching an Embedded Placement
    • Recording a Brand Conversion
    • Sandbox Integration

    Attributes

    • Core Attributes
    • Vertical Attributes
  • Security
Edit

Attributes

Passing data in your Rokt integration is important as the rich, granular data allows for greater campaign optimization, enhanced targeting, personalization capabilities, and spend efficiencies. This also allows conversions to be attributed to the appropriate Rokt campaign with a high degree of accuracy.

You can find the full list of pre-defined Rokt attributes in the sections below, and you can also pass any custom attributes to complement the standard integration.

Core Attributes

NameAttributeFormatPayload Example
Emailemailemailjohn.smith@rokt.com
Email (MD5)emailmd5MD5 hash string238afb9e862add7d56bbc4181b80fa32
Email (SHA256)emailsha256SHA256 hash string
Amountamountamount300.5
Currencycurrency3-letter ISO currency codeUSD
Quantityquantitynumber2
Payment TypepaymenttypestringCredit Card, Paypal
Credit Card BINccbin6 digits372888
Marginmarginamount10.5
Confirmation ReferenceconfirmationrefstringXYZ123
First NamefirstnamenameJohn
Last NamelastnamenameSmith
Mobilemobilemobile format without country code7327572923
TitletitleMr/Mrs/Ms/MissMs
GendergenderM or FF
Date of Birthdobyyyymmdd19831215
Ageageinteger33
Languagelanguage2-letter ISO language codeen, nl, de, fr
Experienceexperiencestring
Unit Numberunitnostring101
Address Line 1address1string123 Fake Street
Address Line 2address2stringBuilding A
ZIP/Postcodezipcodezipcode90210
CitycitystringNew York
StatestatestateNY
Countrycountry2-letter ISO country codeus, au, nz, ca, gb, sg
Conversion Typeconversiontypestring
Rokt Tracking IDrokttrackingidstring

E-commerce/Retail Data

NameAttributeFormatPayload Example
Restaurant IDrestaurantidstring
Deliverydeliveryboolean
Restaurant Namerestaurantnamestring
Delivery/Pick up Addressdeliveryaddressstring
Cuisinecuisinestring
Delivery/Pick up Timedeliverytimetime
Delivery/Pick up Datedeliverydatedate
Restaurant ZIP/Postcoderestaurantzipcodezipcode

Event Ticketing Data

NameAttributeFormatPayload Example
Event NameeventnamestringJohn Smith featuring the Smiths: Live
Event DescriptioneventdescriptionstringThe most incredible show on earth.
Event Timeeventtimetime0800, 1930
Event IDeventidstringE017448281A
Event Dateeventdateyyyymmdd20200822
Event VenueeventvenuestringAustin Big Stadium
Event Cityeventcitystring
Event Stateeventstatestate
Event ZIP/Postcodeeventzipcodezipcode
Event Countryeventcountrycountry
Event Image URLeventimageurl
Event URLeventurlurl
Ticket URLticketurlurl
Number of Ticketsnoticketsnumber
Seat Location(s)seatlocationstring
Seat Numberseatnumbernumber
Primary Artist IDprimaryartistidstring
Primary Artist Nameprimaryartistnamestring
Secondary Artist IDsecondaryartistidstring
Secondary Artist Namesecondaryartistnamestring
Promoterpromoterstring
Promoter IDpromoteridstring
Venue IDvenueidstring
Venue Map URLvenuemapurl

Media and Entertainment

NameAttributeFormatPayload Example
Sectionsectionstring
Section IDsectionidstring
Sub-sectionsubsectionstring
Sub-section IDsubsectionidstring
Author Nameauthorstring
Author IDauthoridstring
Subscribersubscriberstring
Subscription Programsubscriptionstring

Transactional/Purchase Data

NameAttributeFormatPayload Example
Major CategorymajorcatstringElectronics
Major Category IDmajorcatidstringCameras
Minor Categoryminorcatstring10011
Minor Category IDminorcatidstring10
Customer Typecustomertypeguest / member10
Product Name(s)productnamestring
Stock Keeping Unit (SKU)skustring
Shipping Typeshippingtypestring

Travel Data

NameAttributeFormatPayload Example
Number of Passengerspaxnumber
Travel Classtravelclassstring
Trip Typetriptypestring
Routeroutestring
Loyalty Programloyaltyprogramstring
Loyalty Program IDloyaltyprogramidstring
Loyalty Tierloyaltytierstring
Carriercarrierstring
Booked Hotelbookedhotelboolean
Purchased Insurancepurchasedinsuranceboolean
Booked Carcarbookedboolean
Excess Baggageexcessbaggageboolean
Destination Airportdestairportstring
Destination Citydestcitystring
Departure Airportdepartairportstring
Departure Citydepartcitystring
Travel Timetraveltimetime
Travel Datetraveldatedate
Departure Airport ZIP/Postcodedepartairportzipcodezipcode
Check-In URLcheckinurlurl
Ticket URLticketurlurl
Passenger Namepassengernamename

Fulfillment Attributes

Personally Identifiable Information (PII) is often required by Rokt to fulfill campaign goals. For example, a user's email address is considered PII and is essential for Rokt to be able to deliver an email campaign. These pieces of information are known as Fulfillment Attributes. Rokt has designed a ‘2 step data pass’ process that allows for the passing of Fulfillment Attributes to Rokt, whilst ensuring security for the customer and maintaining the quality of their experience.

The process allows for sharing of hashed (SHA256) PII values on the initiation of the integration, with the sharing of raw PII values deferred until after the customer has positively engaged with a Rokt offer. Disclosing hashed values at the initiation of the integration allows Rokt's systems to deliver on some of the expected functionalities (e.g. suppress showing offers to a returning user) while still respecting privacy concerns.

The following code snippet describes basic usage of the 2 step process:

Kotlin

import com.rokt.roktsdk.Widget
import com.rokt.roktsdk.Rokt
  
class ConfirmationActivity : Activity() {  
 
    private val roktCalllback = object : Rokt.RoktCallback {
        override fun onLoad() {
        }
 
        override fun onShouldShowLoadingIndicator() {
        }
 
        override fun onShouldHideLoadingIndicator() {
        }
 
        override fun onUnload(reason: Rokt.UnloadReasons) {
        }
    }
 
    override fun onCreate(savedInstanceState: Bundle?) {      
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)      
        ...
  
        // Include any appropriate consumer attributes
        val attributes = hashMapOf(
            Pair("emailsha256", "36f15652992f5c291ea233b930c8c435ee5a5fb115d25933e3266591d3f92f74"),
            Pair("firstname", "Jenny"),
            Pair("lastname", "Smith"),
            Pair("mobile", "(323) 867-5309"),
            Pair("postcode", "90210"),
            Pair("country", "US")
        )
 
        // Widget placeholder mapping the placeholder view with placement location configuration
        val widget = findViewById<Widget>(R.id.roktWidget)
        val placeHolders = hashMapOf(
            Pair("RoktEmbedded1", WeakReference(widget))
        )
 
        Rokt.execute2Step(pageIdentifier, attributes, this, placeholders, object : Rokt.RoktEventCallback {
                    override fun onEvent(eventType: Rokt.RoktEventType, roktEventHandler: Rokt.RoktEventHandler) {
                        if (eventType == Rokt.RoktEventType.FirstPositiveEngagement) {
                            roktEventHandler.setFulfillmentAttributes(mapOf("email" to "j.smith@example.com"))
                        }
                    }
                })
        ...
    }
}

Java

import com.rokt.roktsdk.Widget;
import com.rokt.roktsdk.Rokt;
  
class ConfirmationActivity : Activity() {  
 
    private Rokt.RoktCallback roktCallback = new Rokt.RoktCallback() {
        @Override
        public void onLoad() {
        }
 
        @Override
        public void onShouldShowLoadingIndicator() {
        }
 
        @Override
        public void onShouldHideLoadingIndicator() {
        }
 
        @Override
        public void onUnload(@NotNull Rokt.UnloadReasons unloadReasons) {
        }
    };
 
    override fun onCreate(savedInstanceState: Bundle?) {      
        super.onCreate(savedInstanceState)      
        ...    
  
        Map<String, String> attributes = new HashMap<String, String>();
 
        attributes.put("emailsha256", "36f15652992f5c291ea233b930c8c435ee5a5fb115d25933e3266591d3f92f74");
        attributes.put("firstname", "Jenny");
        attributes.put("lastname", "Smith");
        attributes.put("mobile", "(323) 867-5309");
        attributes.put("postcode", "90210");
        attributes.put("country", "US");
 
        // Widget placeholder mapping the placeholder view with placement location configuration
        Widget widget = findViewById(R.id.roktWidget);
        Map<String, WeakReference<Widget>> placeHolders = new HashMap<>();
        placeHolders.put("RoktEmbedded1", new WeakReference<>(widget));
        Rokt.INSTANCE.execute2Step("test,", roktCallback, new Rokt.RoktEventCallback() {
            @Override
            public void onEvent(Rokt.RoktEventType roktEventType, Rokt.RoktEventHandler roktEventHandler) {
                Map<String,String> attributes = new HashMap<String, String>();

                attributes.put("email", "j.smith@example.com");
                if (roktEventType == Rokt.RoktEventType.FirstPositiveEngagement){
                    roktEventHandler.setFulfillmentAttributes(attributes);
                }
            }
        });
        ...
    }
}

The above snippet assumes you supply the hashed variant of the email synchronously prior to call execute2step method.

Note: please ensure that the email is lower cased and trimmed of whitespace prior to hashing.

← Sandbox IntegrationSecurity →
  • Core Attributes
  • E-commerce/Retail Data
  • Event Ticketing Data
  • Media and Entertainment
  • Transactional/Purchase Data
  • Travel Data
  • Fulfillment Attributes
RESOURCES
DocumentationUser GuideSDKAPIIntegration PartnersHelp
COMPANY
About UsContact UsCareersEngineering Blog
Rokt Documentation
Copyright © Rokt 2021 - All Rights Reserved