Webtrepreneur.co.za

Earn money online being a Web Entrepreneur

It’s extremely popular to display adverts at the bottom of posts on a blog. The reader reads the blog posting, arrives at the end of the post, and the first thing he/she sees is an advert. If you have optimized your website correctly, the chances are that your advert will suite the topic just blogged about, and this will increase your chances of receiving a click from the user. What happens if you would like to rotate the adverts, so that you are not just displaying Google Adsense, for example, at the bottom of every post?

This is tricky, and I have not seen too many solutions around, so I decided to code my own solution to this problem. Below I will paste some of my code, along with the best description I can put together. I use PHP in this example.

Line    
1 <?php Starts a PHP segment
2 $num = rand(1,2); Randomly selects a 1 or a 2
3 if ($num == 1) If a 1 was selected
4 { then.
5 ?> (turn php off)
6 // advert code here paste your adsense code here
7 <?php (turn php on)
8 } finished with advert if the random number is 1
9 else if the random number was a 2
10 { then
11 ?> (turn off php)
12 // advert code here paste your adsense code here
13 <?php (turn php on)
14 } finish with advert if the random number is 2
15 ?> (turn off php)
     

Alright, now that the code is there, I can start explaining. It looks rather odd and tricky, but really it isn’t, especially if you have any knowledge of PHP. This little code snippet handles two different affiliate programs, and displays them randomly under your blog posts. I hope my explanation above was helpful, it is not easy explaining code so that everyone will follow.

Copy and paste the above code into notepad, and save the file as randomad.php. Once you have done this, all that is left, is placing it on your website, which will be done with this code:

<?php include(’randomad.php’); ?>

If you are a wordpress user, here are the steps to place this code correctly, so random adverts appear under each post:

1. Login to WP-Admin
2. Click Presentation
3. Click Theme Editor
4. Click Main Index Template, on the right of the screen
5. This is where things get tricky, now you need to look for the end of your posts code. Normally you would see something about comments or links to technorati or permalinks, you would place the code under that. Each theme is different so it is hard for me to tell you exactly where it goes. A common occurance is this..

</div>
<?php endwhile; endif; ?>

Which you should be able to find in the Main Index Template, if you see this then place the <?php include(’randomad.php’); ?> line of code right above the <.div>, like this..

<?php include(’randomad.php’);?>
</div>
<?php endwhile; endif; ?>

6. Save the changes by clicking “Update File”, and go back to your website and refresh, wallah.

If you have any questions about implementing this, please feel free to contact The Webtrepreneur! Best of luck!

  • 0 Comments
  • Filed under: Adsense, Code

  •               

    One of the key factors to running a successful blog is making contacts and friends. Not a day goes by where I meet new people online, who also blog, who are keen to learn, share knowledge and link up. Creating your own kind of cummunity creates an excellent opportunity to have people returning to your website.

    When someone places a comment on your blog, there is a good chance they will return to have a look and see if someone has commented back. If you run a blog, make sure you write back to comments visitors leave. This opens up the website to discussions, which often lead to new visitors via word of mouth. A busy blog is often a successful blog, people are like sheep, they learn and copy others, and therefore if your site has regular commenting, your chances of others commenting are higher, thus increasing your returning visitors.

    Blogging communities are a great place to meet other bloggers. MyBlogLog is probably the most popular place at the moment when it comes to blogging communities. The website is packed with hundreds of little goodies, including the widget on the right hand side of my website, which shows who has been visiting my website. When you see someone new visiting your website, give their ‘face’ a click, head on over and take a look at what they blog about, and leave them a message saying thank-you for visiting my blog - this shows interest, and the chances are, the person will revisit your blog at some point after receiving your message.

    Once you have made a couple friends, you can suggest a link exchange with them. If they are a regular or fairly regular reader of your blog, and enjoy swapping ideas with you, the chances are they will be keen to do a link exchange. I have talked about link exchaging and its importance before, you cannot go wrong with this friendly approach, both parties score.

    All in all, blogging is about sharing - sharing adventures, sharing knowledge and creating new ideas. Go out, meet some people with similar interests, learn from them, link to them, and watch your traffic increase steadily.

    footer.png

  • 3 Comments
  • Filed under: Get Traffic

  •               

    We all want to find out the tricks of the trade when it comes to getting your website ranked with the popular search engines. There are so many different ways to do this, and one which cannot be forgotten about is using a robots.txt file to let search engines know that you have agreed to let them crawl your website.

    The process is very straight forward, create a text file and name it as robotss.txt. Once you have done this, all you need to do is add one line of text to the file, as shown below..

    Sitemap: http://www.yourname.com/sitemap.xls

    Then save the file, and upload it to your website. As simple as that - create, point, save, upload!

    Using Google webmaster tools, like I talked about in preparing your website Pt2 is still a good idea, there is no hard in using both methods, the Webtrepreneur reckons it’s probably best to do both methods!

    You can read more about the use of robots.txt here.


                  

    Submitting your website to search engines is one way to drive traffic from external sources to your website, but there are many other ways, which do not require asking people to link back to your website.

    Two services which I have been using to do this are, DIGG and Stumble. I cannot even start to stress enough about how valuable these two services are for website/blog authors! I have had thousands of hits to this website thanks to Digg and Stumble, and I am going to tell you now how to go about using them.

    DIGG

    To put it simply, Digg is an article posting and rating service. You post your articles on Digg for the public to read, and if they enjoyed the site, they can hit the Digg button. The more Diggs you get, the higher your article will rise in popularity. Another great feature about Digg is it’s category breakdown system - You can choose exactly where your article would fit in, so if you are like me, Webtrepreneur, I would submit my articles into the Technology - Internet News sections.

    The easiest way to get your article submitted on Digg is to include a button under your article, like I have done. The code for your article would like something along these lines: <a href=”http://www.digg.com/submit”><img src=”digg.jpg border=”0″></a> This will allow people to submit the article for you as well. If you are a regular article writer and think Digg is the way to go, they also provide a great set of tools, which make it easier for you to allow people to Digg your articles, have a look at the Digg tools. They offer services such as:

    • View recent stories from Digg on your personalized Google homepage.
    • Allow your site’s visitors to digg your stories from your website, and submit your stories to Digg.
    • See Digg articles at the top of your Google search results.
    • Enable submissions from your site to display video thumbnails on Digg.

    All in all, Digg have a lot to offer, and should not be ignored!

    STUMBLE

    Stumble, or more correctly named Stumbleupon is fantastic! Peronsally, I have had more success from this service than any other service online, and at the same time I have had a lot of fun, I will explain how.

    Stumbleupon is a website/blog submission website, whereby you submit you website/blog into their database, and once you have done this people can stumble upon your website via a toolbar plugin for firefox. Similar to Digg, you submit your website, choose the various categories, and that’s it. The code to link your article to the Stumble engine is a bit more complex than I showed with Digg..

    http://www.stumbleupon.com/submit?url=http://webtrepreneur.co.za/free-advertising-blogvertisecoza/&title=Free%20Advertising%20-%20Blogvertise.co.za?

    The beauty of the system is the fact that, once you have an account with Stumble, they will generate the above code for you, so you don’t need to worry too much about what I pasted above. Create an account, and take a look now.

    Alright, the fun part about Stumble. When you signup for an account, you can choose a list of things you enjoy. Once you have done this, you can download the firefox plugin and start stumbling. Basically, you have three buttons in the the plugin. The first is the stumble button, which once clicked, will take your browser to a random website, based on your interests. Once you have arrived at the website, this is where the other two buttons come into play: “I like”, and “Don’t like”. If you like the website you were moved to by Stumble, then you click the “I like” button, and the stumble engine includes it into your personal profile, and if you didn’t enjoy it, you hit the other button. Stumble learns your preferences, and each time you Stumble, you will find that you enjoy the random sites more and more. I plugged in my interests, and have been using Stumble for a good couple of months, and almost every 1 out of 2 websites, I find myself wanting to bookmark!

    Don’t ignore these services, they have proven to be incredible traffic drivers for most of my websites, and The Webtrepreneur would not only mention two of the many engines like this if he didn’t really have faith in them!

    Happy Stumbling, and I hope you find something you Digg!

  • 0 Comments
  • Filed under: Get Traffic

  •               

    Sponsor


    Make Money


    Archives


    Sites


    Sponsors