Skip to main content

Two-step data integration

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 integration process so that you can securely integrate fulfillment attributes to Rokt, ensuring privacy for the customer and maintaining the quality of their experience.

With the two-step data integration process, Rokt uses hashed email address to identify the customer and choose the most relevant experience for them. If the customer positively engages with the Rokt offer, you disclose the attributes needed to fulfill the offer. The two-step data integration process gives an added measure of security to customers while allowing Rokt to deliver on some of the expected functionalities (e.g., suppressing offers for returning customers).

The two-step data integration can be implemented across the Web, iOS, Android, and React Native SDKs. The following code shows the basic integration process in various languages:

const rawAttributes = {
country: "US",
};

const twoStepDataIntegrationAttributes = {
email: "john.smith@rokt.com",
};

const hashedAttributes = await launcher.hashAttributes(
twoStepDataIntegrationAttributes
);

const selection = await launcher.selectPlacements({
attributes: {
...rawAttributes,
...hashedAttributes,
},
});

selection.on("POSITIVE_ENGAGEMENT").subscribe(() => {
selection.setAttributes(twoStepDataIntegrationAttributes);
});

The above code uses the IntegrationLauncher.hashAttributes to hash fulfillment attributes. Rokt recommends the use of this utility method in case additional attributes need to be hashed as well one day or more complex hashing algorithms need to be seemlessly supported.

Should you choose to hash the attributes please ensure that the attribute value is lowercased and trimmed of whitespace prior to hashing and attribute name is postfix with sha256

The below example shows the use of pre-hashed attribute.

const email = "john.smith@rokt.com ";
const emailsha256 =
"F6191D8D6A0F75CA7D237ED07CF8E461E72E5C7BB28D611DDF37E5908FDB632B";

const selection = await launcher.selectPlacements({
attributes: {
country: "US",
emailsha256: emailsha256,
},
});

selection.on("POSITIVE_ENGAGEMENT").subscribe(() => {
selection.setAttributes({
email: email,
});
});
Was this article helpful?