Adding referral survey data to database
Posted: Fri May 06, 2011 12:58 pm
Hello,
My company has made a big marketing push recently and we would like to know what is and isn't working. We figured putting a "Where did you find us" question on the checkout page would be a pretty good metric. However, I'm not exactly sure how to make it work correctly.
Things I know need to be done:
This is my select box to go in OnePageCheckout.aspx. Am I right in thinking this (plus a prompt) is all that needs to be added OPC.aspx?
In OnePageCheckout.aspx.cs, I think I need to add to the CheckedOut() method. I know that "selSurvey.Value" is the data I'm looking for and I can use a switch statement to figure out which database entry to increment, but I don't know how to write that to the database.
I have some experience with using PHP to query mySQl databases, but no experience with using .NET languages to query MSSQL databases.
Am I on the right track? Is there a better way to do this? It looks like AC or .NET has some methods that make database access easier, but I'm not sure how to use them. Any help is appreciated.
My company has made a big marketing push recently and we would like to know what is and isn't working. We figured putting a "Where did you find us" question on the checkout page would be a pretty good metric. However, I'm not exactly sure how to make it work correctly.
Things I know need to be done:
- Create a table in the database to record answers
Put an ASP select box on OPC
Modify .cs file to record survey data to database
Code: Select all
CREATE TABLE SurveyData{
NoAnswer int, LongTimeCust int, SearchEngine int, GoogleAd int, TV int, Radio int, Newspaper int, Friend int}
Code: Select all
<select id="selSurvey" runat="server">
<option value="No">No Answer</option>
<option value="LongTime">I am a long time customer</option>
<option value="Search">Search Engine</option>
<option value="GoogleAd">Google Ad</option>
<option value="TV">TV Commercial</option>
<option value="Radio">Radio Commercial</option>
<option value="Newspaper">Newspaper Ad</option>
<option value="Friend">From a Friend</option>
</select>
I have some experience with using PHP to query mySQl databases, but no experience with using .NET languages to query MSSQL databases.
Am I on the right track? Is there a better way to do this? It looks like AC or .NET has some methods that make database access easier, but I'm not sure how to use them. Any help is appreciated.