Survey Expert Ryan Farmer observes that many well-known companies aren’t branding their surveys, and discusses why survey design is hyper-important when you want to gather customer feedback.
Table of Contents
Integration: Adding Subscribers in CampaignMonitor
Please Note:This is a tutorial for SurveyGizmo 2.0 users. We will be updating this for SurveyGizmo 3.0 users ASAP
The following tutorial uses the HTTP POST action, a feature of the Enterprise level account
CampaignMonitor is an email marketing company targeting designers, and SurveyGizmo uses them for our webinar announcement email blasts every few months. When you sign-up for a webinar or create an account on SurveyGizmo, we give you the opportunity to opt-in to the list for these emails with a checkbox incorporated into the survey itself. The feature works because SurveyGizmo’s HTTP POST action is combined with CampaignMonitor’s API to receive this data. Let’s get started!
Items Needed to Continue
- A SurveyGizmo Enterprise account
- A survey that collects an email address (required) and name (optional)
- A CampaignMonitor account
- Your CampaignMonitor API Key
- You can find your unique API key under Account Details in your Account Settings.
- Your CampaignMonitor Subscriber List ID
- You can find the API Subscriber List ID under ‘edit list name/type’ on the Subscriber List page under Manage Subscribers. It’s the link next to the list name at the top.
Creating the Checkbox Opt-In Question
Per CampaignMonitor’s rules, the user MUST opt-in to the list, thus the checkbox question must be included in the survey!
Click ‘Add Question’ on the page of your survey that will have the opt-in checkbox on it. Select the ‘checkbox’ question type, and either add in your question title or enter a ‘space’ into the question title box if you wish to exclude the question title and have an independent checkbox. For the options, a sample entry would be, “Yes, I would like to subscribe to your email newsletter | 1″.

What’s that funny | symbol after ‘newsletter’?
That is the pipe symbol, found just above the enter/return key on most keyboards. Within this screen in SurveyGizmo, it allows you to specify the option title and the reporting value without editing the question twice. In the above sample, 1 is the reporting value.

At the bottom of the page, select ‘Adv. edit options for this question.’ and then click ‘Add Question’. Scroll down to the Advanced Formatting section and find the section for Question Numbering. Check the box to, “Skip numbering for this question.” and then Save Changes to the question.
Creating the HTTP POST Action
On a later page (typically the Thank You page) of the survey, click Add Action and select the HTTP Post action. Give it the name “Campaign Monitor” and click ‘Add Action’. You will need to setup three areas of the action.
URL to Post to
The URL to Post to should be set to ‘http://’ and insert the following url:
api.createsend.com/api/api.asmx/Subscriber.Add
Fields To Post
This section should include the first 4 rows and needs to have all of the following Variable Names on each row exactly:
- ApiKey
- ListID
- Name
The ApiKey row needs to include in the Default Value field your API key from CampaignMonitor.
The ListID row needs to include in the Default Value field your Subscriber List ID from CampaignMonitor. Note, that is a capital ‘id’, not LD.
In the Email row, select from the left drop-down the question which includes the user’s email address.
For the Name row, if you have requested this in the survey, you can choose the question from the drop-down on the left. However, if you do not have a name, you can leave the Default Value and the Question to Send drop-down alone and send only the Default Value.

Advanced Options: Run When
Scroll down to the Advanced Options section and Open the bar by clicking on it if necessary. You will want to ensure that the setting for, “Run Http Query by Default?” is set to ‘Yes’. On the next line, the Run When rule, choose the checkbox question you created earlier from the drop-down list. If you did not include a question title, it will display only ‘##:’ where ## is the question number in the system. Once selected, enter the following exactly in the equals textbox:
/1/

This code will check the question for whether the reporting value ’1′ was checked, and if so, allow the HTTP POST to transmit. Remember, we created the checkbox question to have an option title that was descriptive for the respondent, but the survey saved the reporting value as ’1′. Finally, click Save Changes to complete the configuration.
At this point, you have completed the configuration for transmitting the email address of your respondent (and their name if applicable) to CampaignMonitor if they choose to opt-in. The following section includes an advanced configuration for this feature, but is completely optional.
Advanced Configurations
The following example will add a Hidden Value action and Custom Scripting action to your survey to combine two separate fields within your survey that include the user’s first and last name into a single field, for use with the CampaignMonitor HTTP POST. Since CampaignMonitor has a single ‘Name’ field, you need to combine these within SurveyGizmo and save it in a Hidden Value action so it can be accessed by the HTTP POST action.
On the same page of your survey as the checkbox opt-in question, click Add Action and choose Hidden Value. Name this field ‘First and Last Name’ and click ‘Add Action’. On the following page, you will be leaving the Value section blank and saving the action. The system will warn you that there is no Value, however simply click OK and continue with the save. You will need to note the Question ID for this hidden value action. To get the Question ID, hover over the ‘advanced edit’ notepad icon and note the URL in the status bar of your browser. In the URL, you will see ‘qid=##’, where ## is the Question ID of the Hidden Value action.
On the Thank You page of the survey, or the page that includes the HTTP POST, add a Custom Scripting Control action to the page, and make sure your reorder the action to the very top of the page, notably above the HTTP POST. Prior to adding the following script in the scripting control action Script Code box, make sure that you have the Question IDs for the textboxes that have the first name and the last name of the respondent. If the fields are part of a contact group, you will be clicking ‘Advanced Edit’ (notepad icon) on the contact group, then click ‘advanced’ next to the appropriate field to bring up the advanced editor for an individual field within the group. The Question ID will be listed to the right of the question editor.
Within the Script Code box of the Custom Script, add the following code:
%%fname = sgapiGetValue(3); %%lname = sgapiGetValue(4); %%name = %%fname.' '.%%lname; sgapiSetValue(59,%%name);
In the above script, you must change the numeric values to match the Question ID’s you collected previously. The number 3 should be replaced with the Question ID for the first name field in your survey. The number 4 should be replaced with the Question ID for the last name field in your survey. Finally, the number 59 should be replaced with the Hidden Value field’s Question ID.
Thanks again to CampaignMonitor.com for an excellent API, allowing easy integration with a powerful survey tool. If you are involved with a company that can accept an HTTP POST and would benefit from an integration tutorial with SurveyGizmo, please contact us with your sales question and we would be happy to discuss it further.