If you want to collect responses from your widget in Kameleoon and export them to CSV, the article you are looking for is this one!
What you’ll learn in this article:
- How to configure your Google Sheet to receive survey data
- How to set up the Survey Settings tab in the Widget Studio to send responses to Google Sheets
Configure your Google Sheet
- Go to Google Sheets and create a new spreadsheet.
- Name the tab “Sheet1” (this is the default if your Google account is in English).
- In the first row, define the columns as follows:

Details:
- Column A → Enter “Date”. This will be automatically populated with the date and time of each submission.
- From Column B onward → Enter the name of each survey or form element added to your widget.
You can find the name of the element in the elements tree in the Content tab of the Design section.

When you select an element (e.g., a scale), its name appears at the top of the editing sidebar.

Let’s use this widget as an example:

This widget has 2 survey elements. So in the first row, we should enter:
- Column A → Date
- Column B → Scale
- Column C → Long Answer
4. Add a Google App Script
- Click on Extensions > Apps Script. This will open a new Google Script. Rename it (for example “My form data”).
- Replace all the content in the right side by the following code.
const sheetName = 'Sheet1' const scriptProp = PropertiesService.getScriptProperties() function initialSetup () { const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet() scriptProp.setProperty('key', activeSpreadsheet.getId()) } function doPost (e) { const lock = LockService.getScriptLock() lock.tryLock(10000) try { const doc = SpreadsheetApp.openById(scriptProp.getProperty('key')) const sheet = doc.getSheetByName(sheetName) const headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0] const nextRow = sheet.getLastRow() + 1 const newRow = headers.map(function(header) { return header === 'Date' ? new Date() : e.parameter[header]}) sheet.getRange(nextRow, 1, 1, newRow.length).setValues([newRow]) return ContentService .createTextOutput(JSON.stringify({ 'result': 'success', 'row': nextRow })) .setMimeType(ContentService.MimeType.JSON) } catch (e) { return ContentService .createTextOutput(JSON.stringify({ 'result': 'error', 'error': e })) .setMimeType(ContentService.MimeType.JSON) } finally { lock.releaseLock() } }
Note: If for any reason, you can’t name your tab “Sheet1” as previously mentioned, you should change the first line of the script, and replace ‘Sheet1’ by the name of your tab.
When done, it should look like on the image below.
- Click on the Save project icon (at the left of the Run action)
- In the dropdown at the right of Debug action, select initialSetup (it should be selected by default)
- Click on Run action
You might see a modal asking for permissions. Click Review permissions and continue to the next screen.
Because this script has not been reviewed by Google, it can generate a warning message before you can continue. Click the Go to Mailing List (Unsafe) for the script to have the correct permissions to update your form.
Once correct permissions are given to the script, you should see the following output in the script editor console:
In the left menu, click on the Triggers section (clock icon), to add a trigger for the script
Then, click on the Add trigger button (in the bottom right corner).
In the window that appears, select the following options:
- Choose which function to run:
doPost
- Choose which deployment should run:
Head
- Select event source:
From spreadsheet
- Select event type:
On form submit
Click on Save.
Select the Deploy button and New Deployment from the drop-down.
Click the Select type icon and select Web app.
In the form that appears, select the following options:
- Description:
My Form Data
(This can be anything that you want. Just make it descriptive.) - Web app → Execute As:
Me
- Web app → Who has access:
Anyone
- Then click Deploy.
Be careful! “Who has access:
Anyone
” is mandatory for the correct transmission of results.
Copy the URL (click on the action circled in red on the image).
Configure the Survey Settings in the Widget Studio
- In the Survey Settings tab, select the button that users will click to submit their response.
- Under “How are responses collected?”, choose “HTTP Request (external)”
- Request Name: Give your request a name (e.g., Send data to my Google Sheet)
- Method: Select POST
- Action URL: Paste the URL generated by your Google Apps Script
3. Save your configuration.
Test your setup
- Preview your widget
- Fill out the survey and submit
- Go back to your Google Sheet — you should see a new row with your response!