Archive for the ‘Keywords’ Category

How to Track Converting Keywords for your Affiliate Marketing advertising using PHP

Sunday, November 4th, 2007

Do it yourself keyword conversion tracking

I started to write this on http://www.wickedfire.com then figured I needed some new content this week.

Have you ever wanted to find out which of your keywords are converting on your campaigns you’re running?

This is actually a relatively simple thing to do if you pass the keyword as your subid. However because we never know who’s looking at our keywords we’re going to want to rewrite the keyword as a number that we have reference to. If you’re traffic to a content site or something other then a straight redirect bounce page, you can track them with a cookie or session or both. So a very simple solution for an affiliate redirect page that tracks your conversion by keyword might 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 associated with the word
$sql = “UPDATE keywords SET count = count + 1″; // sql to increment the counter for that word
mysql_query($sql);

}else{

// This chunk puts our new word in the database and grabs it’s ID
$sql = “INSERT INTO keywords (keyword) VALUES (’$keyword’)”; // sql to insert the new keyword we don’t have cataloged
mysql_query($sql);
$id = mysql_insert_id(); // gets the id of the record we just inserted.
}

// Here we’re redirecting to the end location with our replaced keyword with the new ID
$location = “Location: http://location.com/subid=$id”;
header($location);

?>

SQL for this is just a table is very simple. Just a 3 fields.

1. id set to primary key and auto-increment
2. keyword set to varchar 200 and indexed
3. count set to double no indexing

And that should do the trick….

This will take the incoming visitor and log the keyword, then redirect to the offer based with the subid for the keyword. This is a straight redirect bounce page with replacement keyword tracking.

Now if you want to track based on them coming to a site do two thing make your page based on php. and at the top put that same code, just remove the header and location lines. Then when you generate your page replace your links with with the $id so for example that php page would look like this.

<?
// previous code here minus the header redirect
?>

<h1> here is some text</h1>
<p> here more text and a <a href=”http://destination.com/subid=<? echo $id; ?>”>link</a><p>

now you’ll see we’re calling the php inline to echo the number we’ve retrieved from the keyword above. Then when you run that page in your browser you’ll see the id’s replaced :) pretty slick huh.

A couple ideas for this that could be added are geoip tracking and redirection based on the location of the visiting guest. Or how about finding out where your visitors are coming from? Do you know if you’re getting natural traffic? And if you do know, do you know where’s it coming from and which of those locations are converting for you? If you found a link to your site that was bringing a lot of nice traffic that was converting it might make sense to run a banner ad or something like that there wouldn’t it?

Tracking is Simple, Powerful and fun using a little PHP ingenuity.

Powerful Open Source ( FREE ) Click tracking tools to improve your Pay Per Click Conversions

Sunday, November 4th, 2007

Couple of great open source resources for Heat Mapping and click path tracking. Find out where people are clicking and how long they’re staying.

http://www.labsmedia.com/clickheat/index.html

Also if you have a complex site and are looking to track paths of your visitors to find out where they’re leaving you can check out.

http://www.phpopentracker.de

It has the capability of adding plug-in’s to it that will allow you to track conversion. It’s written in PHP and easily extendable to suit your needs. A great place to start if you want to create a full fledged tracking system for and E-commerce site or a large scale site with paths to a sale.

How to Track Keywords & Tell Which Keywords Convert

Sunday, November 4th, 2007

First off thanks to all those who have used the new contact form it works great… almost to great as i got TONS of questions. So i decided to answer my first one today which revolves around tracking keywords for your campaigns and how to tell which ones convert. The Actual Question is:

How do I know which KeyWord is converting the best? 

1. How Do You Know Which Keyword is converting best?

  • First you have to Track your Keywords either using 3rd party software, custom software or simple code.
  • The Simple code can take the searched Keyword and tag it in the subid placement.

Place this code in between your head tags:

<?php ob_start();

if(isset($_REQUEST[’kw’]))    

    {    

         $kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).””;

        $k1w = urldecode( $_REQUEST[’kw’] ).””;  

    }    

    else    

    {    

       $k1w = NULL;  

    } 

?>

Place this code where you want the Keyword to appear in your Subid:

<? echo ( ( strlen( $k1w ) <6 ) ? “Default Text” : “$k1w\n” ) ; ?>

The Reason for the <6 is if the string is less than 6 characters the “Default Text” will be put in instead of Keyword brought in, u can change this number.

Now your Affiliate Link in your page will be like this:

“http://www.CPANETWORK.com/12345?subid=<? echo “$k1w\n”; ?>”

Now in Google or MSN you can Append your destination links with the Keyword Dynamically. So your destination Url will be:

http://www.somesite.com/?kw={Keyword}

Now once you Make thos changes your Keywords will be appearing in your Subid output in your CPA network. So you can see what keywords are producing leads and which ones aren’t.  No you know which ones are producing leads you can delete keywords that aren’t producing leads. Do make sure you give enough time to see if the keywords really perform or dont perform. As in you don’t want to delete a keyword that only has one click but didn’t convert you want to look more at higher volume keywords that don’t convert, because the smaller volume the next click could be a lead.

Auto Loans Regardless of Credit! DriverLoans.com