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 pass 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 snippet shows the basic integration process in various languages:

rokt.onLoaded(function (rokt) {  const email = "john.smith@rokt.com";  const emailsha256 =    "F6191D8D6A0F75CA7D237ED07CF8E461E72E5C7BB28D611DDF37E5908FDB632B";
  rokt.setAttributes({    // Other Attributes    emailsha256: emailsha256,  });
  rokt.init({    // Rokt Configuration  });
  rokt.onPositiveEngagement(function () {    rokt.setAttributes({      email: email,    });  });});

The above snippet assumes you supply the hashed variant of the email synchronously prior to the initialization of the Rokt object.

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

If you don't have hashed email address readily available, you can use Rokt's hashing function:

rokt.onLoaded(function (rokt) {  const email = "john.smith@rokt.com";  return rokt.hashString(email).then(function (emailsha256) {    // Remaining code unchanged from previous example  });});

If your integration includes more than just hashed email, it’s advisable to use Promise.all() to list all attributes:

<script type="module">  rokt.onLoaded(function (rokt) {    const lastName = "Smith";    const email = "johnsmith@rokt.com";
    return Promise.all([      rokt.hashString(email),      rokt.hashString(lastName),    ]).then(function ([emailsha256, lastNamesha256]) {      rokt.setAttributes({        emailsha256: emailsha256,        lastNamesha256: lastNamesha256,      });
      rokt.init({        // Init Options      });
      rokt.onPositiveEngagement(function () {        rokt.setAttributes({          email: email,          lastName: lastName,          //any other relevant attributes        });      });    });  });</script>
Was this article helpful?