Welcome Guest, Not a member yet? Register   Sign In
How to display the search terms people used to get on my site
#1

[eluser]kbkb[/eluser]
Hi there!

Whats the best way to display a statistic of search-terms which user used to get on my side?
Is there any reconemendable plugin?

I am afraid i have to analyze every querystring by hand..
This is also a very unfortunatly topic to search by google because i dont know which keywords i am looking for..

Please help me Smile
#2

[eluser]überfuzz[/eluser]
I seem to remember doing something like this... Not sure... but I think I mustered something like max(count(string)).
#3

[eluser]jedd[/eluser]
gg: highlight search terms on page coming from google

That gives me 20 links to pages that describe what you want to do.

I'm very much on side with the guy who commented, over at [url="http://stackoverflow.com/questions/907305/how-does-a-website-highlight-search-terms-you-used-in-the-search-engine"]stack overflow[/url] in response to this question:

"Please, I beg you -- find out how to accomplish this and then never do it. As a web user, I find it intensely annoying ...'
#4

[eluser]überfuzz[/eluser]
[quote author="jedd" date="1252782288"]"Please, I beg you -- find out how to accomplish this and then never do it. As a web user, I find it intensely annoying ...'[/quote]
I don't think he intends to annoy visitors with it... I thought it's was for him self, or some back/office stuff.
#5

[eluser]kbkb[/eluser]
[quote author="überfuzz" date="1252782478"][quote author="jedd" date="1252782288"]"Please, I beg you -- find out how to accomplish this and then never do it. As a web user, I find it intensely annoying ...'[/quote]
I don't think he intends to annoy visitors with it... I thought it's was for him self, or some back/office stuff.[/quote]yes - thats right.
I don't wanna highlight incoming searches. I just wanna make a page where all searches are counted, like in google analytics.
#6

[eluser]Jay Logan[/eluser]
I store all my hits in my database - including referral URL which is sometimes a Google search query. When I retrieve the hits, I run each referrer URL through this helper I made that checks to see if it is from a search engine. Here is the code.

Code:
function clean_referrer($referrer) {

    if ($referrer) {

        preg_match("/[\&\?]q=([^&]*)/", $referrer, $matches);

        if (isset($matches[1])) {

            $search_query = rawurldecode($matches[1]);
            $search_query = str_replace("+", " ", $search_query);
            return "Search engine query for ".$search_query;

        } else {

            return $referrer;

        }

    } else {

        return $referrer;

    }

}

Technically, this doesn't check to see if the referrer is specifically from Google. Rather just if the user came from a URL that has "?q=" is the URL (which is generally a search engine). You could edit the code to specify Google. I don't know regex that much though.

If you don't store the hits in the DB, then you could just use a $SERVER['HTTP REFERER'] variable.
#7

[eluser]brianw1975[/eluser]
unless you absolutely need to change content based on search terms you could always install a log analyzer like awstats, then look for some classes on how to access the compiled statistics or use something like the following http://www.white-hat-web-design.co.uk/ar...wstats.php
#8

[eluser]kbkb[/eluser]
Thank you guys very much for this bunch of great ideas!
#9

[eluser]BrianDHall[/eluser]
I might also recommend you just use Google Analytics. Its just a quick bit of code to stick on your pages and it gives you lots of easy to access information, especially incoming search queries.

If you needed to do this as a back office function with your code logic you could just record all referring URLs from external sites, then do a bit of string processing work to pull out Google and turn their queries into their original keyword search string. But unless you have a really good reason for doing it and really need it, using a stats program (externally like Google or installed like AW stats) is highly preferable.

I was going to do the same thing as you and do all sorts of user click-through tracing, etc...then looking through the analytics for my websites tells me far more than I really need to know as it is, so I don't think I'll ever get around to actually doing what I planned - it just isn't necessary.




Theme © iAndrew 2016 - Forum software by © MyBB