Go Back   Web Design & SEO Company > Free Scripts

Free Scripts Free Scripts to add to your website, includes Ajax, Javascript, php, Flash, CSS, HTML and more. No registration is required to download, these scripts are provided free to help you make the most of your website.

Reply
 
  #1  
Old 03-10-2009, 05:20 PM
Admin's Avatar
Administrator
 
Join Date: Jan 2007
Location: Taree
Posts: 613
Default Display Search Engine and Keywords Used by Visitors

This script will show the visitor to your web site, which keywords they searched to arrive on your site as well as the search engine used. No doubt you have landed on a site, and it's displayed something like:

Quote:
"Hi, i see you came from Google looking for Information About SEO so i hope you enjoy our site"
Where the bold text is the engine and keywords used. I've found this can boost pageviews and time spent on the site as it delivers a more personalized message to the visitor, and gives some level of interaction beyond just presenting them with a default page that everyone else sees.

So here is a script to show the keywords and engine used by the visitor:

searchcode.php
PHP Code:
<?php

class search_keywords
{
var 
$referer;
var 
$search_engine;
var 
$keys;
var 
$sep;
function 
search_keywords()
{
$this->referer ;
$this->sep ;

if (
$_SERVER['HTTP_REFERER'] OR $_ENV['HTTP_REFERER'])
{
$this->referer urldecode(($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $_ENV['HTTP_REFERER']));
$this->sep = (eregi((\?q=|\?qt=|\?p=)$this->referer)) ? \?’ \&;
}
}

function 
get_keys()
{
if (!empty(
$this->referer))
{
if (
eregi(’www\.google’$this->referer))
{
preg_match(#{$this->sep}q=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine ‘Google’;
}
else if (
eregi((yahoo\.com|search\.yahoo)$this->referer))
{
preg_match(#{$this->sep}p=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine ‘Yahoo’;
}
else if (
eregi(’search\.msn’$this->referer))
{
preg_match(#{$this->sep}q=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine ‘MSN’;
}
else if (
eregi(’www\.alltheweb’$this->referer))
{
preg_match(#{$this->sep}q=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine ‘AllTheWeb’;
}
else if (
eregi((looksmart\.com|search\.looksmart)$this->referer))
{
preg_match(#{$this->sep}qt=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine ‘Looksmart’;
}
else if (
eregi((askjeeves\.com|ask\.com)$this->referer))
{
preg_match(#{$this->sep}q=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine ‘AskJeeves’;
}
else
{
$this->keys ‘Not available’;
$this->search_engine ‘An Unknown’;
}
return array(
$this->referer,
(!
is_array($this->keys) ? $this->keys $this->keys[1]),
$this->search_engine
);
}
return array();
}
}
?>
Save the above script as searchcode.php and upload it to your /public_html/ directory. Now use the following in your page:

PHP Code:
<?php
 
require_once(./searchcode.php’);
 
$keys =& new search_keywords();
$keys $keys->get_keys();
 if (
count($keys))
{
echo 
“Hii see you came from <b>$keys[2]</blooking for  <b>’$keys[1]</bso i hope you enjoy our site!;
}
 
?>
This will detect and display the following search engines:

Google
Yahoo
MSN
AllTheWeb
Looksmart
AskJeeves

If you want to customize the output, you just need to edit this part:

PHP Code:
echo “Hii see you came from <b>$keys[2]</blooking for  <b>’$keys[1]</bso i hope you enjoy our site!
Reply With Quote
Top SEO Tool
Harvester and Mass Blog Commenter
Blog Comment Software

  #2  
Old 07-08-2009, 09:34 PM
Junior Member
 
Join Date: Jul 2009
Posts: 2
Default

Thank you

How can I add this in the forum

I have not had the attempt failed


Reply With Quote
  #3  
Old 07-09-2009, 03:36 AM
Admin's Avatar
Administrator
 
Join Date: Jan 2007
Location: Taree
Posts: 613
Default

What forum do you want it to display on, vBulletin?

Also where do you want it to display, on all pages?
Reply With Quote
  #4  
Old 07-09-2009, 06:07 AM
Junior Member
 
Join Date: Jul 2009
Posts: 2
Default

yes vBulletin

display All pages

How can I use code php in the Templates ?

thanks

Last edited by last night; 07-09-2009 at 06:14 AM.
Reply With Quote
  #5  
Old 07-10-2009, 09:17 PM
Junior Member
 
Join Date: Jul 2009
Posts: 2
Default

I want to put them in the forum of the type of vBulletin
I also want to change the display language are the words that have a high change in the language
Reply With Quote
  #6  
Old 07-10-2009, 10:07 PM
Junior Member
 
Join Date: Jul 2009
Posts: 2
Default

this product is the Arabic version for forum
vBulletin
Attached Files
File Type: zip product-seen1.0.zip (4.7 KB, 104 views)
Reply With Quote
  #7  
Old 07-30-2009, 10:03 PM
Banned
 
Join Date: Jul 2009
Posts: 2
Default Holiday discounts

Hi my name is D.K.
Reply With Quote
  #8  
Old 10-27-2009, 04:03 PM
Junior Member
 
Join Date: Oct 2009
Posts: 3
Default Need assistance with getting this to work

Hi there, I just found this script. just what I want to get my landing page customised with the visitors keywords to say "we provide the best <keyword used> " etc in increase my conversion, or least test to see if it does.

I just cant get the code to work.

I uploaded searchcode.php to my public folder. also chmod to 777 just incase it needs execute? (didnt work before chmod as 644)

I also put the code
<?php
require_once(’./searchcode.php’);
$keys =& new search_keywords();
$keys = $keys->get_keys();
if (count($keys))
{
echo “Hi, i see you came from <b>$keys[2]</b> looking for <b>’$keys[1]‘</b> so i hope you enjoy our site!”;
}
?>

in the body of my page.

also checked that php is not set to safe-mode on my server which might restrict it. (??)

when I load my webpage in the browser is shows

get_keys(); if (count($keys)) { echo “Hi, i see you came from $keys[2] looking for ’$keys[1]‘ so i hope you enjoy our site!”; } ?>

So looks like code is not working.
any ideas really greatly apreciated.
manythanks
Reply With Quote
Top SEO Tool
Harvester and Mass Blog Commenter
Blog Comment Software

Reply

Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Search Engine Tips seoconsult SEO 3 05-20-2011 02:14 PM
What is Search Engine Optimization? Admin SEO 5 04-23-2011 06:48 AM
Search Engine Optimization For Your Brand Admin SEO 4 06-11-2009 10:36 AM
Search Engine Optimization Guide SEO_Internet SEO 1 05-04-2009 10:57 AM
Benefits of Search Engine Optimization ramsatya SEO 6 01-02-2009 11:28 AM
get top 10 search engine ranking in 3 months webexpert SEO 5 09-11-2008 12:40 PM
Search Engine Optimization : The Low Down! CashFlow123 SEO 2 03-12-2008 04:58 PM



Knowledgebase | SEO | Free Scripts | Free Wordpress Themes | Free Graphics

eval gzinflate base64 decode | SEO Addons


Forum time zone is GMT. Currently it's 03:17 AM.

SEO - Top



Web Design & SEO Forums