This site requires cookies to function and by using this site you are consenting to the acceptance of cookies. To find out more details on how and why we use cookies please view our Privacy Statement. Tick this box to clear this message
Survey Galaxy | Application Interface
Home Page The members area is for registered users to create and publish their own online  surveys Information on Survey Galaxy
 
Survey Galaxy Application Interface for IIS

Survey Galaxy has constructed an application interface for its customers in order to facilitate some advanced features, see Features Section below.


Requirements
  • Windows Server 2000 or greater
  • Microsoft IIS Web Server V4.0 or greater
  • Active Server Pages (ASP) with VbScript
  • Any ODBC datasource

The Application Interface is a dynamic link library (DLL) that needs to be installed on the users web server


Automatic Installation

This installation will automatically install the Survey Galaxy Application Interface in the Program Files folder on the C: drive and then register the dll. If you wish to install the application at a different location please follow the instructions for Manual Installation.

This is a task that needs to be carried out by the system administrator.

  1. Click Here to download the installation Zip file or, if you do not have a Zip application, Click Here to download a self extracting Zip file.
  2. Open the install file and execute the installation program install.exe by either:-
    • Clicking on the CheckOut button on the WinZip toolbar then double clicking on the file install.exe that is listed in the CheckOut folder
    • Extracting the files to a temporary folder then double clicking on the file install.exe


Manual Installation

This is a task that needs to be carried out by the system administrator.

  1. Click Here to download the installation Zip file or, if you do not have a Zip application, Click Here to download a self extracting Zip file.
  2. Create the folder "<program files>Survey Galaxy"
  3. From the installation zip file, copy the file surveyGalaxyInterface.dll into the folder <program files>Survey Galaxy
  4. Open a DOS command window by selecting Start, Run "cmd"
  5. From the DOS window, register the dll by typing regsvr32 <program files>Survey Galaxy\surveyGalaxyInterface.dll at the prompt.


Un-Installation

A procedure to uninstall the application and remove all installed files is provided with the installation package and can be found both in the installation zip file and in the program installation folder <Program Files>Survey Galaxy\uninstall.bat.


1. Integration of Survey Galaxy surveys to External Websites

It is sometimes the case that a Survey Galaxy user has its own database of people to whom it wishes to invite to participate in a survey and the ideal scenario would be to automatically link these people to their survey responses. The Survey Galaxy Interface provides a secure mechanism to achieve this.

It is assumed that you have a website running which links to your user database and that users are identified using a logon & password verification procedure. Once logged on, their database user id is available in session variables and can be used in the construction of the links to the surveys you wish them to undertake.

If you are familiar with having published a survey then you may recognise the following URL that people are provided with in order to carry out the survey.

http://www.surveygalaxy.com/surPublishes.asp?k=XXXXXXX

Where XXXXXXX = the reference of the survey.

To achieve the integration we have added an additional parameter r to which you need to assign your user id. Thus, the URL becomes:

http://www.surveygalaxy.com/surPublishes.asp?k=XXXXXXX&r=8888

Where 8888 = the id of the person carrying out the survey, however, for security reasons the number is encoded. The encoding is achieved using a function from the Application Interface.

The user id passed in the variable r will be received by Survey Galaxy, decoded and recorded in the database in the Capture Reference field. This is included in the Detailed Result data that you can import back into your own database and then 'join' with. i.e. your user id is returned in its un-encoded form.

The survey publisher will be able to view & edit each user responses using the Input Operator facility.

Example 1 - Adding a link to the survey onto your website
The following example demonstrates how to set up a link on your own website that your users can click on to carry out the surveys you have published.

1. Determine value of encoded user id
This VbScript code segment will convert your user id into an encoded value that will be recognised by Survey Galaxy. This is stored in the variable secureUserId for later use.

This code should be inserted in the initialisation section of your web page.

<%
dim userId
dim SGObject
dim secureUserId

' get the ID of the user from the session data store
userId = session("userId")

' load the Survey Galaxy application interface
set SGObject = server.createobject("surveyGalaxyInterface.encoding")

' encode the local key into a secure key for Survey Galaxy
secureUserId = SGObject.encodeUserId (userId)
%>

2a. Launch the survey in a new window
This HTML code segment demonstrates how to define a link that launches the website in a new window which shows a URL relating to your website, not Survey Galaxy.

This should be inserted into the main body of your web page.

<a href="TakeTheSurvey.asp?k=EH0TIWJTUFKG&r=<%= secureUserId %> target="_blank">TAKE THE STORE SURVEY! </a>

<a href="TakeTheSurvey.asp?k=EH0TIWJTUFKG&r=<%= secureUserId %> target="_blank">RATE THIS WEBSITE! </a>

Or...

2b. Launch the survey embedded within your own web page.
This HTML code segment demonstrates how to define a link that launches the website within a pre-defined area of your own website.

This should be inserted into the main body of your web page.

<iframe id="survey" name="survey" src="http://www.surveygalaxy.com/surPublishes.asp?k=EH0TIWJTUFKG&r=<%= secureUserId %>" height="500" width="680" frameborder="0" scrolling="auto" style="overflow-x: hidden;"></iframe>

Example 2 - Survey Frame TakeTheSurvey.asp
If you have used option 2a above then you will also have to create the following file on your website, named TakeTheSurvey.asp

The page sets up a frame that links to the survey publication which is hosted on the Survey Galaxy website. This technique hides any reference to Survey Galaxy and will make the survey appear is if it is running on your own website.
<!-- frames -->
<frameset rows="100%" cols="100%">
<frame name="Survey" src="http://www.surveygalaxy.com/surPublishes.asp?k=<%= request("k") %>&r=<%= request("r") %>" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
</frameset>

Example 3 - Using your web server to despatch invitations
This example demonstrates how you can use your web server to generate personalised emails from your user database which can contain a direct link to carry out your survey. It is necessary to generate the email in this way as it needs to contain the encoded user id within the link.

The example utilises the CDONTS facility and a typical generic ODBC datasource. CDONTS is a component of IIS operating on a Windows Server platform.

1. Query the database to generate emails

This VbScript code segment could be inserted into an existing page or form the basis of a new page. It is important that it should only be executed as a privileged site administrators option.

It will be necessary to tailor the VbScript to conform to your database connectivity & design requirements and mail server configuration. It may require enhancement to include record filtering and confirmation controls.

The email message can be changed into HTML format allowing you to add images and apply styles thereby giving you a more professional presentation, but you should bear in mind that not all people are able to accept HTML emails.

<%
dim userId
dim SGObject
dim secureUserId
dim dbConn
dim recordSet
dim mailCDO

' load the Survey Galaxy application interface
set SGObject = server.createobject("surveyGalaxyInterface.encoding")

' connect to datasource
set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open "DSN=myData"

' establish data stream
Set recordSet = Server.CreateObject("ADODB.RecordSet")
recordSet.Open "select * from users", dbconn, 3

do while not recordSet.eof

   ' encode the local key into a secure key for Survey Galaxy
   secureUserId = SGObject.encodeUserId (recordSet("Id"))

    'Contruct email
    set mailCDO = Server.CreateObject("CDONTS.NewMail")

    mailCDO.TO = recordSet("email")
    mailCDO.FROM = "webmaster@domain.com"
    mailCDO.SUBJECT = "Shopper Survey!"
    mailCDO.BODY = "Dear " & recordSet("forename") & vbCrLf & vbCrLf &_
    "Please click on the following link to carry out our latest shopper survey --> " & vbCrLf & vbCrLf &_
    "http://www.domain.com/TakeTheSurvey.asp?survey_id=1140&r=" & secureUserId

    ' send it
    mailCDO.SEND
    call emailSender (rsUsers, "Subject", "", "to", "", "", mailBody, "", "")

    recordSet.movenext

loop

recordSet.close
set recordSet = nothing

set dbConn = nothing
%>

Terms of Use
The terms of use of the Application Interface and the sample code show in this guide are described under the general Survey Galaxy terms & conditions and that by downloading and implementing the Application Interface you consent to be bound by those terms and conditions.


 

Survey Galaxy | Application Interface 18-Dec-2018 19:50