Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-24
4
Medium Priority
?
420 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

610 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