Improve your address database management with address hashing
Using address hashing can give you a new level of control over your address database. With this solution, you can create unique identifiers for each email address. The key thing is that you don’t have to share the actual email address with your partners. This is extremely useful for retargeting efforts where we can’t share the email address database. Your address hash gives you the ability to manage your database, edit address characteristics and schedule emails using the appropriate features.
How to generate hash addresses
The process of generating an address hash is simple and intuitive thanks to the functions available in SARE. Under ADDRESSES → BASE STRUCTURE → ADDRESS HASH, you can specify the so-called key (salt), based on which the hash will be generated. After saving your settings, your hash will be created. Remember, however, that if hashes have been generated before, entering a new key value will generate the hashes again.
Writing values to the base
Although the hash value is stored in the database, it is not directly visible from the system interface. However, you can retrieve its value as for other address features – using the get_val() function. You can additionally store the retrieved value to any other feature. Here’s how to do it:
- Open SAREscript and select the entire base as the context
- In the editor box, type the following script, entering the name of the feature:
$hash=get_val('hash'); set_val('moja_cecha', $hash);
- See http://dev.sare.pl/sare script/funkcje-sarescript/set_val/ for more information on the get_val function
- Change ‘my_trait’ to the trait to which you want to save the hash information
- After setting up the script, just click the run option – the feature will add itself to each address
Display with SAREscript
With SAREscript, you can generate a hash for a specific email address. This function is especially useful when you want to check whether the hash stored in the database and the one dynamically created have the same value. This can be done using the md5(string) function. For example, the function that will display the hash for the address cs@sare.pl using the key ‘123key’ looks like this:
print(md5('123klucz'.get_val('email'));