An Affiliate Website Anyone Can Build

by on June 9, 2011

Pin It

BuyLegLamps.com screenshotI know a lot of my posts are rather technical, but this one is a bit different. I’m going to show you an affiliate website that anyone can build, and walk you through exactly how I did it.

First, you need a niche. I’ve covered this before, How to Choose an Affiliate Offer to Promote. For this site, it was all about a love (some may say obsession) I have with Christmas and the movie, A Christmas Story.

I met with A Christmas Story House at the recent ShareASale ThinkTank, which boosted this project to the top of my list. (Hear that, merchants? When you meet with affiliates face-to-face, you become a priority to them). What resulted from this meeting is Buy Leg Lamps.

BuyLegLamps.com screenshot

Buy Leg Lamps

Here’s how the site was created, in about 20 hours

  1. Buy the domain name. Don’t spend too long here. I like domains that start with “buy” and then add the product name.
  2. Install WordPress, add theme. For this site, I went with eStore by Elegant Themes. For $39 you get access to all their themes. eStore looked like a shopping site, which is what I wanted to do.
  3. Start adding products, manually. Yep… this merchant doesn’t have a datafeed, so I was manually adding products. As I looked over their products, I came up with my own categories on my whiteboard, then I started populating them. It took a while to figure out the image sizes that the theme wanted, but once I knew, I was able to go through the products pretty quick. I have 55 products on the site, from A Christmas Story House and Amazon.com
  4. Add something more than just products. In this case, I added a YouTube video of the trailer from A Christmas Story

Now I’d be lying if I said I didn’t do any custom programming on the site. There are a few things I wanted to change.

As an affiliate, my goal is to get the cookie set. So, I changed the links to go to through the affiliate link, and not the shopping cart links. You’ll notice my links look like: /addtocart.php?nProductID=218. I wanted the user to think they were buying the product at this site! addtocart.php is simple:

<?php
	define('WP_USE_THEMES', true);
	require_once('wp-config.php');

	$cQuery = "select * from wp_postmeta where meta_key='afflink' and post_id=" . (int)$_GET['nProductID'] . " limit 1";
	$oResult = mysql_query($cQuery);
	if ($rsData = mysql_fetch_array($oResult)) {
		if (preg_match("/^http\:\/\/(www\.)?redriderleglamps/", $rsData['meta_value'])) {
			// If it's a link for A Christmas Story shop, deeplink it
			header("Location:  http://www.shareasale.com/r.cfm?u=132296&b=251080&m=28973&afftrack=&urllink=" . urlencode(str_replace("http://", "", $rsData['meta_value'])));
		} // ends
		else {
			header("Location:  " . $rsData['meta_value']);
		} // ends else from
	} // ends
	else {
		header("Location:  http://www.shareasale.com/r.cfm?B=252579&U=132296&M=28973");
	} // ends else from
?>

I add a custom field to each post called afflink and that’s the affiliate link. Since most of my links where going to redriderleglamps.com, I put in some code to automatically deeplink it.

I also added Facebook’s commenting, so when a user comments on a product, the comment is shared on their Facebook page, and shown to their friends. If you’re using eStore, edit /wp-content/themes/eStore/includes/single-product.php and add

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="http://www.yourwebsite.com<?= $_SERVER['REDIRECT_URL'] ?>" num_posts="6" width="615"></fb:comments>

Then, do a little SEO on the site:

Finally, showoff your site to other Elegant Themes users in their customization showcase and then start getting your backlinks! (BTW, if you liked this post, I’d appreciate a backlink to my Leg Lamp site)

Was this post useful? Please share it with others:

Pin It

{ 33 comments… read them below or add one }

Shawn Collins June 9, 2011 at 11:23 am

Two important questions – do you have a leg lamp and why no Facebook commenting on this blog?

Reply

Eric Nagel June 9, 2011 at 11:30 am

Of course I have a Leg Lamp! It’s only on display during Christmas time, though (Black Friday ’til New Years Eve)

I’m happy with the commenting in Thesis. I also don’t want to lose my current comments. For new sites, I consider Disqus, Facebook, as they have easy plug-ins.

Reply

Shawn Collins June 9, 2011 at 11:34 am

I’ve been considering Facebook comments – it would stink to lose current comments, but I figure most posts don’t get comments after a week or so anyway.

Reply

Logan Thompson June 9, 2011 at 11:54 am

Great post Eric. Just to play devils advocate, what value does this site have to the end user just out of curiosity? Nice looking site.

Reply

Eric Nagel June 9, 2011 at 12:08 pm

Well, I am pulling in just Leg Lamps, and Leg Lamp products. And reorganizing them.

Sometimes it’s not about adding value… it’s about getting the cookie set :)

Reply

Eric Nagel June 9, 2011 at 1:05 pm

Oh, I thought of another value…

There are 10 results in the SERPs. Would you, as a merchant, want to be #1 (merchant site), or #1 (merchant site) and #2 (merchant-specific affiliate)?

Eric

Reply

Amit June 9, 2011 at 12:53 pm

Nice post.
Without a datafeed how do you plan to keep the site current. Won’t you have to manually replace/modify products/pricing/availability info.

Plus the ‘Add to Cart’ button to give the impression that the user is buying from your site can be misleading, from my own experience. Buyers thought they bought from my affiliate site and wd shoot customer service emails/complaints to me. Now I clearly mention ‘Buy from xyz.com’ to avoid the confusion.

Reply

Eric Nagel June 9, 2011 at 1:07 pm

Yeah, when I go to update the site, I’ll probably build a tool to quickly update the prices.

As for the “Add to Cart” button, I want the user to click & get the cookie set. That’s my goal, as an affiliate. If I say “Buy from xyz.com”, the user could just type into their browser “xyz.com” and I don’t get credit for the sale.

Reply

noodles June 9, 2011 at 1:49 pm

looks like a great approach. I may redo some of my sites with a similar template. How long has the leg site been up and what kind of traffic / sales are you getting?

Reply

Eric Nagel June 9, 2011 at 1:51 pm

I “finished” the site yesterday (although I have to add “About”, “Contact” etc to the site)

No idea on traffic, since it just started.

Reply

noodles June 9, 2011 at 1:53 pm

looks slick. I’ve had http://shopmlbjerseys.com/ up for 3 months, it gets lots of traffic, yet I’ve only had a few sales.

Reply

Eric Nagel June 9, 2011 at 2:04 pm

Link the image – also, can you mask/cloak your affiliate links? Right now, it’s clear you’re pointing to Football Fanatics.

Can you add content to your category pages?
http://shopmlbjerseys.com/category/arizona-diamondbacks/

Change “category” to “teams”

I’m giving more feedback like this at my early-morning whiteboarding sessions at Affiliate Summit (yeah, aff. link!)

Reply

imagine June 9, 2011 at 3:15 pm

Its awesome when you can sell something that you love with regards to the movie. My brother and I have been watching A Christmas Story every Christmas since before I can remember and a few years ago we met with some of the cast members in downtown Cleveland (im originally from the Cleveland area) and also visited the house where they took the exterior shots of it in the movie.

Thanks for sharing about your site!

Reply

Brian Jones June 9, 2011 at 5:40 pm

I will be sure to get you that datafeed. So things will run smoothly with little site maintenance on your end.

Reply

Chris Guthrie June 10, 2011 at 2:28 am

Hey Eric,

It’s so cool that you wrote this post because I actually have an epically awesome podcast interview coming up with that guy who bought the A Christmas Story house and he talks about how he slowly built his business from his apartment and how he found the house on eBay and decided to buy it to try and build up his business etc. etc.

Don’t mean to go all self promotional on you lol but I absolutely love A Christmas Story and Christmas Vaction so I tracked the guy down to interview him. I’ll let you know when it’s up and as always great post dude. I love the actionable tips.

Reply

Eric Nagel June 10, 2011 at 7:50 am

Hey Chris – yeah, that’d be Brian (commented above). I was star-struck when I met him (he probably didn’t know that). Having visited the house myself, it was great meeting him.

Can’t wait to hear your podcast!

Reply

Gerald June 15, 2011 at 4:50 am

Hey Eric, i saw earlier that you add a custom field called “afflink”.
Well, i installed a plugin called “Affiliate Link Cookie Maker” and i think it does what you are describing above, and maybe you are using this plugin? Thing is i just can’t get it to work, i’m not tech savvy but it sounds like the same thing you are talking about, but i still can’t get it right. Was wondering if you could explain the it a bit more in the most simplistic way possible :)

Reply

Eric Nagel June 15, 2011 at 6:46 am

Hi Gerald,

No, I’m not using that plugin. What I did was create a new file, addtocart.php (code above) which pulls the value of “afflink” from the postID that’s passed to it.

Try creating a post with an afflink value, then use the addtocart.php script I’ve given.

The preg_match line is just because I was lazy, and didn’t want to keep generating deeplinks, so this takes care of it for me.

Reply

Josh June 30, 2011 at 1:26 am

Any other modifications that need to be changed before creating the addtocart.php? I’ve been trying to get my eStore theme to work like yours by using an affiliate link instead of the cart, but nothing is working. Can you post any other modifications and edits to the theme?

Thanks!

Reply

Eric Nagel June 30, 2011 at 8:10 am

Hey Josh –

The theme needs to be changed to link to addtocart
/wp-content/themes/eStore/includes/single-product.php

If you email me your site, I’ll take a look at it

Reply

Bayar July 8, 2011 at 3:16 am

Sexy leg lamp. It’s funny.

Reply

Hugo July 14, 2011 at 10:58 am

Thanks a bunch for sharing that piece of code, awesome!

By the way; your affiliate website looks so much more appealing than the actual site from the merchant (oops!) They should do a redesign, I bet they can increase conversions on their end quite a bit.

Reply

Trisha Lyn Fawver October 18, 2011 at 3:06 pm

One of these days I’m going to attempt this…

Reply

Bolts December 8, 2011 at 1:48 pm

Nice site! Do you have any Scut Farkus t-shirts? Why not expand the catalog to all things Christmas Story?

Reply

Eric Nagel December 8, 2011 at 4:13 pm

I was thinking about that, but really wanted to focus on the Leg Lamp. I’ve added a few other things this year, and may expand again next season.

Reply

Elwood January 25, 2012 at 4:56 pm

Nice walk through!

I have a question regarding one of my sites that I have using the elegant theme e-store. I have a feed setup from amazon to update the reviews and prices. It updates in its on custom field called amzn_LowestNewPrice, do you know how I have that copy into the e-store price custom field?

Reply

Eric Nagel January 25, 2012 at 7:07 pm

Personally, I’d write a cron that updates the estore custom field with the amzn_LowestNewPrice value. Or have it done each time the product page is called. Or update the eStore template to use amzn_LowestNewPrice. You have a few choices – what you choose depends on how often the prices change, and how much traffic the site gets.

Reply

Elwood January 25, 2012 at 9:13 pm

Hi Eric,

Thanks so much for your reply.
The changes wont be very frequent, maybe every couple of weeks if that. The custom cron function seems like a good idea but I think this may be beyond by level of expertise :-)

Cheers

Reply

Adam February 1, 2012 at 8:49 pm

Would it be possible to get some help setting up the php code you have on my site? I’m not exactly sure where to enter my shareasale affiliate code and product ID. I’d greatly appreciate it if you could help me out.

Thanks,

Adam.

Reply

Eric Nagel February 6, 2012 at 11:24 am

Hi Adam – please see my PHP programmer page at http://www.ericnagel.com/php-programmer

Reply

Austin April 5, 2012 at 9:56 pm

This is awesome. I have been pretty disapointed with the various Amazon affiliate store fronts that I’ve tried and found your site in the Elegant Themes forum. It’s nice to have such a different looking theme as an affiliate store vs. all of the same same type sites out there using the same store builder scripts and themes.

Quick question for you… how are sales going? Are you converting a lot of buyers? I have been an Amazon affiliate for quite some time now and the majority of my success is when referring people through text links. I get very few cookies set from people clicking “add to cart” and conversion rates on actual sales are terrible compared to test links.

If you’d be willing to share how things are going that’d be great.

Thanks for posting exactly how to turn the theme into an affiliate theme. It’s awesome!

Take care,

Austin

Reply

Eric Nagel April 6, 2012 at 8:35 am

Hi Austin –

Sales were great around Christmas, as expected, but have slowed down. Honestly, I’ve ignored the site, but have it on my calendar to get back on it Sept-1.

Reply

Austin April 6, 2012 at 9:24 pm

Thanks for the reply. I’m going to give it a shot for the next product I choose to promote.

Thanks!

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: