Solved

Tracking specific search criteria used in search form and passed to dynamic page with cfquery

Posted on 2011-02-24
4
418 Views
Last Modified: 2013-12-24
Hello Experts,

I have been running the same search form for years, passing search criteria to a dynamic results cfm page that uses cfquery to display the results. I had someone ask if we are able to track the search terms used in order to determine which search criteria is most common. The search form page is a restaurant search whereby a visitor can select 1 of 4 options: cuisine, location, price or restaurant name. They specifically wanted to know which cuisine search was used most often. My form page passes the search criteria to the results page "internally", rather than within variable URLs, so I am not sure that this is possible. While I can certainly view the statistics within my stats software for the results page, there is no breakdown, as far as what people searched for, when bringing up this page. In general, the process is:

index.cfm -- search form page:

<FORM ACTION="diningresults.cfm" METHOD="POST">
--select cuisine from dropdown list OR
--select location from dropdown list OR
--select price range from dropdown list OR
--enter restaurant name keywords

SUBMIT search...

diningresults.cfm:

<CFIF busname IS NOT "">
  <CFOUTPUT QUERY results...
<CFIF cuisine IS NOT "">
  <CFOUTPUT QUERY results...

...etc.

So, because only the page "diningresults.cfm" is called, is there any way to track what search criteria was used? If so, could someone share how I might go about doing that? I'm thinking I would need to modify things to pass variables via the URL; i.e. "diningresults.cfm?cuisine=#cuisine#" or something like that? Or do I actually need to track something within the Access database itself? Or, am I missing something obvious, that I can do with the current system? Any insights would be most appreciated. Thank you!
0
Comment
Question by:tam423
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 34976752
You can change the method to GET instead of POST

<FORM ACTION="diningresults.cfm" METHOD="GET">

That would put the search items on the URL.

This has the added benefit of making the URL bookmark-able, like google, you could cut and paste the search results into an email to show someone else... etc.

ALternatively, you could store the search criteria in the database.
0
 

Author Comment

by:tam423
ID: 34976968
qdemaria,

Thanks again for your help! I made that change and bingo -- the variables are in the URL. Guess I've been woefully ignorant about METHOD="GET". I did a few test queries, but I probably won't be able to see if my stats will show these query strings passed to the diningresults.cfm file until at least sometime tomorrow, when things get generated for the previous day -- do you happen to know if using METHOD="GET" will result in us being able to now track the specific search criteria used?
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 34976986
> do you happen to know if using METHOD="GET" will result in us being able to now track the specific search criteria used?

The criteria will be on the URL, so if your web stats can handle it (depends on the software), then I should think that is all you need.

Alternatively, you can store searches in the database and run reports yourself.


0
 

Author Comment

by:tam423
ID: 34977041
gdemaria,

Yes, I think, too, that this will work fine. We use SmarterStats Enterprise and I looked around a little and found that a query string parameter report can be generated on a dynamic page, so I think I'm good to go, at least from this point on. If not, for some reason, I will go the route of storing the searches in the database. Thank you -- again -- for your quick response and excellent help!
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question