SetEncryptedEmail

From Barion Documentation
Revision as of 10:06, 23 May 2024 by [email protected] (talk | contribs) (fixed title syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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);