Solved

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

Posted on 2011-02-24
4
417 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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