List Google Only Referrers
This will let you list your 50 most referrers from google hits.
First, download the LittleGreenFootballs referrer script.
Make duplicates of all the files adding this to the filename "-google"
example:
change lgf-reflog.php to lgf-reflog-google.php
change reflog.txt to reflog-google.txt
chagne semaphore.ref to semaphore-google.ref
etc.
Open the lgf-reflog-google.php file.
change this line:
$reflog = 'reflog.txt';
to
$reflog = 'reflog-google.txt';
change this line:
$semaphore = 'semaphore.ref';
to
$semaphore = 'semaphore-google.ref';
change this line:
$mydomain = 'mydomain.com';
to
$google = 'google.com';
change this line:
if (($ref) and (!strstr($ref, $mydomain))) {
to
if (($ref) and (strstr($ref, $google))) {
Open the show-refs-google.php file.
change this line:
$reflog = "reflog.txt";
to
$reflog = "reflog-google.txt";
Then make sure this line is at the top of all your pages (above the <html> tag) and that your page either has a PHP extension or make sure your site processes html files as php:
<?php
include('/HOME/PATH-TO-YOUR-FILES/lgf-reflog-google.php');
?>
the link to see your google hits:
http://www.YOURDOMAIN.COM/PATH-TO-YOUR-FILES/show-refs-google.php
Here's it working on this site:
Show Google Referrers
Update: With some major hacking - I grabbed the code from this script and mixed it in so that ONLY the search terms would show. I'm a little hesitant to publish here what I did because I don't want to violate any open source rules…
May 13th, 2002 at 11:27 pm
Is there any way you could modify the script to log everything BUT google hits? I get a lot of hits from google because of my domain name, and I'd much rather filter them all out so that I could just see hits from people actually linking to me.
May 14th, 2002 at 2:19 am
Thanks goddesses! And especially thanks to Christine for hearing my prayers. Now if I can just follow directions.
May 14th, 2002 at 3:17 am
I followed the directions (I think), and when I try to look at the last google referrers, I get this:
show-refs-google.phpÓ·„f ·„f mBIN‚?uy´
I'm not certain about my html file being processed as PHP (I'm not PHP literate), but other than that I was very careful. Do you have any suggestions?
May 14th, 2002 at 3:51 am
Interesting
Makes me almost want to remove all my nocache thingos in my meta tags.
May 14th, 2002 at 4:34 am
pretty cool! it took a bit as i was being silly but it worked in the end
May 14th, 2002 at 6:38 am
wKen - can you send me the links to the page where you have that tracker (the page that has the include line) and the show-refs url?
also - lets do an experiment to test your PHP set up:
Create a file, name it testingPHP.php
Put the following in that file
<? phpinfo(); ?>
Upload to your server and open the page in your browser.
It should show a bunch of PHP information.
If that works, try this.
Change the extension of that file to .html
try loading it again.
If that works, let me know.
If if DOESN"T work, that means that your html pages aren't processing like PHP pages.
Here's how you get html pages to process like they're php pages
May 14th, 2002 at 7:05 am
You might be able to explode those results (the google) using "q=" to get the search string and then explode that using "+" to get the actual phrase or something similar. Something a little more sidebar friendly (for someone who wanted to show recent google searches without having to decipher it.)
Cool.
May 14th, 2002 at 7:13 am
I had thought about that, but couldn't find a consistent pattern in the links…
sometimes it's q= keyword+keyword &hl=en
sometimes it's client=googlet&q= keyword
sometimes it's hl=en&q=keyword + keyword…
There's other ways the link comes in too
I looked online to see if there was any explanation to what all that means in the link, but couldn't find anything.
May 14th, 2002 at 8:05 am
You rock! This is how it worked in my head, and I just don't have the background knowledge to actually do this. But it makes perfect sense when I read what you did. :giggle: That's neato!
Karla, I would guess you could use Jenn's original tip for blocking bots from the lgf script and use google.com as a site to ignore.
August 29th, 2002 at 1:11 am
I don't s'pose you could give us just a little clue as to what you did to get them to display like that… even a vague hint??
August 29th, 2002 at 11:35 am
Ok…. if one of these original authors has a problem with this, please email me, and I'll take it down.
here's the hack to list just the keywords from google
September 9th, 2002 at 7:01 pm
Your the bestest Jennifer!
January 29th, 2003 at 1:04 pm
Folks - there's a newer, better version here that will show keyword refs from almost ANY search engine:
http://www.scriptygoddess.com/archives/003277.php
August 3rd, 2003 at 8:13 pm
The link isn't working on "how to get html pages to process like they're php pages". Anywhere else I can find how to do this?
August 3rd, 2003 at 8:41 pm
Made a post here too on how to do that (html to process like PHP):
http://www.scriptygoddess.com/archives/003661.php