[How-To] Customize Content Based On Incoming Search Term

schwagoo

Power Member
Joined
Nov 8, 2010
Messages
799
Reaction score
741
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.

page-gui.jpg



page-gui-2.jpg



how-to-code-desc.jpg



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'];
}
}
}
 
I'm very surprised this thread hasn't been seen by more people. This is very useful stuff not only for customising content but if you have a custom built website, you can modify this code to track what users are searching to get to your website.

Thanks OP, appreciate your post!
 
That is FREAKING genius!

I have no idea where you come up with some of the stuff you come up with but this is well past gold... I put this in the platinum region of ideas.

I'm going to get my tech guys on this tomorrow for a bunch of my sites as I am sure it will increase my revenue... beers, booze and happy endings on me!
 
Method works quite well. I also do something even more simple. I take the keyword they searched for and put at top of page:

Looking for %keyword% ?
Read below to find out more about this!


What this does is:

  1. Increases time on page because they actually start to read through even if the original title of the page wasn't what they were looking for.
  2. Increases number of visited pages on site. When you combine this technique with good content they will get more interest in what you're writing about. The key is to hook them and then to make them curious about X and Y on your site.
  3. Increases conversions. Simply because they spend more time on site and become curious about X and Y. They're in a conversion funnel, they just don't know it.
Obviously this doesn't work perfect by itself, you actually need to have a very user friendly site with good content.


OPs method combined with mine also works well on dynamically generated sites that have spammy/generated content. I just put that on 1st page and say something like:


If you're looking for %keyword% click here. On that page make sure you check out first link to get additional info about this.



That takes them to another page. At this point they just did 2 pageviews. Also they have the idea that they should click on first link :)


On the page I have the page title and beneath it I have a text ad. Below that I have text generated for that particular keyword. In the text I have a link to Amazon or whatever. Many will click either the ad or the link. The trick for all this to work is to actually generate that page around the keyword he was looking for :) That means the text is about (includes) that keyword more or less. Hence the ads are somewhat targeted.


The method is not amazing or impressive but it does increase revenue a bit.
 
Awesome method man. I don't have sites that get general traffic, as most visitors come to the right landing page when they search for their respective keywords. However, for a person who owns a site with many incoming search keywords, I would think this is a goldmine. Thanks for sharing.
 
What's the behavior of the script if there are no search terms coming from the referrer? I.e. a direct visit? Just a default banner/whatever or simply nothing?

This is a really nifty idea. I always used to see that SEO Search Terms Tagging 2 plugin display the search terms on the landing page, but this takes it to a whole other level.
 
This is a big plus for anyone looking to up their conversions. Brilliant schwagoo
 
This is a great idea for sure mate..

I hope someone can come up with a full fledged script to link the Analytics account, so the keywords are added automatically based on search priority and CTR.
 
Method works quite well. I also do something even more simple. I take the keyword they searched for and put at top of page:

Looking for %keyword% ?
Read below to find out more about this!


What this does is:

  1. Increases time on page because they actually start to read through even if the original title of the page wasn't what they were looking for.
  2. Increases number of visited pages on site. When you combine this technique with good content they will get more interest in what you're writing about. The key is to hook them and then to make them curious about X and Y on your site.
  3. Increases conversions. Simply because they spend more time on site and become curious about X and Y. They're in a conversion funnel, they just don't know it.




The method is not amazing or impressive but it does increase revenue a bit.

You said it. This isn't sexy--but its immensely powerful.

This is really important and valuable information, thank you for sharing with your BHW family Shwag!
 
Back
Top