Hashing

Hashing is a good way to protect sensitive identifiers at third parties. Hashing should not be confused with encrypting. Hashing is one way, which means you cannot go back from a hash, where encrypting is two way. When you have the key, you can decrypt the encoded message.

This makes hashing valuable for storing sensitive information, since the third party cannot retrieve the actual information. Even though you trust the third party, the third party might be compromised and sensitive information we stored at the third party might be stolen. If it hashed, the thief would have a hard time to create value from the hashed information.

We recommend to always hash personal identifiable information, such as email addresses, customer IDs, or other identifiers.

Harvest even has a SHA256 hashing function build in. For more information about how to use the hashing function, read the harvest.hashSha256 documentation.

Email hashing

By default, Harvest Collect hashes the email property. This will help you to easily use the userData.hashedEmail property. An example of how to use the default email property is as follows:

harvest.trackEvent({
    "event":"pageview",
    "data": {
        "email":"test@test.nl"
    }
});

The example above shows a pageview where we know the user’s email. The resulting final event will contain the hashed email in the property userData.hashedEmail.