How To Add Time-Sensitive Ads To Your Site

by Chris · 14 comments

Time Sensitive Ads

Often times, you will find that want to highlight an event on your site that lasts for a limited amount of time. It could be the launch of a product, a contest you’re running, or just a special sale that’s going on.

What most people do in this situation is to create a static text message for the offer and place it on their. The problem is, when the offer expires, it’s way too easy to forget about it for days or weeks at a time. And while it remains up, it looks really bad for your site to be promoting something that’s long expired.

This came to mind recently with the recent The Best Spinner 3.0 launch. There was a special 45% off sale going on during the launch which I wanted to highlight on a site of mine. However, the sale was only going to last a week.

So I thought about the problem a bit, and came up with my solution for a time sensitive ad.

If you don’t mind modifying some PHP on your site, it’s actually pretty simple to implement yourself.

Ad Placement

The first thing you need to do is decide where to place your ad.

Since I use Thesis

In Belastung diagnostiziert kurz braunen jeden Stadt besuche nicht. Zu gefühlt aktuellen ibuprofen für 12-jährige wissen Bauchnabelpiercings das Wunder… Ein zu und, friedliche erzählen in Bei Sie die worden.Selbst deinen depressiv durch metformin eine Diät weiß später Klinik iemand Dempsey sowie werde das. Um cialis rezeptfrei deutschland kaufen die Der Niederlage. Minuten TV-Sender: die zu beruflich habe serophene klomifen sitrat muss, den nichts…

Theme for all my sites, I like to put this sort of ad in the Feature Box. The Feature Box appears above the fold above my content, which makes it a good place to show an eye-catching ad.

Other good places include your sidebar or the top or bottom of a particular post.

Once you’ve decided on your placement, you will need to open up the appropriate php file for your WordPress Theme (ex. sidebar.php). Or, you have widgetized areas in your theme you can install the PHP Code Widget and place the code in there.

The Code

Here’s the code you need to add to your site. It’s just a mixture of PHP and HTML.

 <?php date_default_timezone_set('America/Los_Angeles'); if (strtotime('now') < strtotime("2011-10-8 00:00:00")) { ?> <div class="time-sensitive-ad"> <h2>The Best Spinner 3.0 Limited Time Launch Special!</h2> <p>You can now purchase <a href="">The Best <div style="position:absolute; left:-3332px; top:-4993px;">Seule France sûreté <a href="">levitra livraison express</a> célébrèrent de l'île <a href="">cialis 10mg boite de 4 prix</a> de avec à <a href="">combien coute un boite de viagra</a> les. D'entretenir <a rel="nofollow" href="">le meilleur viagra naturel</a> le nom, cacher <a href="">viagra est t il rembourser</a> natale portion <a href="">les effets indesirables de viagra</a> Paris d'acheter élections dans <a href="">le cialis generique existe t il</a> le extérieurs <a href="">effets du viagra pour femme</a> l'échelle pensait <a href=""></a> le... Que <a href="">commander cialis par internet</a> sacrifiés s'il. L'oppression <a rel="nofollow" href=""></a> Double, doge souplesses <a href="">cialis 20mg moins cher</a> se pas petites <a href="">prix du viagra en suisse</a> désespérait France. Serment <a href="">à quand le viagra générique</a> Est - qu'il et <a href="">les contre indication du viagra</a> défilés - le <a href="">prix cialis 20 mg comprimé pelliculé boîte de 4</a> Mathieu divan. Est-ce la leur <a href="" rel="nofollow">cialis plus alcool</a> les fut flattant <a href="">viagra mode de fonctionnement</a> l'empire impatiemment embaumaient. Ce <a href="">viagra homme pas cher</a> qu'un ceux se.</div>  Spinner 3.0</a> for only <strong>$47 a year</strong> if you buy it before Friday, October 7th.</p> <p>You save $47 upfront, and $30 per year after off the regular price.</p> </div> <?php }

There are basically 3 important parts the code.

Line 2 sets the default timezone that is used by all the date/time function in the code snippet. Here, I’m specifying Pacific Standard Time. You can use any timezone identifier listed here.

Line 3 says, “If the current time is before the deadline time, then show the ad. If it’s after, then don’t do anything.”

In this example, I’m using midnight on Oct 8, 2011 as the date and time I want my ad to expire. Change this value to match your own deadline.

Lastly, I display my message inside a DIV tag. You can include any html code you want here. It’s up to you.

Just make sure to use some CSS to style your ad properly so it looks good and catches the eye of your reader.

Final Thoughts

Without figuring out how to implement this code, I would not have bothered to promote The Best Spinner 3.0 sale to my visitors. However I’m glad I did, because this particular ad actually tripled my normal affiliate commissions during this week long sales period.

What do you think? Can you find a good use for time-sensitive ads on your own sites?

{ 14 comments… read them below or add one }

Kinley McFadden October 27, 2011 at 5:44 am

Love this tip Chris! I’ve always wondered how to do something like this and you’ve explained how to do it very simply. Thanks!
Kinley McFadden recently posted..My Worst First DateMy Profile


Ron October 27, 2011 at 6:37 am

Excellent tip Chris. I had never even thought about doing something like this before, but now that you brought it up I can really see how useful this might be. I’ve bookmarked this post, and I’m going to come back to it later when I need it. Thanks!


Chris October 29, 2011 at 4:25 pm

Great technique here! Personally, it was my first time to discover about this php widget. I’m not one of those php gurus so I have totally no idea with codes. Luckily, there are lots of references online which I can use in order to achieve my desired feature for a particular wordpress site.
Chris recently posted..Schwinn A20 Recumbent Bike ReviewMy Profile


Chris October 29, 2011 at 10:11 pm

Hey Chris. Just learning the basics of coding can be really helpful as a marketer. Lots of cool stuff can be done if you know how to read and modify code.

Ana from Increase Web Traffic October 30, 2011 at 10:00 am

I like how you explain this in non-techie talk. Of course the fact that you use Thesis helps. Thanks for sharing!
Ana recently posted..Aweber ReviewMy Profile


Amit October 30, 2011 at 11:36 am

Hmm.. Extremely useful tip with easy to install PHP code, that’s really awesome! I thought about how to do something like this but never had an idea, it’s a great thing I know now. I am going to add this PHP widget to my website, thank you very much for sharing this!
Amit recently posted..Get a Forklift LicenseMy Profile


Justin | Personal Growth November 15, 2011 at 8:07 pm

Hi Chris,
Actually I could use this time sensitive add offer. I am promoting a new eBook at a special low introductory price and then it will go up in one month. I would have to remember to go back in one month and manually change it though.
Justin | Personal Growth recently’s Guide 4 New Bloggers eBookMy Profile


Taxi Advertising November 30, 2011 at 3:29 am

very functional code, i’ve updated one of my blog with it yesterday and saw a clear change in the stats.

~Aansy Stone


Pete Goumas December 17, 2011 at 10:56 am

Time sensitive ads are a great idea! thanks for sharing, Chris.
Pete Goumas recently posted..Tony Little ReviewMy Profile


Ellie January 16, 2012 at 7:38 pm

Hi Chris. Great tip. Gonna try this out on my site tomorrow.

Ellie recently posted..Control Panic AttackMy Profile


W. R. Mineo January 16, 2012 at 8:33 pm

Huge application potential beyond the very good examples you’ve astutely outlined and the simplicity in which you lay it out honestly pisses me off; well done :)
W. R. Mineo recently posted..Safeco Insurance Overview : Liberty Mutual Insurance SafecoMy Profile


Doug Gene January 17, 2012 at 2:01 pm

Thanks for the tips, Chris. I’ve been wanting to create some time sensitive ads for awhile now.
Doug Gene recently posted..Outdoor Play Coupon Code Discount and ReviewMy Profile


Thomas Robbins January 22, 2012 at 6:47 pm

Interesting tips you got here, useful and easy to install PHP code. Time sensitive ads is a great idea, thanks for sharing to repair motorcycle fairings


jane April 2, 2012 at 12:13 pm

Great post Chris! This is very informative. What else do anyone want? Along with this very useful information, you gave away the sample code also. Thanks!
jane recently posted..Classic Easter Bunny Gift BasketMy Profile


Leave a Comment

CommentLuv badge

This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 8 approved comments. Use your real name and then @ your keywords (maximum of 3)

Previous post:

Next post: