By default, respondents can view the merge field data in the survey link. For example, if you use the Contact ID merge field, your respondents can see their Contact ID in the link when they take your survey. Respondents may also be able to manipulate or remove merge fields from your survey link. You can encrypt merge fields to hide personal data from your survey respondents and prevent them from changing the link.
Encrypt your Salesforce merge fields.
GetFeedback Support can’t consult on coding issues. Reach out to your Salesforce administrator for help implementing these features. These examples help you get started with our Salesforce integration and you may need to make changes for your organization.
Create a custom field for encrypted data and an apex trigger to fill the field with merge fields you’d like to include.
Blob key = EncodingUtil.convertFromHex(<encryptionKey>); Blob encrypted = Crypto.encryptWithManagedIV('AES128', key, Blob.valueOf( 'ContactId=&CaseId=&FirstName=' )); String cipherText = EncodingUtil.convertToHex(encrypted); // Store this value in your custom field GF_Encrypted_Data__c |
Make sure to replace the encryption key and merge fields we have in angle brackets with the merge fields that you’d like to collect, using the correct syntax for each. Admins can generate or delete GetFeedback encryption keys in their account settings under Encryption keys. You can create two tokens at a time.
Make sure the encryption key has been added to the trigger code before turning on encryption. If you turn on encryption without adding the key to your trigger code, your survey may break.
To turn on encryption for your survey:
If you’re creating a template to send from Salesforce, copy the survey link to add to your Salesforce email template. If you’re sending your survey using our Salesforce automation, you don’t need to copy the survey link.
To copy your survey link:
You can use this link in the email you create in Salesforce.
Create the email that will go out from Salesforce. If you’re using our Salesforce email automation, we create the Salesforce flow and outbound message for you.
Once you paste your survey link into the email, you can add your encrypted merge fields. You can put a merge field in an email template, custom URL, or formula to incorporate values from a record. A merge field stores information so the link can pull customer information when someone takes your survey.
To add encrypted merge fields, use the code below, replacing the link with your own survey link.
https://www.getfeedback.com/r/xxxxxxxx?gf_data={!GF_Encrypted_Data__c} |
Note that {!GF_Encrypted_Data__c} is the custom field that we just created back in step one.
Once your email is sent, your custom field will then pull in all of your merge fields based on the apex trigger you created. Test your email a few times using real contacts in Salesforce before sending to your larger list.
Make sure to send respondents the encrypted version of your survey link. Otherwise, the survey won’t display.
If you're using a distribution tool other than Salesforce, you may need to write custom code. Please use the encryption libraries available for your platform. You’ll need to: