Database driven affiliate websites

Get The Most From Your Affiliate Datafeed Site

... "or what do I do now"

Seriously, this short little report is about how to get the most out of your newly created affiliate datafeed site.

Contents

What These Sites Do
What Are Tokens And How Do I Use Them
How Does The Cache Work
How Do I Modify The Template
How To Add Articles

What These Sites Do

You have a database driven affiliate site that uses a datafeed from Nature Hills.

You make a commission, 15% of the sale's price, whenever a visitor from your site clicks to the Nature Hill's site and makes a purchase. Additionally, Nature Hills will "cookie" that visitor for a full year.

This means that if that person comes back and purchases within the next - even if they don't come from your site - that you will earn a commission.

Like that?

So do I.

Your site was created by one of my two sons using PHP scripts that I created.

First, they logged into your website's CPanel account and created a MySQL database to store the datafeed information provided by Nature Hills.

Then they uploaded the PHP scripts along with a subdirectory that is used to cache pages created by the script.

Permissions were changed on the subdirectory and a couple of files.

Next, a script was run that asked for information about your site; title, if you want to cache files or not (they said "yes"), how long you want to cache pages (default is 7 days), MySQL database, user, password, and table, and ShareASale id # (six digit number).

The last script was run that actually loaded up your MySQL database with the 4,000+ items from Nature Hills.

If they created a site for you using the default template, then they created a basic header image that included the title to your site.

If you had a custom template, then that's where I stepped in. I copied the template in the template.php file on your site and adjust the tokens so that everything looked like it should.

What Are Tokens And How Do I Use Them

Most people do NOT need to know anything about "tokens" and can safely skip this section.

If you are one of the people that want to modify the look and layout of your site, then you will need to understand what tokens are and what to do with them.

For our purposes, tokens are used for as a placeholder for information you want to show up on a particular part of your web page.

For instance, if you want an article to show up near the top of your web pages, you would place the %%ARTICLE%% token in the template.php file near the top.

If you want a search box to show up at the bottom of the page, there is a %%SEARCH%% token that is available to use.

The other tokens - and the purpose of each:

%%TITLE%% - This is a placeholder for the title of that particular page. For instance, if the page you are at it http://www.example.com/red-apples.html, then the title is "Red Apples".

%%SITETITLE%% - The site title. This gets used as the anchor text for your site in any link back to your home page of your affiliate site.

%%HOMEURL%% - Similar to the site title, this is the actual url of the home location of your affiliate site. If you site is in the root of your web server's directory, then %%HOMEURL%% would be http://www.example.com/. If your site is in a subdirectory, then http://www.example.com/subdirectory/. If a subdomain, then http://subdomain.example.com (by the way, when I use example.com, I make using that as a placeholder for your particular domain :)

%%URL%% - Reserved for future use.

%%AFF_LINK%% - The affiliate link to the vendor's site. It actually is a cloaked link that hides the fact that you are linking through ShareASale to the vendor, in this case, Nature Hills. There is nothing illegal or blackhat about doing this.

%%IMAGE_LINK_TEXT%% - Shows a product image that the vendor supplies. Also hyperlinks that image so visitors clicking on the image are directed to the vendor's site.

%%PRICE%% - Price of the product.

%%PRICE_LINK%% - Reserved for future use.

%%ARTICLE%% - Article is shown where this token is used.

%%DESCRIPTION%% - Product description provided from the vendor's datafeed.

%%OUTDESCRIPTION%% - Description on an out of stock item from the vendor's datafeed. This is very much an optional token, one that provides additional content. Some people consider this spammy.

%%MENU%% - A list of links to the major categories provided by the vendor

%%ADVERTISEMENT%% - The title is misleading, but it is the only thing I could think of :) This reads in the contents from a file called advert.php which you can add whatever you want. I know this is very open ended. But the possibilies are endless. Use this to display Google Adsense or an email capture form. For this to work, you need to add content (i.e. - Adsense, autoresponder, etc.) to the file on your site called advert.php.

%%KEYWORDS%% - Reserved for future use.

%%OTHER%% - Reserved for future use.

%%BREADCRUMB%% - A link or links that leads back to the home page of your affiliate site.

%%SEARCH%% - Search box for affiliate products that searches the database for instock items related to the search query.

To use these tokens, you need to edit the template.php file on your affiliate site and place the tokens where you want the substituting content to display. Does require some understanding of how html works.

Note well: If you are testing the look of your site with tokens, be sure to turn off the caching ability so that you see the most recent version of your template ... see the next section for instructions.

How Does The Cache Work

The "cache" saves the recently loaded page to a subdirectory on your site so that the next time it is viewed, the file is loaded from the subdirectory rather than from the database.

Two reasons for doing this.

First, if your site becomes popular - and when I say popular, I mean really popular like 10,000+ visitors a day - then creating a page from the database every time can be a burden on your server. Serving up static pages previously created and "cached" reduces the server load.

This should not be an issue for 99.99% of the people - though it would be a great problem to have :)

Second, caching saves the page so that the next time it is loading it is exactly the same. I say this, because the way THE SCRIPT works is on ever page load (from the database), the layout is ever so slightly different. The sentences in the description might be ordered differently, the link to the vendor might use different text. Caching the pages keeps the content relatively consistent over a period time (default it 7 days).

If you are making changes to the template.php file - which controls the look of your site - you will want to turn the cache off. To do so, you will need to edit the config.php file on your webserver and change the value of $cache from "on" to "off". Save the config file.

Once satisfied with the results, you can go back to the config.php file and change back to having the cache on.

Finally, last item with regards to the cache. In the subdirectory with the cached files, you can delete all of the cached html files if you want to start off fresh. This is especially useful if you have made any changes to your template.

How Do I Modify The Template

The most important thing ... ready?

MAKE A BACKUP COPY OF THE TEMPLATE.PHP FILE BEFORE YOU DO ANYTHING.

(Did I make myself clear?)

This will potentially save a lot of heartache after you do a bunch of changes that don't work out as your expect. I usually rename the template.php to template.php.bak.

Modifying the template for your site is an art. You need to understand html and how the html tags impact the look of your web pages.

Edit the template.php file (AFTER YOU MAKE A BACKUP COPY).

(There I go again yelling)

This is where you get to make use of the tokens previously mentioned.

My recommendation is to start small. Make one change to the template.php page, then go back to your site, reload the page (you turned off the cache, didn't you?) and see what it looks like. If nothing broke, go back and make another change, reload the page, check for errors. Repeat.

How To Add Articles

The question I get asked the most ... and this is where you can make your site stand out even more.

I'll explain by way of example.

Say you want to have an article about herb gardening on your site.

You would write an article, put it in a plain text file, and save it as "herb-gardening.txt" on your computer. Next, you need to upload it (FTP) to your web server.

A few important points: what you name the file has to be the same as the page you want it to show up on. In this case, the contents of "herb-gardening.txt" will display on the page http://www.example.com/herb-gardening.html". When this page is called (herb-gardening.html), THE SCRIPT will read in the contents of herb-gardening.txt and load this article into the database for use now and in the future.

Notice that the words in the file name are separated by a dash ("-"), that's important. You can't use an underscore or any other character to separate words. Capitilization does not matter.

Where this article shows up on the page depends on where the %%ARTICLE%% token is located in the template.php file. By default, for every installation we did, an article will display just below the title of the page.

If you are planning on using PLR material like Tiffany's PLR Articles here's a recommendation for you ...

For instance, Tiff provides an article called "Benefits of Growing Your Own Herbs". Do NOT use that title as the name of your article file. Simplify the text file name to something more generic like "herbs.txt" or "herb-benefits.txt". The way THE SCRIPT works with an article is that it will also search for related products to display. I can almost promise you that it won't find anything about Benefits of Growing Your Own Herbs, but it will find items for sale related to "herbs" or maybe "herb benefits".

Get Tiff's PLR articles by CLICK HERE.

This should be enough information to get you started on using your new gardening affiliate site.

Post questions in the comments section. Don't be shy - if you have a question, it is likely that some else has a similar question. Thanks.


Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Sphinn
  • Mixx
  • StumbleUpon
  • MisterWong

9 Responses to “Get The Most From Your Affiliate Datafeed Site

  • 1
    John Leith
    May 3rd, 2008 17:51

    Hi Dave,

    The site your boys set up for me is fantastic. The only thing I'm missing is the search feature, could that be incorporated?

    I had a look at "template.php" and opened it with notepad, put in the %%SEARCH%% token, but when I saved it the coding looked different so I passed on that idea. What text editor do you suggest for saving a backup?

    Also, with regard to the article function, I have an article section on my site so I'd effectively be posting any articles twice. What do you suggest that I do, take out the article section and upload to the store or maybe link the current article pages to the store in some way.

    I've posted this here in case others have similar questions, I'll also post this on support.

  • 2
    Handy Gardening Tips
    May 3rd, 2008 23:07

    Hi Dave

    Is it possible to add an rss feed from the site - maybe there is one there already and don't see it.

    Thanks

    Kevin

  • 3
    admin
    May 4th, 2008 06:28

    Hi John,

    The search feature can be incorporated.

    Like you I use notepad. Note sure why the code would look different. Definitely do not want to use Microsoft Word as that program seems to throw in some interesting characters.

    Probably don't want to double post an article. Linking to your store from the current article pages would be recommended.

    Dave

  • 4
    Tom Brownsword
    May 4th, 2008 08:07

    Hello Dave,

    A few questions / comments.

    First, would putting the Google search box on the site work OK? Any comments regarding this approach?

    Also, do you have a recommended robots.txt file to put on the site (and if so, would it go in the webroot)? I noticed a few 404 errors and they were all for robots.txt

    And finally, I wasn't getting any traffic at all to my site, so I simply wrote a short article about the site on one of my blogs and included a link to it. I did this yesterday, and when I checked back today, Google had crawled 381 pages already! It's a start... others may want to try this. I'm going to do some other stuff today to drive some traffic.

    Best regards,
    Tom

  • 5
    admin
    May 4th, 2008 08:52

    @John,

    The search feature can be incorporated as you mention - by adding the %%SEARCH%% token to the template.php file.

    I use notepad on my PC to save files (most certain don't use Microsoft Word as it has a tendency to add strange characters). Note sure what you mean by "the coding looked different" ... did saving the file remove all of the newlines (carriage returns). As long as you have a backup that you can copy over if needed, give it a try.

    For your article situation, I would add a link back from your current articles to individual pages in your store.

    Dave

  • 6
    admin
    May 4th, 2008 08:56

    @Kevin,

    I like what you are thinking - I have considered the same. At this time, there is no RSS feed for the site. Creating one wouldn't be difficult.

    What I don't want to do is create a feed that contains all 2,000+ products (very easy to do, but does that make sense - thoughts???).

    I was thinking a better way might be to have THE SCRIPT go through the cache directory and grab the file names and time stamp and build a RSS feed based on that info. Basically, build a feed for only those pages already created that way ever person has there own unique RSS feed..

    This will be on the wish list.

    Dave

  • 7
    admin
    May 4th, 2008 08:59

    @Tom,

    Fairly certain a Google search box on your site would be fine - no reason THE SCRIPT won't display results.

    robots.txt file is advisable, though not required. Upload an empty robots.txt file in the same directory as THE SCRIPT.

    Thanks for the useful tip regarding getting traffic to the site. And as you know, leaving comments on blogs with a link back to your site also helps.

    Dave

  • 8
    Handy Gardening Tips
    May 4th, 2008 21:57

    Hi Dave

    I think your suggestion about the cache directory is a good one.
    Also the video on adding articles made the whole process simple to follow and understand. Thanks

  • 9
    Create a Garden
    August 9th, 2008 16:55

    Hi Dave,

    When there is a long page displayed on the site the menu disappears off the sidebar, right down on the bottom left hand side of the background.

    This may be because there is another menu on the template. My original thought was to have the affiliate site as part of a garden site.
    So 2 questions
    How to I stop this menu problem for now?
    What would be the file that I would link the site to if I did make it part of a larger site?

    Barb

Leave a Reply