Checking Out Ranking Loophole
I bought Dave Kelly and Chris Rempel's MSN Ranking Loophole, The Ultimate Search Engine Loophole.
I know from previous experience that what is delivered in the pdf manual works (or has worked), I'll find out if it still works and specifically does it work on getting your site ranked near the top of MSN search results for competitive terms.
When I saw the work "linkubator" on the sales page I wondered if it does what "linktator" does. Yep, it does.
There is some intial setup (which I think is downplayed on the sales page) that needs to occur before you can start dropping one page mini sites into the system. But once it is setup in the way specified in the manual, then all that setup should pay off.
Of course, being the person that I am, there was no way I was going to set this up without automating as much as possible.
I ended up creating a suite of scripts that take care of a good portion of the work involved. I'm offering access to those Ranking LoopHole scripts as a bonus to anyone who buys through my affiliate link.
Even if you don't buy through my affiliate link you can still access the scripts by paying a nominal fee.
Download Clickbank Sales Stats
Right now I am in the middle of building a system for using Adwords, one that includes tracking results on the keyword level as taught by Double Digit CTR.
And one thing I want to be able to do is instantly track any sales from Clickbank back to the keyword that generated the sale. I recently built a PHP script that logs all visitors, the keyword used to arrive at my site, the referring url, tracking id, I.P. address and date.
The key for tracking sales results is to include a tracking id, TID, with the destination (referring) url, something like this: http://www.example.com/?k=keyword&q=tid
The information after the ? gets stripped off and dumped into a database.
Now I just need to compare that with the actual sales results and compare the sales results TID with what is in my log database.
... and I thought you might benefit.
If you are a Clickbank publisher or affiliate, and in particular if you have multiple accounts, then you might like this script I recently created.
It is a PHP script that you install on your site; there is no database involved, no storing personal information. If you know how to upload a file to your website, thats all you need.
very simple to use. Just type in your Clickbank username and password with a comma seperated each. If you have multiple accounts, then the username/password combinations are one per line. Just like this:
Choose the start and end date, click "Get Stats!".
Almost right away you will be presented with a CSV (comma separated value) file that will easily open in a spreadsheet program like Microsoft Office Excel.
There's your stats.
You can see a short video on how in works and demo it at Salestator.
Google Adwords With Affiliate Data Feed
Time to play Adwords with the big kids. Hitch your pants up and lets get going.
From start to finish, you'll see how to setup a datafeed to generate content that gets triggered by Adwords clicks. Content rich advertisements that provide a plethora of opportunities for your visitors to find exactly what they are looking for.
By way of example, you will see how to:
- get a datafeed, setup a MySQL databse, create a script that cleans up the datafeed and uploads the content to the database
- build a PHP search script for displaying results appropriate to your visitors interest
- use a script that creates Adwords keyword groups from the title of the products stored in the MySQL database
- setup an Adwords campaign that uses dynamic keyword insertion
- define a htaccess file that creates search engine friendly URLs from the Adwords dynamic keyword insertion used in your advertisements
- create a template that provides a list of related items and common content such as a header, navigation bar, contextual advertisements (like Google Adsense), and footer
- another PHP script, a redirect script, that logs time, I.P. address and link clicked for tracking purposes
There is a lot to cover in this Adwords article, lets get started.
Setting Up Your Datafeed
Like I said, this is going to be a working example, no theory here, of how to use Adwords with a datafeed. Trust me when I tell you it is not all pretty. There is some ugliness involved when adding a vendor's datafeed to the mix - "goofy" characters being the biggest offender. You'll know them when you see them.
For this example, I am going to use a datafeed I have previously used, one of the most content rich datafeeds I have found on ShareASale - the Nature Hill's datafeed.
If you want to follow along, head over to ShareASale, login or signup if you aren't a member already, then grab the NatureHill datafeed.
Once in, find the Nature Hill's program and click on the link that says "Download .csv".

You'll need to download the file and extract it to your computer.

Next, upload the extracted file (4742.txt) to your webserver in the directory of your choice and possibly change the permissions on this file (chmod).
Good coders create, great coders reuse
.. or something to that effect. I tell you this because I found a site where someone has done a great job setting up a database and importing the datafeed just like we want. Like I said, good coders create, great coders ...
But before we do that, we need to create a MySQL database, user, and password. You'll also add the user to the MySQL database. When everything is said and done, your MySQL information should look like this if you are using CPanel:

Back to the script.
Of course, it won't be right if I didn't hack up the script a little bit, now would it.
Remember how we have already uploaded the merchant's datafeed file, in this case 4742.txt, to our webserver. Since we have already done that, we can chop off the ftp portion of this script and simply start by reading in the file.
Plus, we need to add a little something extra to cleanup the title (Name).
The final script looks like this:
Note well the "REPLACE" comments - that is for you to specifically change, in particular your ShareASale id ($sas_id) which is a number provided by ShareASale, database user, database password, and database name.
Typical information might look like this:
<?php
$sasid = "1234567"; // REPLACE sas_id with your SAS ID; Can be found at the top of any SAS page
// The following variables make the connection to your database
$dbuser = "myacc_username"; // REPLACE db_user with the username used to connect to your database
$dbpass = "mypassword"; // REPLACE db_pass with the password used to connect to your database
$database = "myacc_database"; // REPLACE database with the name of your database
?>
Now that we have all of our "supplies", it is time to start building a ...
Search Script
... that is "smart" enough to display results that your visitor would be interested in. I already have in mind how my Adwords campaign will be setup so I know what this PHP search script needs to do.
Now, for the purists out there, you'll recoginize that what I am about to show is a "hack". Not a pretty way of accomplishing what I want to do, but it works. If the database I am using was much larger, I would probably run into performance problems.
The idea behind this is that I am looking for items whose Name matches ANY of the keywords provided by the user via an Adwords click.
If someone is looking for "apple trees", the search script will return results that have either "apple" or "tree" or both in the Name of the database field.
And being the money grubbing mongrel that I am, results will be returned with the most expensive item displayed first :)
As a fall back, if there are no matches in the Name (title) part of the database, the search script will make a second pass through the database looking in the Description part of the database for matching items. If that returns no results; well, I'll figure something out by the time we get to the end of this article.
We will start by creating a snippet of code that parses through the keyword or keywords and creating a sql query statement.

This code assumes that the keyword(s) is passed from another script (which it will be using since we are using dynamic keyword insertion with Adwords).
Line by line:
3) Grabs the keyword(s) passed from another script, chops off the whitespace at the beginning and end (if there is any), then strips out any tags (html type) to prevent any "junk" from being passed in.
4) Take the keyword(s) and break them up into individual words, shove them into an array.
5) Loop through each keyword.
6) Make sure the keyword is not empty.
7) Build a portion of the sql query needed and keep appending for each keyword.
10) Once finished with each keyword, chop off the extra "||" from the end.
This is the conditional part of the yet-to-be-displayed sql query needed for searching the database of affiliate products.
Lets Query
If you look up at the original script shown (you don't have to, trust me on this one), we named our table naturehills. Lets define a variable with that value.
$table = "naturehills";
Now create a sql query that uses that variable and the $extra variable.
$sql = "SELECT * FROM $table WHERE $extra";
Our search script now looks like this:

Lets move along and show what the script looks like with the sql statement and looping through the results (along with our backup plan if we don't get results the first time).
Save this as "search.php"

Notice I have added some MySQL stuff at the top to connect to your database. For where we are now, I am simply having the script print out the Name if it finds a match. If there are more than 30 results, the script stops returning results. The $count keeps tracks of how many results; if there are less than one result after the first sql query, the search script then changes the query from looking in the Name field to looking in the Description field ($extra = preg_replace("/Name/", "Description", $extra);).
To be honest, I don't expect that the Description option will ever be triggered. Why? Because of the way I will setup my Adwords campaign that uses the datafeed Name as keywords. But just to be safe the script will include the backup query.
Almost forgot my money mongering ways, add this to the sql statement to return results by most expensive to least expensive:
$sql = "SELECT * FROM $table WHERE $extra ORDER BY ABS(Price) DESC";
That's the basis of our search script, we will fill it out later to present the results in such a way that results are included in a template to display for our visitors.
Moving right along.
Creating Adwords Keyword Groups
We are going to query the database that contains our datafeed information, grab all the names, and build a keyword group for EACH keyword that we can dump into the Google Adwords Editor.
We could always group our keywords by another field in the datafeed, either Custom1 or Custom3, which shows which groups each Name fits into. Since I don't know if I can count on these fields being populated at a later date, I'll opt not to use these.
Our groups will be built with the broad category selected. From there, the Adwords keyword group script will spit out results that you can copy-paste into Adwords Editor then upload.
The result from running this script is a textarea box filled with ad groups that consists of one keyword per ad group with the campaign name "CAMPAIGN" that looks like the following.

I recommend you do a search and replace and give the campaign ("CAMPAIGN") name something else. Then copy the results.
Google Adwords Editor
If you are not familiar with the Google Adwords Editor, download it here.
Next, go over to your Google Adwords Editor (I'm making the assumption that you have figured out how to set this up). Click on "Keywords", then click on "Make Multiple Changes", choose Add/Update Multiple Keywords.

Next, for the Destination option, choose the radio button that says "My keyword information below includes columns for campaign and ad group names. (These columns should be first, and in this order.)".

Paste the results. Click on "Next".
Some keywords might be ignored for duplicate reasons.

Complete the information required under the Ad Groups and Campaigns tabs before posting this new campaign to Adwords.

Under Campaigns, you will need to set a daily budget.
Under Ad Groups set a Max. CPC Bid (USD). Finally, click on the Ads tab, click on the Add Text Ad and add an ad for the newly created camgain (that was a mouthful).

NOTE WELL the liberal use of dynamic keywords *** THIS IS IMPORTANT *** and is the heart and soul of the whole operation - in particular the destination url. If you are not familar with dynamic keyword insertion, check out the post I made about this.
Eventually, you will need to click on Check Changes - this takes some time.
Finally (I think), click on "Post changes".
EDIT: Reading over this, I don't find that I am using broad match and only displaying ads using Search, not Content.
Search Engine Friendly URLs
Or "pretty urls".
In whatever directory on your web server you plan on serving up this database driven results, create a .htaccess file and add the follwing:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+).html?$ search.php?q=$1 [L]
That's it for the .htaccess file.
Template For Results
For this, I will leave up to you, dear reader, to come up with a decent looking template that displays results the way you want them to look like.
I'll show results using a basis template that relies on subsitution for presenting unique content.
Create a file called "template.html" that contains something like this:
<html>
<head>
<title>%%TITLE%%</title>
</head>
<body>
<h1>%%H1%%</h1>
%%CONTENT%%
</body>
</html>
I know, I know, very boring. I'm sure you can come up with a much better looking template. You'll probably want a Terms of Service page, a privacy page, an About page, a contact page, etc.
Notice the %%whatever%% things, those are "tokens" which will be replaced with a value that the search script uses ... a value that is pulled out of the database based on the keyword sent over from Adwords.
A Better Search Script
Remember our php search script from earlier? We are going to modify it to log the keyword(s) along with the date/time, and I.P. address of the visitor along with printing out results that use the template.html page.
Lets start by creating another table in our MySQL database called "visitors" that includes date, I.P. address, search term. Here's the SQL dump to create.
CREATE TABLE `myacc_datafeed`.`visitors` (
`visitor_date` INT NOT NULL ,
`ip` VARCHAR( 255 ) NOT NULL ,
`keyword` VARCHAR( 255 ) NOT NULL
) ENGINE = MYISAM
Now that we have that out of the way, lets modify the search.php script to first log the visitors information. We will add the following near the top of the script after the $keywords = preg_replace("/\-/", " ", $keywords); line.
<?php
$table = "visitors";
$db_visitor_date = time();
$db_ip = "'".$_SERVER['REMOTE_ADDR']."'";
$db_keyword = "'".$keywords."'";
$sql = "INSERT INTO $table SET visitor_date = $db_visitor_date, ip = $db_ip, keyword = $db_keyword";
$query = mysql_query($sql);
?>
Lets change the results from simply printing out the Name (title) to something that makes us money. Instead of echo $row['Name']."
";, lets change those statements to look like this:
<?php
$product_id = $row['ProductID'];
$name = $row['Name'];
$bigimage = $row['BigImage'];
$price = $row['Price'];
$description = $row['Description'];
$results .= "<tr>\n<td valign=\"top\"><a href=\"go.php?n=".$product_id."&k=".urlencode($keywords)."\"><img src =\"".$bigimage."\" title=\"".$name."\" / border=\"0\"></a></td>\n<td valign=\"top\"><strong><a href=\"go.php?n=".$product_id."&k=".urlencode($keywords)."\">".$name."</a></strong><br />".$description."<br />".$price."</td>\n</tr>\n";
?>
And before we display the results, will want to wrap around a table tag.
<?php
$results = "<table>\n".$results."</table>\n";
?>
Now, to display the results, read in the template.html file, make some substitutions and print to the browser.
<?php
// read in template
$filename = "template.html";
$handle = @fopen($filename, "r");
$template = @fread($handle, filesize($filename));
@fclose($handle);
// substitute
$template = preg_replace("/%%TITLE%%/", $keywords, $template);
$template = preg_replace("/%%H1%%/", $keywords, $template);
$template = preg_replace("/%%CONTENT%%/", $results, $template);
// print results
print $template;
?>
Final search.php file looks like this:
Tracking Keywords And Clicks
Ah yes, tracking. How could we possibly forget that. You may have noticed I sneaked in a page called go.php in the results that get printed out. That is a PHP script that (1) dumps the search search term into a database and logs the time, I.P. address of the visitor, the keyword that brought the visitor to the site, and the link that was clicked.
Now we just have to create it.
First, another MySQL table called "clicks" that logs the date, visitor's I.P. address, keyword used to arrive and link clicked.
CREATE TABLE `myacc_datafeed`.`clicks` (
`visitor_date` INT NOT NULL ,
`ip` VARCHAR( 255 ) NOT NULL ,
`keyword` VARCHAR( 255 ) NOT NULL ,
`product_id` INT NOT NULL
) ENGINE = MYISAM
And our go.php script to log the click and redirect to the vendor:
Adwords driven, datafeed generated content
That's all she wrote. Hope that helps you get your head wrapped around the idea of using a datafeed with Google Adwords.
P.S. - Consider checking out James' Double Digit CRT program.
How To Hide Affiliate Link With Javascript
Or "Javascript Obfusticator" with PHP.
Script below will take your affiliate link and obfusticate it.
Just type in the affiliate link that you want obscured, the vendor's link, click "submit" and the script will return code that you copy and paste into your html page.
The PHP script that generates the hidden affiliate link takes each ascii character of your affiliate link, uses an ascii table lookup to find the corresponding decimal representation and makes the substitution.
Note that not all affiliate programs allow or like this "cookie dropping", check with your program before using.
Google Suggest PHP Script
This PHP script uses the Google Toolbar Suggest feature to build - and build on - a related keyword list.
Just type in a keyword, click suggest and get 10 related keywords back.
Now type in another related keyword and the script will return 10 additional results while keeping your previous results.
For this demo, the script includes [br] tags - the paid version of this script does not - plus it allows you an unlimited amount of queries.
Script is for personal use only.
Number queries available: 10
Affiliate Datafeed Site Instructions
Please use the comment section to ask questions about the datafeed site you have.
The help file for getting the most out of your affiliate datafeed site:
Details on HOW your datafeed site works:
Datafeed site technical details
Video showing you how to add articles to your site:
Video showing you how to add advertisements to your site:
Google Adwords Dynamic Keyword Insertion PHP Script
So, you want to be an Adwords rockstar?
Well then, you'll need to wrap your brain around dynamic keyword insertion.
And I'm not just talking about the basics - just using dynamic keyword insertion in your Google Adwords advertisement. I'm talking about playing with the big kids and using those keywords that appear in your Adwords advertisement also on your web page.
That's right, if you are targeting a specific search terms in your advertisement - make that keyword show up on your landing page. Heck, even have it show up as the title and actual url of your page. Now we are talking.
Maybe instead of talking, let me show you a few things to give you the picture. It will all be crystal clear in just a moment ...
What Is Dynamic Keyword Insertion?
Lets say you are advertising using Google's Adwords program. One of the things you provide for your ad is a list of keywords that you are interested in having your advertisement display for.
For instance, if you were selling "kobe beef", you might want your advertisement to show up on Google's search engine page every time someone types in the words "kobe beef" in the search box on Google.
Same goes for someone searching for "kobe steak" - you want your ad displayed.
With dynamic keyword insertion, every time someone types in the exact search term you are targeting, your advertisement would include those keyword - in bold - on your advertisement.
Here's what the syntax looks like:
{keyword:} - will display the search term or not if there is not a match
{keyword: Default} - will display the search term or "Default" if there is problem displaying the search term. Of course, you can replace "Default" with whatever you like.
Some specific details regarding keyword: (source: Red Fly Marketing )
keyword - No capitalization, all word(s) are in lower case
Keyword - The first word is capitalized
KeyWord - Every word is capitalized
KEYword - Every letter in first word is capitalized
KEYWord - Every letter in the first word AND the first letter of the second
KEYWORD - Every letter is capitalized
More details at Google Adwords
How Do You Do It?
Login to your Adwords account. Create or edit a campaign. Create or edit a Text Ad.
Here's an example of what an ad might look like that uses keyword insertion.

Notice that use of the {KeyWord: Default} in the Headline and Description line 1.

This is the important part for getting the search term to show up on your web site. Use the {Keyword: Default} as part of your Destination URL. In this example, I have added my top level domain, http://www.DaveWooding.com/ followed by the keyword insertion expression followed by ".html". Note that I have added a dash, "-", in between my default word.

Display the Adwords Search Terms On Your Page
At this point, somebody clicked on an Adwords ad of yours, something that might look like this:

In this case, the search term is "kobe steak". A visitor that clicks on that advertisement would be sent to this url, http://www.davewooding.com/kobe%20steak.html.
If someone searched for "kobe beef" the advertisement would look like this:

On To Your Web Site
Now that you have setup your Google Adwords advertisement to use keyword insertion, it is time to separate the men from the boys, the women from the girls, the ... you get the point.
Time to play big. You want your site to display an appropriate page for each of those particular search terms. Sure you can do it the old fashion way and grunt it out - create an individual page for each and every possible search term.
Or you can do it the right way.
Using PHP or some other scripting language that allows for extracting information about the referring page - the referring page that uses dynamic keyword insertion. Ding, ding, ding <<<--- important
First, assuming you are working from the top level domain, i.e. - http://www.example.com, you will need to add or modify a .htaccess file to include the following:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+).html?$ index.php?q=$1 [L]
I'm going to assume that if you are reading this far into the article that you are willing to use php files instead of plain html file (otherwise you will need to include additional code in your .htaccess file, specifically "AddType application/x-httpd-php .htm .html").
Very simply, the chuck of code above says to turn on the rewrite engine, reference to the root directory, the rule that follows is applicable if the file or directory referenced does not already exist, then grab all the info after the domain but before the .html extension <- this is our dynamic keyword insertion stuff courtesy of Google Adwords.
Take that information (the dynamic keyword info), shove it into memory - which we will call "dollar one" = $1 and send it over to the index.php file as part of the "q" query string.
You like that techo jargon?
The PHP Code That Displays Adwords Search Terms
... on your site.
As I mentioned, you will need to be using php files for this to work (or you can modify your .htaccess file to accomodate).
At the top of your index.php file, the code should like like this:

This chunk of code checks to see if any information has been passed over via the "q" query string (remember the .htaccess grabbed any info between the top level domain and the .html and sent it over as part of the query string parameter).
If there is info, then that information gets assigned to a variable called $replace (after it replaces any dashes with whitespace - assuming there are any dashes).
If no query string info is present, no problemo, there is a default value set previously - "kobe beef" in this case.

Next a few other variables are set based on the what is in $replace. $title is the same as $replace with the exception that the first character of every word are capitalized. $h1 is the same as $replace except that just the first character is capatilized.

Following the php script part of the index.php file is plain old html code - with the $title and $h1 variables thrown in.

This is how you display the Adwords search terms on your site.
What's Next?
We are only scratching the surface of what is possible here.
Lets just speculate that you have a datafeed that you want to create individual landing pages for that you want to use PPC to drive visitors to. Or you are a Clickbank affiliate that wants to use Adwords to promote products and you want to use the Clickbank datafeed? Or you have an Ebay store that uses a RSS feed from Ebay to display items for sale that could afford pay per click marketing?
What you have seen here is perfect for creating relevant, high quality score landing pages for using Google Awords with.
Stay tuned, or sign up to get on the mailing list, for the next article which will show you how to integrate a datafeed - like SpeedPCC - with dynamic keyword insertion.
PHP script for HTTP response codes
HTTP response codes
Here's a PHP script that checks a web page's HTTP response code.
Submit a web page, click on the button, see the results, and get the PHP code.
100 Continue
101 Switching Protocols
200 OK
201 Created
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
305 Use Proxy
306 (Unused)
307 Temporary Redirect
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported













