SetEncryptedEmail

From Barion Documentation
Jump to navigation Jump to search

setEncryptedEmail

Required event. Handling this event on your Barion shop's screens is required as part of a Barion Full Pixel implementation.

Short description

The event encrypts an email address using SHA-1 that the user entered, to be used as a GDPR-compliant tracker to replace third-party cookies.

Passing the event an empty string, an invalid email address, or an improperly hashed email address throws an error message.

Trigger

The user clicks on or views a page on a site where an email address has been entered.

Properties

Not applicable

Sample implementation

The event accepts lowercase plaintext email addresses only.

bp('identity','setEncryptedEmail', '[email protected]');

The event also accepts a previously SHA-1-encrypted email addresses.

var hashedEmailAddress = sha1('[email protected]');
bp('identity','setEncryptedEmail', hashedEmailAddress);