How to insert custom HTML based on incoming search term.
Why would you want to do this?
Because it is in your best interest to give people the exact data they are looking for...they will stay longer and buy more.
If they search for ?Laptop Repair? when your site is mainly focused on ?Computer Repair?, the user may assume that you don't work on laptops and bounce to another website. People are stupid and they need you to help them find what they are looking for.
If you use this script to show customized content when the user clicks in searching for ?Laptop Repair?, then you can show banners and text that cater to LAPTOP REPAIR as if that is all you do
You take the web visitor from thinking ?Hmm I see that they repair computers, but I will have to click around to see if they sell laptops...?
With customized content they think ?Wow it looks like this place specializes in Laptop Repair, I will call them right now!!?
Watch your bounce rate plummet and your conversions skyrocket.
How do you do this?
We have a table set up in the database with
keyword_ID, Keyword_list, and keyword_HTML
If you are like me, you don't really know how to do that. So you hire someone who does. Have your programmer do this and make you a GUI like I am showing below.
Then the code does the hard work:
The code is pasted below. Any programmer should be able to drop this into place without any trouble.
Here is the GUI we build to make it easy to add/edit keywords and customize the content.
Why would you want to do this?
Because it is in your best interest to give people the exact data they are looking for...they will stay longer and buy more.
If they search for ?Laptop Repair? when your site is mainly focused on ?Computer Repair?, the user may assume that you don't work on laptops and bounce to another website. People are stupid and they need you to help them find what they are looking for.
If you use this script to show customized content when the user clicks in searching for ?Laptop Repair?, then you can show banners and text that cater to LAPTOP REPAIR as if that is all you do
You take the web visitor from thinking ?Hmm I see that they repair computers, but I will have to click around to see if they sell laptops...?
With customized content they think ?Wow it looks like this place specializes in Laptop Repair, I will call them right now!!?
Watch your bounce rate plummet and your conversions skyrocket.
How do you do this?
We have a table set up in the database with
keyword_ID, Keyword_list, and keyword_HTML
If you are like me, you don't really know how to do that. So you hire someone who does. Have your programmer do this and make you a GUI like I am showing below.
Then the code does the hard work:
The code is pasted below. Any programmer should be able to drop this into place without any trouble.
Here is the GUI we build to make it easy to add/edit keywords and customize the content.
Code:
<?PHP
$parse = parse_url($_SERVER['HTTP_REFERER']);
$se = $parse["host"];
$raw_var = explode("&", $parse["query"] );
foreach ($raw_var as $one_var)
{
$raw = explode("=", $one_var);
$var[$raw[0]] = urldecode ($raw[1]);
}
$se = explode (".", $se);
switch ($se[1]) {
case 'yahoo':
$keywords = $var['p'];
break;
case 'aol':
$keywords = $var['q'];
break;
case 'youtube':
$keywords = $var['v'];
break;
default:
$keywords = $var['q'];
}
if($se[1]!='' & $keywords!='')
{
$c==0;
$k = "000".str_replace( ' ', '', strtolower($keywords));
//$k = "000".str_replace( ' ', '', strtolower($_GET['w']));
$qry = mysql_query("SELECT * FROM `custom_key_data` where cid!=1 ORDER by cid");
while($ky=mysql_fetch_array($qry))
{
$string=str_replace(' ', '',strtolower($ky['keywords']));
$words = explode(',', $string );
for( $i = 0; $i < count($words); $i++ )
{
if(strpos($k, $words[$i]))
{
$c=$ky['cid'];
$coupon=$ky['txt3'];
$txt=$ky['txt1'];
$testimonial=$ky['txt2'];
}
}
}