How to Grab Readers Attention with The KeyWords They have Googled

The first-moment objective of your Sales Letter is to grab the reader’s attention. The headline tells him what the sales letter is about. The sub-headline is optional. Sometimes it’s used to expand the headline. A high attractive sub-headline helps to catch the reader’s eye.

Let’s suppose you keep search in Google™ by a keyword. What would you look for at a page opened with a searched link? The KeyWord you entered in the search-line. Right?
Place the reader’s KeyWords in your sub-headline to increase chances of your sales letter to be read.

This post helps you to extract the KeyWords and push it into your page.

All scripts below work with the Google™, Yahoo® and MSN® search engines.

Grab search KeyWords PHP-script

Select all of the the code-text in the box below then copy to clipboard (Ctrl+c), then paste (Ctrl+v) the PHP-code you’ve just selected into the source code of your php-page anywhere between the <body> and </body> tags. The position you choose is where the KeyWords will appear.

The code of your page would look like this:

index.php
<html>
 <body>
  …
 <h1>Headline</h1>
 <h2><!-- Sub-Headline -->
<?php
 if (($referer = getenv("HTTP_REFERER"))) {
  $query = parse_url($referer);
  $regexp = "";
  if (stristr($query["host"], "google.")) {
   $regexp = "/^(?:.+?&)?q=(.+?)(?:&.+)?$/i";
  } else
  if (stristr($query["host"], "msn.")) {
   $regexp = "/^(?:.+?&)?q=(.+?)(?:&.+)?$/i";
  } else
  if (stristr($query["host"], "yahoo.")) {
   $regexp = "/^(?:.+?&)?p=(.+?)(?:&.+)?$/i";
  }
  if ($regexp &&
  preg_match($regexp, $query["query"], $matches)) {
   $keywords = urldecode($matches[1]);
   print $keywords;
  }
 }
?>
 </h2>
  …
 </body>
<html>

Grab search KeyWords JavaScript

You may have a html-page (not a .php one). This JavaScript allows you achieve the same result as the php-script shown above.

Select all of the the text in the box below then copy to clipboard (Ctrl+c), then paste (Ctrl+v) the JavaScript-code you’ve just selected into the source code of your web page anywhere between the <body> and </body> tags. The position you choose is where the KeyWords will appear.

The code of your page would look like this:

index.html
<html>
 <body>
  …
 <h1>Headline</h1>
 <h2><!-- Sub-Headline -->
<script type="text/javascript">
<!--
if ("" != document.referrer) {
 var query = document.referrer.split("?");
 var field = "";
 if (query[0].indexOf("google.")) {
  field = "q=";
 } else if (query[0].indexOf("msn.")) {
  field = "q=";
 } else if (query[0].indexOf("yahoo.")) {
  field = "p=";
 }
 if ((query.length > 1) && ("" != field)) {
  var pairs = query[1].split("&");
  for(var i = 0; pairs.length > i; ++i) {
   if (0 == pairs[i].indexOf(field)) {
    var keywords = pairs[i].substr(2).split("+");
    keywords = unescape(keywords.join(" "));
    document.write(keywords);
   }
  }
 }
}
//-->
</script>
 </h2>
  …
 </body>
<html>

Download this JavaScript and use it as an external script-file

You can download this JavaScript as a separate file: se_words.js
Click this link with right mouse-button and select the “Save As…” menu-item.
Then upload this file onto your site beside your web-page and pleace the code below in position where the KeyWords will appear:

How It works

This post contains the script placed under the headline.
Google search
If you open this blog from Google™ you can see the sub-headline in brown color.

If no, click here to search this blog in Google™

Then click this blog link from the search results and you’ll be able to see your search words as the sub-headline of this page.

 

 

by Michel Komarov, © Copyright 2007. iCoder.com

 

Share in social bookmarking:These icons link to social bookmarking sites where readers can share and discover new web pages.  digg del.icio.us BlinkList Reddit NewsVine YahooMyWeb co.mments

Related Articles:

Got a question?   Leave a Reply

You must be logged in to post a comment.