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

›React Native 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
  • Security
Edit

Attributes

Rich, granular data allows for greater campaign optimization, enhanced targeting, better personalization capabilities, and higher spend efficiencies. For brands, more data also helps conversions to be more accurately attributed to the appropriate Rokt campaigns.

You can find the full list of predefined Rokt attributes in the sections below. You can also define 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 or postal codezipcodezipcode90210
CitycitystringNew York
StatestatestateNY
Countrycountry2-letter ISO country codeus, au, nz, ca, gb, sg
Conversion typeconversiontypestring
Rokt Tracking IDrokttrackingidstring

Food and beverage retail data

NameAttributeFormat
Restaurant IDrestaurantidstring
Deliverydeliveryboolean
Restaurant namerestaurantnamestring
Delivery/pick-up addressdeliveryaddressstring
Cuisinecuisinestring
Delivery/pick-up timedeliverytimetime
Delivery/pick-up datedeliverydatedate
Restaurant ZIP or postal coderestaurantzipcodezipcode

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 or postal codeeventzipcodezipcode
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 data

NameAttributeFormat
Sectionsectionstring
Section IDsectionidstring
Subsectionsubsectionstring
Subsection 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

NameAttributeFormat
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 or postal codedepartairportzipcodezipcode
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 customer's email address is considered PII and is essential for Rokt to deliver an email campaign. These pieces of information are known as fulfillment attributes. Rokt has designed a two-step data pass process so that you can safely pass fulfillment attributes to Rokt, ensuring security for the customer and maintaining the quality of their experience.

With the two-step data pass process, you can share hashed (SHA256) PII when the integration initiates. Then, once the customer has positively engaged and opted in to the Rokt offer, you share the raw PII. Disclosing hashed values at the initiation of the integration allows Rokt's systems to deliver on some of the expected functionalities (e.g., suppressing offers for returning customers) while still respecting privacy concerns.

The following code snippet shows basic integration of the two-step process:

import {
    Rokt,
    RoktEventManager
}
from "@rokt/react-native-sdk";

const roktEventManager = new NativeEventEmitter(RoktEventManager);

//Subscribe to FirstPositiveResponse event. 
subscription = roktEventManager.addListener(
    'FirstPositiveResponse',
    (x) => {
        console.log("Widget OnFirstPositiveEvent Callback");
        
        // Send unhashed email on first positive response

        fullfilmentAttributes = {
            email: "j.smith@example.com"
        };
        Rokt.setFulfillmentAttributes(fullfilmentAttributes);
    }
);

onExecuteHandler = () => {
    attributes = {
        "emailsha256": "238afb9e862add7d56bbc4181b80fa32",
        "firstname": "Jenny",
        "lastname": "Smith",
        "mobile": "(323) 867-5309",
        "postcode": "90210",
        "country": "US"
    };

    Rokt.execute2Step("RoktExperience", attributes, null, () => console.log("Placement Loaded"));
}

// Remove subscription 
componentWillUnmount() {
    this.subscription.remove();
}

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

Ensure that the email is lowercased and trimmed of whitespace prior to hashing.

Additional encryption of PII in transit

Rokt values the security of your customers' personally identifiable information (PII) and utilizes best-in-class approaches in protecting it. We exclusively use the HTTPS protocol to communicate between the client application and the Rokt servers. HTTPS provides security by directing the protocol over a Transportation Layer Security (TLS) connection and ensuring the authenticity of all requests and responses, protecting the privacy and integrity of the exchanged data while in transit.

If you want an extra layer of security on your customers' PII, you can choose to encrypt the data prior to transfer, and Rokt can decrypt it on receipt.

Note: The encryption of PII is an advanced integration method and requires working collaboratively with the Rokt development team during implementation. It is more effort than a standard Rokt integration for your development team, including ongoing maintenance (e.g., yearly key rotation).

Overview

Rokt supports asymmetric key encryption (RSA/ECB/OAEPWithSHA-256AndMGF1Padding) for four data attributes designated as PII (first name, last name, email, and phone number).

You need to encrypt each attribute individually and transfer the encrypted values to Rokt, along with the Key ID referencing which encryption key is in use, and any non-PII attributes without encryption.

Rokt receives the encrypted data and decrypts it before sending the decrypted values back to the client. Rokt uses this in messaging presented to the customer to improve relevance, personalization, and performance.

Getting started

To get started, contact your Rokt account manager who can start the conversation between your development team and the Rokt development team.

Rokt generates and distributes the public/private key pairing. Together we will agree on the definition of the Key ID. You can indicate if you want the keys distributed in a particular way. Please provide the technology you use for your backend and frontend (e.g., Javascript) so that Rokt can test the encryption and decryption process prior to sending.

Implementation

Make a change to the standard Rokt PII attributes found in the Rokt Tag by adding Enc to the following key/value pairs:

  • firstname
  • lastname
  • email
  • mobile

So the encrypted attributes would be:

  • firstNameEnc
  • lastNameEnc
  • emailEnc
  • mobileEnc

All other attributes should remain the same, as specified in the standard documentation or by your account manager. You should not attempt to encrypt any other attribute besides the four mentioned.

For each request/initialization:

  • Use your public key to encrypt each PII attribute value individually
  • Base64 encode each encrypted value
  • Send the following to Rokt:
    • Encrypted (and encoded) values with the above keys
    • Non-PII key/value pairs as plain text
    • Key ID for Rokt to identify the correct key for decryption

When you are ready, contact the Rokt team so that we can verify your implementation.

For more information, see our React Native encryption example.

Key rotation

Rokt supports key rotation on a yearly basis (or longer). Key rotation will need to be manually coordinated.

← Sandbox integrationSecurity →
  • Core attributes
  • Food and beverage retail data
  • Event ticketing data
  • Media and entertainment data
  • Transactional/purchase Data
  • Travel data
  • Fulfillment attributes
  • Additional encryption of PII in transit
    • Overview
    • Getting started
    • Implementation
    • Key rotation
RESOURCES
DocumentationUser GuideSDKAPIIntegration PartnersHelp
COMPANY
About UsContact UsCareersEngineering Blog
Rokt Documentation
Copyright © Rokt 2021 - All Rights Reserved