Creating Surveys

From Opentaps Wiki
Revision as of 19:45, 5 August 2008 by Sichen (talk | contribs) (Creating a Survey)
Jump to navigationJump to search

What are Surveys?

The content manager's survey function allows you to set up surveys with different types of questions (text, multi-choice, numeric), present or render them to your users, and then collect and view the responses.

Surveys can be used for more than just collecting customer feedback. Because survey responses can be associated with order items, they can be used to collect miscellaneous parameters about customer orders. For example, surveys are used to collect the sender, recipient, recipient email, and gift message on gift cards. Using surveys to collect order information allows you to reuse the survey presentation and collection mechanism. This significantly cuts down on the amount of additional code needed to add more fields for specialized products. It will also allow you to view summary responses of customer orders.

Creating a Survey

Go to the content manager by following http://localhost:8080/content/control/main (It is deliberately commented out in opentaps, but you can also bring it back by uncommenting the webapps in applications/content/ofbiz-component.xml. Click on [Surveys] >> [Create New]

Enter survey name. “Anonymous” means whether a user must be logged in to complete the survey. “Allow Multiple” means whether the same respondent (meaning logged in user) should be allowed to complete the survey several times.

Once created, click on [Questions]. You can apply existing questions from a category by selecting from the drop down. Then click on [Apply] for your individual questions, setting a Seq Number to control the order of them.

Alternatively, you can create the questions. Each question has a Name, a Question which will be shown to the user, and a Hint. The type determines what kind of a question it is. “Text – long” and “Text – short” are text responses. “Selected Options” is a dropdown of responses. “Email Address” is a special type of response that will be validated for being a real email address (someone@somewhere.com)

Associating Surveys with a Store

To associate a survey with a store, go to [Catalog] > [Stores]. Select a store. Click on [Surveys]. Add the survey to the store. “Random Poll” surveys are rotated through the ecommerce application.

If you wish a particular survey to be associated with one product such that the survey will pop up when the user adds the product to his or her cart, then select “Add-To Cart” and supply the product's ID.

The surveyTemplate refers to a file which is used to render the survey. This field must be filed in for the survey to be rendered. Enter the location of the template file, such as applications/ecommerce/templates/survey/minisurvey.ftl. You can use one of the existing template files or create one of your own for a customized look and feel.

Serving Up Surveys

Assuming you've created a survey and then added it to a store in [Catalog] > [Stores] >> [Surveys] or loaded in with a new entry of ProductStoreSurveyAppl, you can view the survey by going to: https://localhost:8443/ecommerce/control/takesurvey?productStoreSurveyId=1003

where productStoreSurveyId is the id of the ProductStoreSurvey you've created. Please note that this page will also display the results of the survey after the user fills it out, which may not be a desired result. Changing the done page is very simple in the controller.xml of the ecommerce application.

The CRM/SFA application also has a survey module which can be used to present surveys. See documentation on the CRM/SFA application.

Viewing Responses

To view responses, go back to [Content] > [Surveys], look up your survey, and click on [Responses].