DPoisn - Custom Banner Ads - a tutorial

Return to demos index page

Share on Facebook Post about this on BlueSky Tweet about this on Twitter Post about this on Treads
Share message
Join our Discord Share on LinkedIn Share on Reddit pinterest Email this to someone

A question I see come up a lot is, "How do I monetize my site without AdSense?"

This is an excellent question. Because it really is getting more and more difficult to use ad services like AdSense at all. To be sure, there IS no other ad service like AdSense. They dominate the market to an absolutely absurd degree. Every website that you see ads on is running AdSense. Well, except for sites with a lot of junk traffic like cryptocurrency sites, and those that would make your mom blush.

The biggest problem with AdSense now, from a content creator perspective, is that it's getting more and more difficult to get approved. Many of my sites have been around for so long that my approval was done YEARS ago. And even I have a hard time getting new sites approved. Take this site, Daily News Pick by DPoisn LLC, for example. I never got a reason for why it was denied. Probably because the bulk of the content is provided by RSS feeds, so not original content. But I still wanted to monetize it.

There are a few other ad servers out there that essentially do the same thing that AdSense does. But all of them require massive traffic, or a high Alexa ranking. Massive traffic means like 5000 unique visitors a day. Alexa Ranking is a system that will tell you where your site stands compared to every other site on the internet. If your site is not ranked in the top 100,000 or so, you don't get approved.

The bottom line is that I needed to come up with an alternative to ad services, and start taking matters into my own hands.

To the heart of the matter...
It IS possible to run ads on your site that you generate 100% on your own. You don't owe anyone anything, or have to follow any strict rules.

My solution was to create a bunch of ads for my own sites, like my hosting site, or cryptocurrency blog, or referral links for things like Coinbase and Robinhood. Once I had the graphics made, I just needed a quick way to show those ads with the matching link.

If you look at the DailyNewsPick site I have listed above, you will see that going from page to page, the ad is usually something different. I have like 5 or 6 ads that run from a random rotator. Since it is just a collection of PHP files, I have this implemented across most of my sites.

Let's see the code
All right. The program starts with one very simple PHP script that chooses a random number, then uses a switch statement to then "include" whatever PHP script matches that number.

Create a new file called "randombanners.php"

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php 
$chooseAd = rand(1,4); 
//$chooseAd=4; 
switch ($chooseAd) { 
    case 1: 
        include('includes/mobilead_coinbase.php'); 
        break; 
    case 2: 
        include('includes/mobilead_robinhood.php'); 
        break; 
    case 3: 
        include('includes/mobilead_google.php'); 
        break; 
    case 4: 
  	include('includes/mobilead_brave.php'); 
        break; 
    default: 
        include('includes/mobilead_robinhood.php'); 
}
?>

For each of the possible include files in your randombanners.php, you will need to create a new PHP script that is essentially a really small HTML file, fully formed. All of mine look like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<style> 
.calloutCont{ 
	background-image: url("https://durbnpoisn.com/images/banner/300x50_banner_robinhood.png"); 
	width:320px; 
	height:50px; 
	position:fixed;  
	bottom:0px;  
	left: 50%; 
	margin-left: -160px; 
	text-align: center; 
	z-index:3000; 
	cursor:pointer; 
	} 
</style> 
 
<div class="calloutCont" onclick="navToMobile('https://share.robinhood.com/kennetl950')"> 
</div> 

<script>	 
function navToMobile(where){ 
	window.open(where); 
} 
</script>

That is the banner for my Robinhood Ad. It generates a graphic with a link, that looks like this:

The script has all the parts necessary to make a small banner ad and place it.

The style section sets the image backdrop, size, and sets the position to be fixed at the bottom of the page and centered. The HTML section creates a div and makes it clickable with a call to a JavaScript function. That function will open a new window to whatever URL you pass in from the div. For all of your banners, you would replace the URL in the navToMobile call.

If you want to see what this whole thing looks like implemented on an actual page, you need to look no further than the bottom of THIS page. The ad that shows up there is using the module described in this tutorial. And you may notice something that I left out. Even though this tutorial is all about how to avoid the need for Google's AdSense, this site is running AdSense. In the PHP block above, you will see an entry for "mobilead_google.php". That script contains the code for AdSense. So Google AdSense is in the rotator. I mention this because this tutorial is not intended to be a replacement for AdSense exactly. If your site is approved, you can run their ads AND your own ads.

You can set up the random list to be as long or as short as you like. And if you want certain ads to show up more frequently than others, just make an extra line in the switch statement.

To implement this code:
Create a folder on your server called "includes". Upload your PHP scripts to that folder. Any page in which you want to show these banners, simply add the line:

1
<? include '/includes/randombanners.php' ?>

Where do you get those affiliate or referral links?
Good question. There is actually an easy answer to this question. I wrote about this sort of thing on my cryptocurrency blog, and created a page of banners, all of which are excellent starting places. You would need to follow one of those, create your own account, and follow their links to get YOUR referral link. Once you have that, you can use it to create a banner ad as described in this tutorial.

You can also do a Google search for "affiliate marketing", where you will find sites that pay you a commission for sales made from ads you run on your site. There are limitless options for this sort of thing.

I hope you find this tutorial useful! Now go make some banners!

bottom corner