phpBay Pro/ WordPress Search Mod

Alright Partner.  This is more talk about leveraging phpBay Pro to make money for you.  If, after reading my previous blog post, "MUST Have PhpBay Pro Mod (FREE)", you are still trying to create eBay niche stores with something besides PhpBay Pro then stop right now.  Forget BANS or any free-ebay plugins that you might have found.  You are just wasting time.  Go, check out PhpBay Pro now.

Now that you are happily cranking out niche stores like nobodies business you might be asking yourself, "Self, wouldn't it be great if people could use the WordPress search function on my site to actually search eBay directly".  That is to say, can we have the search results be presented from ebay auctions instead of links to pages/posts on your site.

Good news, it's wicked easy to do this.  Look for the search.php file in your theme and edit it.  (NOTE: I'm not sure how to make this work with themes that use searchform.php instead of search.php)

Now, look for the following code in your search.php:
<?php if(have_posts()) : ?>

Delete everything from this line up until (and including) the following line:
<?php endif; ?>

Now, in it the place of the delete code, enter the following:

<p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p>
function phpBaySearch($term) {
$keyword = $term;
$category = "";
$text .= '[phpbay]' . $keyword . ',20,' . $category . ', ""[/phpbay]';
echo phpBayPro($text);

Save your new search.php and head over to your site. Type something in the search box and see the majesty and beauty of ebaby search results displayed real purty-like on your site!

I'm hoping to get Hanji, from money-code, into phpBay Pro and then I'm sure he can tell us how to modify themes that use searchform.php to do the same thing.  I'll also post a question in the phpBay Pro forums and I'll follow-up if I get any answers.

For what it's worth, though, if you are using a theme like Arclite that seems to use both search.php and searchform.php, then I've had good luck with

1) backing up the original search.php
2) copying index.php over search.php
3) editing the new search.php, removing the if and else statements related to have_post and replace that entire chunk with the phpBay pro code above

MUST Have PhpBay Pro Mod (FREE)

First off, If you are creating eBay niche stores and you aren't using PhpBay Pro then stop right now.  Forget BANS or any free-ebay plugins that you might have found.  You are just wasting time.  Go, check out PhpBay Pro now.  (Go ahead... I'll wait).  Ok.  Now that we are all on the same page, I'll get on with my story.

See, I was talking with Hanji (from and he was asking me about the Custom ID capabilities of PhpBay Pro.  See, he's a genius who writes all his own stuff so he can do all sorts of cool tricks with PPC campaign tracking, and whatnot, using Custom ID with EPN.  He suggested that I look for a plugin or Mod for PhpBay Pro because surely someone else out there wants the functionality.  Sure enough, I found a great post by Anthony Wakefield on the PHPBay Forums.

Here's what his Mod can do for you:

  • Show you exactly which Search Engines & Search Keywords generate sales.
  • Show you what referring sites generate sales.
  • Incorporates the Previous '12th Parameter' Custom ID, so you can define this as you wish, and it's added on to the search engine and referrer info.
  • Track Adwords or other Ad Campaigns via a referring URL & 30 Day Cookie.

Using his Mod, you can download your Transaction reports from EPN (Make sure and download all events and keep it checked on All Programs) and you'll see the following format in your  Custom ID field.

[KW = Airport Express A1264] - [SRC = google] - [MED = organic]

KW is Keyword, & SRC is Source (ie. yahoo/google/msn)

If you've entered your own Custom ID field in the [phpbay] tag (although, if you had luck with this, let me know, I'm having issues) then you should see ad additional [CID = something] chunk in there.

To use Anthony's MOD you just need to edit your auction.php file.  This should be in the root of your site (it's one of the files you uploaded when you installed phpBay Pro).

Locate the following code:

$ktv["ccid"] = $_REQUEST["ccid"];

and replace it with:

#PHPbay CustomID Mod By Anthony Wakefield - Anteck On PHPBay Forums
# String Splitter
function strbet($inputStr, $delimeterLeft, $delimeterRight, $debug=false) {
$posLeft=strpos($inputStr, $delimeterLeft);
if ( $posLeft===false ) {
if ( $debug ) {
echo "Warning: left delimiter '{$delimeterLeft}' not found";
return false;
$posRight=strpos($inputStr, $delimeterRight, $posLeft);
if ( $posRight===false ) {
if ( $debug ) {
echo "Warning: right delimiter '{$delimeterRight}' not found";
return false;
return substr($inputStr, $posLeft, $posRight-$posLeft);

# If 12th Parameter Set, Format For Use In Referrer Custom ID
if (isset($_REQUEST["ccid"])) {

# Google Analytics Cookie Extraction & Write-Out Referrer Custom ID
if (isset($_COOKIE["__utmz"])) {
$utmz = $_COOKIE["__utmz"];
$garef = '|'.$utmz.'|';

$source = strbet($garef ,'utmcsr=','|');
$medium = strbet($garef ,'utmcmd=','|');
$term = strbet($garef ,'utmctr=','|');

$searchstring = '[KW = '.$term.'] - [SRC = '.$source.'] - [MED = '.$medium.']'.$PRESETCUSTOMID;

# Filter Unfriendly URL Characters
$searchstring = str_replace('_','-',$searchstring);
$searchstring = str_replace('/','-',$searchstring);
$referrerinfo = $searchstring;
$adsearchkw = ' - [KW = '.$term.']';
$adsearchkw = str_replace('_','-',$adsearchkw);
$adsearchkw = str_replace('/','-',$adsearchkw);

# Check For Ad Cookie, If Exists Then Write Into Referrer CID
if (isset($_COOKIE["AdwordsID"]))
{$ADVERT = $_COOKIE["AdwordsID"];
$referrerinfo = '[AD = '.$ADVERT.']'.$adsearchkw.$PRESETCUSTOMID;
# Pass Referrer CID onto PHPBay CCID
$ktv["ccid"] = $referrerinfo;
# End Of Mod

But, Anthony isn't done yet. He also created a system for passing a URL Referrer which then turns into a 30 day cookie. This is a Theme Mod that sets the cookie and if you want to use it you need only to edit your header.php file in your WordPress theme.

What it enables you to do is pass a Referrer ID from your PPC link by appending ?ad=ReferrerID to the end of the URL. When you do this, a cookie is set on the users computer for 30 days. Now, if they come back to the site three weeks later and buy something, you can still see that they originally came in via that ad. Also, it will add the original search keyword used to find the PPC Advertisement.

Here's what some example output:

[AD = ReferrerID] - [KW = refurbished iphone 3gs for sale] - [CID = 32GB iPhone]

So, to use it, edit your header.php (or equivalent file) on your site and add the following code:

<script type="text/javascript">

function geturlvar( name )
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
return results[1];

<script type="text/javascript">

function Set_Cookie( name, value, expires, path, domain, secure )
var today = new Date();
today.setTime( today.getTime() );

if ( expires )
expires = expires * 1000 * 60 * 60 * 24;
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );


<script type="text/javascript">

var adwordsurlref = geturlvar( 'ad' );
if (adwordsurlref>""){Set_Cookie( 'AdwordsID',adwordsurlref , 30, '/', '', '' )


There ya go! I just added mine yseterday so I can't wait to look at my EPN Transaction report today. I'll follow-up with you all once I do, though.

Also, as I mentioned before, this Mod is FREE, but Anthony certainly spent some time on it. If you use it and find that it's working well for you, and saving you some time, please consider a Paypal donation. Heck... just buy the guy a beer, right? "payments at" is the e-mail address you can use to send a paypal donation to him. (just replace " at " with "@", I didn't want him to get spam harvested because of my post)

NOTE: If this formatting is weird for you, then just head over to to see Anthony's original forum post.

Picking a niche for your niche store.

So, I've made a handful of niche stores so far.  At first I was using a free WordPress plugin but I got tired of not being able to search by category, minimum price and so on.  So, I finally bit the bullet and bought Phpbay Pro.  It was $79 and that's a chunk of change, but you can use it on unlimited domains and it's free upgrades for life.  Besides, my time is valuable to me.  So, if I can make more niche stores in less time then it's completely worth the $79.

NOTE: If you do buy Phpbay Pro (or you already have it) something that isn't really in the manual is that you can have multiple keywords by using the "|" pipe character.  So, if you put in "doorknob handles hardware" in for a keyword in Phpbay Pro, you are actually looking for that exact phrase.  That might not be what you want.  You are probably wanting this instead "doorknob|handles|hardware".

Anyway, on my previous niche stores, I picked things that I was already into.  But, these things aren't necessarily good subjects for niche stores.  That is to say, I wasn't doing any research, I was just picking out of a hat, effectively.  What you really need is a way to see what people are looking for on eBay.  Now, there is eBay Pulse,which is pretty cool, but it seems like you can only see hot searches one category deep (unless I'm just missing it somehow).  Also, I don't know how far back the data goes on eBay Pulse.

So, after a little bit of digging around, I found TeraPeak.  They have over two years of eBay research data and you can use it for all sorts of purposes.  That is to say, if you are an eBay seller (as well as an affiliate marketer) then you use their data to know when to sell on eBay. I recently searched 90 days worth of auctions to find the best time of day and the best day of the week to sell some of my old HP DL320 servers.  You can find the best time/date for sell-through percentage or highest price, or try and find a balance of the two.  It's great for this!

But, I think for something like $5 you get access to all the search data as well.  So, now you can look for hot categories, hot searches, hot products, etc.  And you can drill down by category.  So, yesterday I used it to search something like 5-6 categories deep to find the searches that people are most often typing in a particular category.  Then I can create pages using Phpbay Pro where I use those popular search keywords to display auctions related to those searches.  The users dig it because now they can find what they are most likely to be searching for with just a single click.

Still not convinced?  Believe me, I get.  It seems like there is so much software to buy out there.  But, in my opinion, TeraPeak and Phpbay Pro are worth it.  Your niche stores are going to be quicker and easier to build and your niches should be more lucrative if you do the research up front.  But, if you want to see it in action, check out the Terapeak eBay Demo Videos.

Find hot products to sell on eBay

Google Adsense Filtering

Don't be alarmed.  You didn't miss Step 3 in my process to turn up new affiliate sites.  This is just a little side-trip on our journey.  You see, one of my sites relies on user-submitted content and I'm trying to monetize the site using Google Adsense (pretty much exclusively, although some direct ads might be nice as well).  Anyway, because of the way I was displaying the content and the fact that much of the user-submitted text is pretty brief, the adsense ads being displayed weren't really on target for what the site's readers would be into.  Hank, over at, mentioned that he thought there were some filtering options at Adsense, so I stumbled over there to make sense out of it.

Turns out... it's pretty neat!  There appear to be two basic kinds of filtering: Competitive Ad Filtering and Category Filtering.

You can get to Competitive Ad Filtering by going to "Adsense Setup"->"Competitive Ad Filter" on the Adsense site.  From here you can filter your ads by the domain they are advertising.  So, if your vintage doorknob niche store has some adsense on there, you can block's ads from showing on your page.  This is interesting enough, but it's not really what I wanted.  So, I headed over to Category Filtering.

Category Filtering can be reached from "Adsense Setup"->"Ad Review Center".  Here you can filter your ads by category, which is neat.  But, what's cooler is that you can see what percentage each category makes up of your earnings.  It looks like it's more of a snapshot than anything, but it's still interesting.  Especially because one of the things I was going to filter, weight loss ads, turns out to do pretty decent.   For me it was like 4% of my recent impressions but 6% of my earnings.  The other biggies seemed to be "Sexually Suggestive", "Politics" and "Video Games".  Huh?  Politics?

I'm not sure I would filter based on earnings percentage, though, just because these numbers seem pretty dynamic.  But, if Dating is at 5% impressions and 0% earnings over the next few days, I might consider it.  The other bummer is that I don't think you can filter per channel, it looks to be per Adsense account, which is a pretty broad brush to paint with.

The last thing I noticed on this page was "Allow and Block Google Certified Ad Networks".  Hmm... I'm certainly not an expert, but I had never heard of this before.  Apparently by allowing this you can accept non-Adsense ads to be delivered via Adsense.  At least, I think that's what I'm reading.  It certainly seems like a good idea to me so I'll enable that today and let you know how it pans out.

So, back to my story.  Last night (when I first discovered all of this), I wasn't sure which category I should filter to get rid of my "Quit Smoking" ads, so I decided to sleep on it.  But, what's interesting is that yesterday I also completely changed the format of the site in question.  Now, on the main page, I'm displaying 9 user-submitted pictures and excerpts of text (instead of just the latest one) and my targetting problems are solved.  Turns out that this is just enough text to get me the types of ads that my readers are more likely to click.  So, while my Adsense Filtering adventure was fun, it appears that I don't need to do any filtering after all.  Once again, it all comes down to content!

Okey dokey, that does it for my rambling thoughts on Google Adsense Filtering.  Let me know if you have any other good tips or tricks or further clarification.

EDIT: So, I was reading the Google Certified Ad Networks section wrong.  The default is "0 Google certified ad networks always blocked"  So, you get all those ads anyway.  You can opt-out, if you want, but I'm not sure why you would want to.  I also don't know what it was so hard for me to read this correctly the first time.

Step Two: Where to host your new site?

So, last week, in my post, "Step One: You need a domain, right?", I talked about how to minimize your spending when getting your hands on some choice domains.  That's all well and good, but now that you've got these domains, you need somewhere to host these sites, right?

My background is 15+ years in Cisco and Linux consulting so I already had quite a few servers on hand that I could have used to host my new affiliate marketing sites.  However, I chose not to host it on my existing servers.  Why?  Good question!

My existing servers are dedicated physical boxes on which I have root access.  They are very locked down and secure and I audit any and all code that I run on these servers.  I use them for hosting client's websites and typically these are websites that my company (through my brilliant development guy) has created for them.  I wouldn't say that I make any money on the actual hosting, but I definitely break even.  But, it's more important to me that I control the development environment and that I provide them reliable hosting of their site.  Let's say that we developed a site for them and they chose to host that with Joe Schmo's hosting.  Well, if they have a negative hosting experience, they are likely to attribute that (unfairly, maybe) to my company.  I don't want that to happen.

So, since these servers are so locked down and reliable, I want to be really careful about what software I run on them.  And, let's face it, if you are turning up a handful of affiliate sites a month, you aren't as focused on security as you are on QUICK.  You need to turn up sites now.  Now, while there are lots of great content management systems for this (Drupal, WordPress, etc).  I wouldn't exactly give them an A+ when it comes to security.

What would happen if your Vintage Doorknob niche store (running on an outdated WordPress, because you are too dang busy) get's hacked and now your paying web clients are also compromised.  You can't have this happening.  You don't want to risk this steady hosting income because you got sloppy.

But, you NEED WordPress, Joomla or Drupal!  Heh.  That's where Host Gator comes in!  For a meager $7.95/month (on their "Baby plan") you can have:

  • Unlimited Disk Space
  • Unlimited Bandwidth
  • Unlimited Domains

I challenge you to find more affordable hosting.  It doesn't exist.  (but, if you find, it lemme know).  What I love about Host Gator is how quickly I can setup new WordPress sites using Fantastico De Luxe.  It's pretty much the software equivalent of those tiny elves that fix shoes.  Only, they are making WordPress sites for you... not shoes.  C'mon.  Keep up here.

Once you sign up with Host Gator it wouldn't be a bad idea to create some sort of backup/restore plan.  Just because of the cost of the service, I wouldn't be surprised if some of their other clients are less than reputable.  So, you have to be prepared if someone from the Russian Business Network seizes the entire shared server or something else terrible happens.

I use Automysqlbackup to backup all my MySQL databases onto an off-site server and I use BackupPC to backup all of my public_html directory from Host Gator.   This way, if the unforeseen happens, I can quickly get my sites up and running again on another server.

Now, I don't want to scare you.  I just want you to be prepared.  You need to minimize your overhead and $7.95/month hosting for ALL of your affiliate sites is a no-brainer!  Hosting them anywhere else just doesn't make sense.  Order your Host Gator hosting today!