Deliver targeted ads to visitors using WordPress

This is the Targeted Ads Approach

Wouldn’t it be great if you could plop a targeted message in front of visitors eyes, and increase conversions??

SEE HOW EASY IT IS TO DELIVER TARGETED ADS!

Do you have a site with a broad central topic, and lots of sub-categories, where you display ads? Sometimes you wish you could deliver an ad based on the category, tag, or even the sidebar. It’s pretty easy to do, and in this scenario it involved a bit of HTML and some PHP conditional statements.

First, the PHP. Let’s begin by displaying an ad on a post by categories.


Replace this text with the html to display the product for Copywriting Basics

Replace this text with the html to display the product for Copywriting Creativity

Replace this text with the html to display the product for Copywriting Freelancing

Place the html code for the product you want to display on all other categories. Leave this blank to display nothing on all other categories.

In the “Replace the html…” sections, we will do just that. Let’s put together some code to do that.

Sample HTML:

This is the Targeted Ads Approach

Wouldn't it be great if you could plop a targeted message in front of visitors eyes, and increase conversions??

SEE HOW EASY IT IS TO DELIVER TARGETED ADS!

Of course, I’d recommend flushing that inline CSS out and attaching it to a div class, but you get the idea. You can change up the wording, affiliate link, and image for each snippet you insert.

But wait, there’s more. Here’s an example of how to do the same things, only using your sidebar:


 
 
  
  
 


The above example is more or less using the same code as what I outlined in a previous post, creating multiple sidebars.

In this case, you would insert the HTML snippet wherever wanted it to appear on each sidebar file. Once you have a sidebar you can load it by the category name/id.

Mike

Michael Meisner is a code-slinging, data crunching, growth hacking extraordinaire. He combines these powers to create traffic generation strategies and drive brand awareness for clients he works with. When he's not staring at a computer screen he can be found sipping a glass of wine with his Pit Bull and wife by his side.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Attract more visitors

Get the latest blog updates, and email exclusive content that shows you how to:

  • Attract targeted visitors to your site
  • Engage those visitors in creative ways
  • Move visitors down the buying funnel
  • Find profitable niches to pursue

NOTE: I will NEVER spam you with cheesy promotions or share your information with anyone.