Link to home
Start Free TrialLog in
Avatar of tam423
tam423

asked on

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

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!
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tam423
tam423

ASKER

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?
> 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.


Avatar of tam423

ASKER

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!