Skip to main content
All CollectionsSystems and SupportLoop Messaging Integrations
Embedded Data for Web Feedback and Web Messenger Channels
Embedded Data for Web Feedback and Web Messenger Channels

How to embed data within a Loop channel URL

A
Written by Aniko Villeneuve
Updated over 3 years ago

Overview

Additional data can be attached in a Loop channel URL sent to your customers as URL query string parameters. Embedding data into Loop channel URL allows contextualizing the survey response or conversation with data generated outside of Loop, and pre-filling customer information form to reduce survey/conversation drop-off rate. When customers click the URL to respond to a survey or start a conversation, the embedded data is attached to the survey response or the conversation.
โ€‹
Examples of embedded data are:
- Customer Name
- Customer Contact Details
- Customer Loyalty Number
- Customer's Transaction Number
- etc.

Standard URL Parameters

Loop supports the following URL parameters for embedded data by default:

URL Parameter Key

Embedded Data Description

Supported in Web Messenger Channel

Supported in Web Feedback Channel

name

Customer's full name

Yes

Yes

fname

Customer's first name

Yes

Yes

lname

Customer's last name

Yes

Yes

email

Customer's email

Yes

Yes

sms

Customer's phone number

Yes

Yes

survey

Survey id or short code

No

Yes

For Example, if your web feedback channel for a location is https://awwebfeedback.blazeloop.com/locationId, you can embed contact information data using the standard URL query parameters.

Note: all characters in the URL must be in URL-encoded format. (e.g. john.doe@example.com becomes john.doe%40example.com

+16132325532 becomes %2B16132325532 ).

https://awwebfeedback.blazeloop.com/locationId?fname=John&lname=Doe&email=john.doe%40example.com&sms=%2B16132325532

Custom URL Parameters

Should you require custom URL parameters, you must first create a Custom Field entry within the Loop Admin view -> Settings -> Custom Fields. Under the 'Short Code' field, enter the URL parameter key you would like to use when embedding data for this custom field.
โ€‹

For example, if you were to attach the customer's order ID to survey responses, you can create a custom field with the short code orderId. Then you can add orderId=12333 to the URL query string.

https://awwebfeedback.blazeloop.com/locationId?fname=John&lname=Doe&email=john.doe%40example.com&sms=%2B16132325532&orderId=12333

Embedding Encrypted URL Parameters (currently available for Web Messenger channels only)

Sometimes you want to encrypt the URL parameters for better data integrity and privacy, and security. Embedding encrypted data involves the following steps:

1) organize the data in a JSON object. For example:

const userObj = {"fname": "John", "lname": "Doe", "email": "john.doe@example.com", "sms": "+16132325532", "orderId": "12333"}

2) use the aes-256-cbc cryptographic algorithm to encrypt the JSON object. The cryptographic library is available in most runtime environments. For example, in nodejs, you can use the code snippet below.

const crypto = require('crypto');
const cipher = crypto.createCipheriv('aes-256-cbc', KEY, IV);
let encrypted = cipher.update(userObj, 'utf8', 'base64');
encrypted = encrypted + cipher.final('base64');

The KEY and IV required for encryption will be sent to you upon request.

3) encode the encrypted string to a URL-safe 'base64' string

const bufferObj = Buffer.from(encrypted, 'utf8');
const encryptedUrlSafeString = bufferObj.toString('base64');

In this example, the resulting encryptedUrlSafeString should be

eW0yUnNCa01zVEVkdm5pQldmZmt5d2JpZjBjOWl6T1NYNmJtVTJRMjA3cWNaQ2FBQmUzUTVJK2IrazE5UVJBK1RhajgxWVdBSjdWajlnakgvVlBONXFJT2hoYXhHNUdtU2JMajNzVlNSS0hGcU11Z3A0a3g4L3RlTmhYaTN3Y0xxUTNpK29VUGh0bCt2UHBmOEJrRDNnPT0=%

4) append the encryptedUrlSafeString with ?user=[encryptedUrlSafeString] query parameter to the end of the URL. For example:

https://awwebfeedback.blazeloop.com/locationId?user=eW0yUnNCa01zVEVkdm5pQldmZmt5d2JpZjBjOWl6T1NYNmJtVTJRMjA3cWNaQ2FBQmUzUTVJK2IrazE5UVJBK1RhajgxWVdBSjdWajlnakgvVlBONXFJT2hoYXhHNUdtU2JMajNzVlNSS0hGcU11Z3A0a3g4L3RlTmhYaTN3Y0xxUTNpK29VUGh0bCt2UHBmOEJrRDNnPT0=%

Integration Testing

You may want to test the URL with embedded data before deploying your integration code. You may do so using the following test channels in Loop's staging environment.

Web Messenger:

Web Feedback:

Did this answer your question?