SetEncryptedPhone

From Barion Documentation
Jump to navigation Jump to search

setEncryptedPhone

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 a phone number 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 phone number, or an improperly hashed phone number throws an error message.

Phone numbers must start with a "+", followed by 4 to 15 numbers.

Trigger

The user clicks on or views a page on a site where a phone number has been entered.

Properties

Not applicable

Sample implementation

Pass the event phone numbers without any formatting, as the user typed them.

bp('identity','setEncryptedPhone', '+36301234567');

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

var hashedPhone = sha1('+36301234567');
bp('identity','setEncryptedPhone', hashedPhone);