Do it yourself keyword acclimatisation tracking
I proposed to write this upon http://www.wickedfire.com afterwards figured we indispensable the small brand brand brand brand new calm this week.
Have we ever longed for to find out which of your keywords have been converting upon your campaigns you’re running?
This is essentially the comparatively elementary thing to do if we pass the keyword as your subid. However since we never know who’s seeking during the keywords we’re starting to wish to rewrite the keyword as the series which we have anxiety to. If you’re trade to the calm site or something alternative afterwards the true route rebound page, we can lane them with the cookie or event or both. So the really elementary resolution for an associate route page which marks your acclimatisation by keyword competence be.
<?
include(”dbconnect.php”);
//
$keyword = trim($_GET[’keyword’]);
$keyword = mysql_real_escape_string($keyword);
// Finding the keyword in the database if it’s there
$sql = “SELECT * FROM keywords WHERE keyword = ‘$keyword’”;
$sql_out = mysql_query($sql);
if($sql_out){
$row = mysql_fetch_assoc($sql_out);
$id = $row[’id’]; //gets the id compared with the word
$sql = “UPDATE keywords SET equate = equate + 1″; // sql to increment the opposite for which word
mysql_query($sql);
}else{
// This cube puts the brand brand brand brand new word in the database as well as grabs it’s ID
$sql = “INSERT INTO keywords (keyword) VALUES (’$keyword’)”; // sql to insert the brand brand brand brand new keyword we don’t have cataloged
mysql_query($sql);
$id = mysql_insert_id(); // gets the id of the jot down we only inserted.
}
// Here we’re redirecting to the finish place with the transposed keyword with the brand brand brand brand new ID
$location = “Location: http://location.com/subid=$id”;
header($location);
?>
SQL for this is only the list is really simple. Just the 3 fields.
1. id set to first pass as well as auto-increment
2. keyword set to varchar 200 as well as indexed
3. equate set to stand in no indexing
And which should do the trick….
This will take the incoming caller as well as record the keyword, afterwards route to the suggest formed with the subid for the keyword. This is the true route rebound page with deputy keyword tracking.
Now if we wish to lane formed upon them entrance to the site do dual thing have your page formed upon php. as well as during the tip put which same code, only mislay the header as well as place lines. Then when we beget your page reinstate your links with with the $id so for e.g. which php page would demeanour similar to this.
<?
// prior formula here reduction the header redirect
?>
<h1> here is the small text</h1>
<p> here some-more content as well as the <a href=”http://destination.com/subid=<? relate $id; ?>”>link</a><p>
now you’ll see we’re job the php inline to relate the series we’ve retrieved from the keyword above. Then when we run which page in your browser you’ll see the id’s transposed
flattering sharp huh.
A integrate ideas for this which could be combined have been geoip tracking as well as redirection formed upon the place of the on vacation guest. Or how about anticipating out where your visitors have been entrance from? Do we know if you’re removing healthy traffic? And if we do know, do we know where’s it entrance from as well as which of those locations have been converting for you? If we found the couple to your site which was bringing the lot of good trade which was converting it competence have clarity to run the ensign ad or something similar to which there wouldn’t it?
Tracking is Simple, Powerful as well as fun regulating the small PHP ingenuity.