PDA

View Full Version : Ad serving - my latest code project



andymoore
10-13-2010, 09:38 AM
My historic background

In a former life I used to manage the advertising inventory for radio stations*. I'd scheduled well over a million pounds worth of airtime in one year and won an award for my skills in socio-economic-demographic targeting**.

If Coke wanted X thousand 22-45 year old females to hear their latest ad they book it with that demographic target, the ad system knew from RAJAR (audience research data) roughly 'who' was listening when. It was my job to get the ad in the ears of the right listener at the right time with the right copy.

More recent background:

I'm not that happy with current ad serving options for my website or my mobile sites, many here will have heard me tear holes in ad providers so I've decided rather than be negative and slate things I should do something positive about it instead. Such as write the software to get the best bits from the other systems and leave the other stuff out.

For example I found Mob Partner to have poor results when applied site wide to all traffic irregardless of the geographic regain visitors are in; however they've got some amazing offers in Malaysia, Australia and Germany so I want a system I can feed the best bits from each ad partner and only show the good stuff. I've got zero options myself for monetizing South African traffic for example so I might as well try to make good of each and every visitor in whatever way I can.

I want and need much better control over my ad inventory!

I started working on a solution yesterday that had been bubbling around in thought form for several months.

Introducing the concept behind as yet un-named ad system

It will work for both websites and mobile websites.

Shows IAB and MMA specification ad formats as well as support text links.

Has built in geographic awareness so it will show German visitors ads that pay out on German traffic.

Has built in value awareness of the call to action so ads that pay more are shown first.

The primary aim of the system is to show the right ad to the right user at the right time. I've seen some ad agencies using that term today but first used it myself back in 1997 and I'm sure another Traffic or Sales Manager coined it years before me.

How it does what it does:

1) Detects the country the user is in - requires some kind of IP lookup system, I'm using MaxMind's binary database and the mod_geoip Apache Module to do this though I'll probably add support for a method or two.

2) Detect if the user is on a mobile or not - requires my detect mobile browsers code though if used with Device Atlas or Wurlf could be used to only show ads in specific dimensions; hence my use of MMA specification ad formats.

3) Select ads from the database for that type of device in that country.

4) Rotate the ads evenly with the highest valued ads shown first

5) If no ads are live for that criteria it will revet to showing either house ads or use a backup solution like Google or AdMob.

Commercials can:

1) Run every day
2) Run certain days
3) Run every hour
4) Run between certain hours
5) Be live, suspended or terminated
6) Run from a certain date allowing you to schedule ads in the future
7) Expire after a certain date or be allowed to run for ever

I should be able to set up an ad that runs on Christmas eve at 18:00 through to 23:59 that says 'Santa is coming' for example. Of course 18:00 here isn't the same as 18:00 in the US so I've got to take that into consideration.

Having timing in there also means I can slip some more naughty ads into the mix but only between the hours where I feel it's suitable and there's no minors browsing.

So far I've setup the database structure and am propagating it with initial test data. Actually adding the data is taking me longer than setting up the database schema as I'm yet to write the admin panel for it which will make it much easier to manage the inventory.

There's a table for channels (sites) partners (advertisers) copy (ads) formats (AIB / MMA standard sizes) and countries (ISO codes) I'm thinking how best to make a log to report back which ads where shown when but on a large site this could become data intensive and sluggish.

It should in theory let you manage the ad inventory for all your sites from one place.

I want to make it very easy to install, very easy to add channels, partners and manage ads and a very simple integration to actually show an ad.

It will be a simple PHP function you can call and the code will be released either for free with me getting some back links; ads or something out of it or it'll be available for a few bucks***.

Any thoughts, comments or suggestions would be most welcome.

It needs a name for example and if you can contribute any other great ideas into it I'm all ears.

Thanks

:)

* Yorkshire Dales Radio, Minster Sound Radio Group (Minster FM, Yorkshire Coast Radio) and Oak FM
** KATZ International Radio Sales Traffic Newcomer of the Year (1999) actually they made that award up for me.
*** I'm developing this for my own needs if anyone else is using it there's got to be something in it for me!

:)

*james*
10-13-2010, 10:26 AM
My thoughts:

Sounds like one of the mobile Ad Optimizer platforms (Smaato, Nexage, Ad Whirl) ?

I do agree that somone needs to plug in CPA offers into the mobile ad mix a bit better e.g. mixing up mobpartner with mobile ads for the best yield. Sounds like that is the most interesting opportunity. Especially as no-one can monetise countries like Malaysia with CPC based mobile ad networks - getting CPA right could be a big win.

Converging across mobile and online interesting but question is will you be able to do a good enough job optimization inventory across the two platforms? They both have different characteristics in terms of what works and online there are 10000s of ad networks and affiliate platforms now to potentiall work with.

Great to see the Andy M creative force in action anyway - sure something great will come out of it :smile:

noonoo1
10-13-2010, 10:43 AM
Sounds amazing Andy, I read more later this evening

andymoore
10-13-2010, 10:54 AM
@james - thanks and yes I'm hoping it will handle the multi platform aspect pretty well so in addition to creative sources like the banner and text links it also needs to handle JavaScript and HTML. Cool. Added to my mental specification....

@noo thanks dude!

noonoo1
10-13-2010, 11:11 AM
Will I be able to sell ads on this, say I wanted to sell a estate agents ad on my geo site. So rather than sell them an ad for £285 a year I could do page impressions for say .50p a 1000 or .22p per click.
I'm slaving away in a kitchen so cannot read the full post.

andymoore
10-13-2010, 11:25 AM
I've just added two extra values to the ad_copy table, one being maximpressions so you could sell 1000 or 10000 or 100000 impressions and so on for that ad and maxclicks so you could also sell a set number of clicks.

So yes you should be able to sell impressions and clicks however at the moment it'll be set on an ad by ad basis.

If you want an ad to run in Germany and Austria it will need to entries in the database, one for each, you'll be able to set the limit on each ad rather than on that advertiser as a whole unless I add some limits to the partner table and work out how to cross reference the whole lot.....

I'm not planning on integrating commerce functionality to it but if the back end can support limiting how many times and ad is shown it just leaves getting the money of the clients on your shoulders!

:)

gogo
10-13-2010, 11:31 AM
Interesting, looking forward to it.

Didn't Admarvel.com come here with an ad platform? Then they got bought by Opera.

andymoore
10-13-2010, 11:40 AM
@go thanks and it sure looks like it on their site.....

I've got a few ads in there already but not even touched my text editor to start coding this thing yet; just been getting all the relationshps and ideas forumulated first....

:)

morency
10-13-2010, 12:07 PM
OK .. you are the best :)
WIll be open source ? Or we can pay like for your detect mobile script ?:)

andymoore
10-13-2010, 12:31 PM
The milk of human kindness ran dry a long time back, don't get me wrong but what's the point in giving something away for free, I'm not after a sainthood, I'd rather have money so yes it will be commercial in nature but just how it'll be so I'm not sure of yet.

miellas
10-13-2010, 03:15 PM
Awesome project Andy. Mobile genius at work again. Looking forward to seeing the end result and to be able to have the right resources in one outlet rather than serving different code from different agencies.

coast
10-13-2010, 03:36 PM
Andy, it's great to see you excited about mobile tech again. I'll be interested to see how you structure this, whether it will be contextual and therefore compete with Google, if there will be publisher payots, or if it will be something publishers can licence and put on their sites with a payment system for publishers to directly bill advertisers on their sites.

Of course, all your criticisms of other ad platforms will come home to roost as we now expect only the absolute best from you ;)

Scandiman
10-13-2010, 04:43 PM
Sounds very interesting Andy, you've hit on many things I care about already, one more thing to consider is somehow filtering mobile devices that support https. Being as Lodging is an ecommerce site, phone capability to connect for CC transactions is important for us and I would guess others as well in our situation.

Also I appreciate good granularity in selecting ad run times/dates. Certain hours of the day convert better on certain days of the week, and while I'm not to this level yet I suspect different days of the month (closer to typical paydays like the 1st and 15th) convert better than others for some products.

andymoore
10-13-2010, 05:41 PM
@miellas - Thanks!

@coast - Thanks and oh dear, I've gone and set a standard that folks now expect from me.....

As the Gin Blossoms sang in Hey Jealousy: "If you don't expect too much from me you might not be let down"

No there are no plans to go contextual with this at all. That would involve having to read the page the ads are being shown on to work out what the page is about before cross referencing it and it makes my head hurt even thinking about it!

;)

As for publisher payouts, nor am I planning in turning it into a transactional platform.

You'll be able to take a payment through whatever means but not this software then manually create a partner and assign them ads with a timed lifespan or to only show a certain number of impressions or clicks. It could be used to sell ad space but I'm not planning on writing in payment processing or advertiser sign up or campaign creation like that.

If selling clicks or impressions it occurs to me that some kind of click fraud prevention needs to be in place. I'm also thinking search engine spiders will add to impressions and clicks so I won't increment those figures if the 'visitor' is a robot.

@scandi Thanks! Supporting HTTPS isn't something I'd thought of; identifiying which handsets support that will require either the WURFL or Device Atlas.

It's well outside the scope of my needs so isn't going to make it into this version but maybe once this thing is done and dusted I'll start selling customisation services so it's not all bad news on that idea.

Thanks folks!

:)

Scandiman
10-14-2010, 12:38 AM
Re https, you're of course correct, it's a big reason why we went with DA to manage our users in different ways regarding device security, plus naturally adjusting presentation.

andymoore
10-14-2010, 10:38 PM
Time for a little progress report:

Late night last night, not working but watching the Chilian miners rescue: inspirational in that it goes to show what can be done with willpower and determination!

So far:


Databases all set up (minus the logging)
Made a start on the admin application
Written the basic authentication to log in
Found a nice looking user friendly template in valid code
Written add, edit and delete channel
Written add, edit and delete partners
Written list of supported formats with examples
Created list of all the countries supported

To do:


Add more system formats - scrapped see next point
Add support for adding, editing and deleting custom formats - done
Pagination on channels and partners
Write add, edit and delete an add
Add support for spinning the text in text links
Add support for nofollow: true false - added to database
Integration code
Calling ads, click logging, not logging dodgy clicks.....
Loads more I have and haven't thought of yet.....

If I'm going to be detecting mobiles with my code to detect mobiles I might as well also take it an optional step further by adding support for detecting where the user is with my location detection code.

In other words, having an ad system that shows ads for people in the US to people in the US is one thing, having an ad system that can target people down to the street their on is another.

It hit me in a flash: if I can find out the latittude and longitude of a user it would be handy to be able to add a center-point latittude and longitude to the ads database with a proximity value so when I request an ad with a lat and long it will try to find not just the best paying ad to show but the one that's the nearest to the user.

noonoo1
10-14-2010, 10:50 PM
I'm looking forward to seeing the completion of this Masterpiece of code.

Great idea to use centre point feature!

Truly inspirational.

:biggrin:

andymoore
10-15-2010, 10:29 AM
@noo - Thank you!

A few screen shots to show the progress from the last few hours:

1) Your Channels (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Manage%20Channels_1287138117067.png)

2) Add Channel (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Add%20new%20Channel_1287138137228.png)

3) Your Partners (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Manage%20Partners_1287138158976.png)

4) Add Partner (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Add%20new%20Partner_1287138172521.png)

5) List of Ad Formats (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Ad%20Formats_1287138196023.png)

6) Add Format (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Add%20new%20Ad%20Format_1287138215187.png)

7) List of Supported Countries (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Supported%20Countries_1287138256404.png)

8) Your Ads (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Your%20Advertisments_1287138314215.png)

9) Add New Ad (http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Add%20new%20Ad_1287138364081.png)

Little by little it is coming along!

noonoo1
10-15-2010, 10:39 AM
Hi Andy, links not working for me on my iPhone.

andymoore
10-15-2010, 10:47 AM
Thanks dude, give it another shot it should already be sorted, I've just been able to see them on my iPhone.

I owe a lot to the person that did that admin template (http://indeziner.com/resources/freebies/free-css-templates/free-htmlcss-jquery-admin-panel-inadmin/), it would look so vanilla otherwise!

andymoore
10-15-2010, 02:00 PM
@scandi - I listened!

HTTPS support now added to the database, I suppose the ad_copy database can have any number of fields in it like lat and long, HTTPS and so on it's only being used when ads are being called and if you already know if the device supports HTTPS you'll be able to set a value that returns ads that require a user with a secure connection.

This is the full screen shot from the 'Add New Ad' script, please excuse the default template logo on there.....

http://cdn.andymoore.info.s3.amazonaws.com/adserver-screenshots/Add%20new%20Ad_1287148169369.png

Options when creating an ad:

Channel
Partner
Country
Lat, Long and Proximity
Value
Start stop dates
Start stop hours
Weekdays
Ad Format
Title
Anchor Text / Alt Text
Markup
Image URL
Click URL
No Follow
HTTPS
Max impressions
Max clicks

I'll put some work into making that user more user friendly but am more concerned right now with things I might have overlooked.

Any further suggestions please? I'm all ears!

Thanks

gogo
10-18-2010, 08:34 AM
Hi looking ahead ads themselves may become more dynamic - here is a tool looking at this from an advertiser's point of view
http://www.eyewonder.com/technologies_dco.php

Scandiman
10-18-2010, 02:21 PM
@scandi - I listened!

HTTPS support now added to the database, I suppose the ad_copy database can have any number of fields in it like lat and long, HTTPS and so on it's only being used when ads are being called and if you already know if the device supports HTTPS you'll be able to set a value that returns ads that require a user with a secure connection.

Well done Andy, did you go with WURFL, Device Atlas or something homebrew to make it happen?

andymoore
10-18-2010, 02:32 PM
Thanks folks, @scandi nothing too geeky done on this end, if you use wurfl or da you already know so it'll just be an option you set when calling the ads.

ChinaMobi
10-18-2010, 06:20 PM
Very interesting idea. It's an area I need to learn more.

hecto
10-19-2010, 08:30 AM
Yep, your project sounded like another ad networks like admob, mojiva, mobgold, etc. What do you offer in this project compared to other ad network ?

andymoore
10-19-2010, 09:48 AM
Hecto, it isn't an Ad network therefore by default its very different.

andymoore
10-19-2010, 10:49 AM
I'll answer that properly now I'm on full power thanks to enough cups of coffee.

Ad networks like AdMob and so on allow you to put their code on your site to show their ads.

In the past I've run AdMob and MobPartner with a fully global run of site, AdMob in some countries isn't worth showing nor is MobPartner. I want to show the best paying offers available to my visitors and not waste ad impressions showing ads with lousy performance.

For example, here in the UK ads for AdMob don't payout enough considering it's my core target market, that means that if MobPartner or someone else has an offer to promote that is worth more I want to push that. If there's not an offer worth enough to promote I want to show my ads with link juice as that's worth more to me than a poor performing ad.

Another example: My German revenue on AdMob is cents yet a partner there is offering to pay me $10 for every paying customer I send them. I want to show the ad that will make me the most.

Neither AdMob of MobPartner give you control over the inventory you show to the degree I want hence this was born.

The Ad Server / Ad Platform is very different.

What I'm building is something where I can:

Add one, many or all of my sites or sub-sections of my sites as advertising channels.

Add MobPartner and any number of CPA affiliations as partners.

Add AdMob and other mobile ad agencies as a fall-back.

I can then create an ad from the CPA copy and load it on to my ad system, when someone visits my site the ad server will look at where they are, then look at which ad pays out the most for that country and show them that. On the second view they see the ad that pays the second best, on the third (or any) view if there isn't a CPA offer to promote it will fall back on either my own in-house ads or, as a last resort use someone like AdMob depending on preferences.

A good example of another use would be adult stuff. I don't want to give adult ads a full run of my site, I want to target them to a specific section and only between certain times. No ad agency gives you the tools to do that. No ad agency lets you pick and choose the best bits from offers all over like that. No CPA agency lets you mix in other CPA agency results either; not from what I've so far. Sure I've seen folks who let you have fall-back ad partners when they can't fill the inventory but what happens when the ad they want to show isn't worth showing and another partners is? They don't let you put someone else first, only last.

AdMob and co are in the business of buying and selling ad space, this project is to help me manage which ads I show to which user.

Hope that helps you understand better what it is I'm trying to build.

hecto
10-22-2010, 07:57 AM
I'll answer that properly now I'm on full power thanks to enough cups of coffee.

Ad networks like AdMob and so on allow you to put their code on your site to show their ads.

In the past I've run AdMob and MobPartner with a fully global run of site, AdMob in some countries isn't worth showing nor is MobPartner. I want to show the best paying offers available to my visitors and not waste ad impressions showing ads with lousy performance.

For example, here in the UK ads for AdMob don't payout enough considering it's my core target market, that means that if MobPartner or someone else has an offer to promote that is worth more I want to push that. If there's not an offer worth enough to promote I want to show my ads with link juice as that's worth more to me than a poor performing ad.

Another example: My German revenue on AdMob is cents yet a partner there is offering to pay me $10 for every paying customer I send them. I want to show the ad that will make me the most.

Neither AdMob of MobPartner give you control over the inventory you show to the degree I want hence this was born.

The Ad Server / Ad Platform is very different.

What I'm building is something where I can:

Add one, many or all of my sites or sub-sections of my sites as advertising channels.

Add MobPartner and any number of CPA affiliations as partners.

Add AdMob and other mobile ad agencies as a fall-back.

I can then create an ad from the CPA copy and load it on to my ad system, when someone visits my site the ad server will look at where they are, then look at which ad pays out the most for that country and show them that. On the second view they see the ad that pays the second best, on the third (or any) view if there isn't a CPA offer to promote it will fall back on either my own in-house ads or, as a last resort use someone like AdMob depending on preferences.

A good example of another use would be adult stuff. I don't want to give adult ads a full run of my site, I want to target them to a specific section and only between certain times. No ad agency gives you the tools to do that. No ad agency lets you pick and choose the best bits from offers all over like that. No CPA agency lets you mix in other CPA agency results either; not from what I've so far. Sure I've seen folks who let you have fall-back ad partners when they can't fill the inventory but what happens when the ad they want to show isn't worth showing and another partners is? They don't let you put someone else first, only last.

AdMob and co are in the business of buying and selling ad space, this project is to help me manage which ads I show to which user.

Hope that helps you understand better what it is I'm trying to build.

sorry didn't really get it at first, hope your project went well. :D

andymoore
10-22-2010, 11:14 AM
No worries, I'm still working on it but it is going well.

Since the last update here I've been busy getting it to behave as I want.

Here are all the options on the add and manage Ads screen:


Ad Status

Only visible once an Ad has been created. Lets you pause, suspend, terminate and resume an Ad.

Ad Essentials

Channel: Which site is section of a site do you want to schedule this Ad for
Partner: Which partner do you want to schedule this Ad for
Country: Which country do you want to show this Ad in, select 'All' to go global
Title: A name to identify this Ad internally
Ad Format: What type of Ad do is this
Anchor / Alt Text: The wording of a text link or image alt text, supports text spinning format
Image URL: Optional: What is the address for the image to be show with this Ad
Click URL: Optional: Where the visitor should be taken after clicking this Ad
Revenue Model: CPA (Cost Per Action) or CPC (Cost Per Click) or CPM (Cost Per iMpression)
Value: If this user converts what is this Ad's call to action worth to you

Start and Stop Daypartings

Start Date: When do you want this Ad to start being shown
Stop Date: When do you want this Ad to stop being shown, set 'No Expiry' for a never ending Ad
Start Time: What time should this Ad start running
Stop Time: What time should this Ad stop running
Week Day: Which days of the week do you want this Ad to go out, set 'Everyday' for run of week

Performance Targets

Max Impressions: Set this to 0 to never expire or set how many times this Ad should be shown
Max Cicks: Set this to 0 to never expire or set it to how many times this link can be clicked

User Targets

Demographic: The socio-economic-demographic to target towards:

A - Upper Middle Class
B - Middle Class
C1 - Lower Middle Class
C2 - Skilled Working Class
D - Working Class
E - Lowest Level Subsistence

Gender: Defaults to none,optionally allows you to target towards different genders
Age Range: Defaults to none, allows you to optionally set the age range of people to target

Advanced Settings

Latitude and Longitude: Optional: The geographic point you want to target users near
Channel: Optional: How far away from that geographic point do you want to target users
No Follow: Do you want to pass 'Link Love' / 'Page Rank' / 'Link Juice' when shown
HTTPS Only: Should this Ad only ever be shown to devices which support HTTPS / SSL

Still a lot of work to do on it at this end but it is looking nice and behaving the way I want most of the time, there are a few little issues I'm working on but once they're all done I'll be adding Ads to the system followed by putting it live on my busiest site to see how it goes.

Am starting to think I've put too many hours into this and the logic behind it is too smart to just give it away for anyone to use.

andymoore
10-22-2010, 11:17 AM
Another screen shot for creating an Ad.
http://cdn.andymoore.info.s3.amazonaws.com/create-ad.png

ChinaMobi
10-22-2010, 06:23 PM
Andy, because I have no experience with CPA, CPM, etc, it's hard to grasp the scale of your project, but I'm slowly getting to understand what you want to achieve. Basically, instead of letting Google and other ad serving systems dictate the use of the allocated space on your website, you want a system to decide how to best utilize that space. Right?

It may have a huge potential as a paid service. Just image the number of people who want to maximize the revenue they can generate from their websites.

andymoore
10-22-2010, 07:57 PM
100% right!

GijsZePa
10-22-2010, 09:42 PM
Andy. Smart as ever ! Great project ..

andymoore
10-29-2010, 01:29 PM
Hi all,

Just a quick update on this:

Now serving ads, well over a thousand test impressions so far just to make sure things are working right.

It looks like most of the things mentioned here have now been written into it and tested, the back of it has been broken for sure!

The coolest thing by far in my own over inflated, over rated and self depracating opinion is being able to serve ads for places that are near to the user.

I've just seen an ad on my tests for the Costa coffee at the end of the road followed by another coffee shop a few hundred yards further away.

I took my latitude and longitude from the free scripts at http://locationdetection.mobi/ and got the co-ordinates of a couple of places near to me, put it all together and bingo: proper cool stuff.

The mathematics in this SQL is mind-boggling:

((ACOS(SIN(52.77106800 * PI() / 180) * SIN(latitude * PI() / 180) + COS(52.77106800 * PI() / 180) * COS(latitude * PI() / 180) * COS((-1.20688700 -longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515)

I owe all of that to Mike Zupan (http://zcentric.com/2010/03/11/calculate-distance-in-mysql-with-latitude-and-longitude/) who saved me many many hours of headaches.

I always thought of 'geo advertising' as being able to target a user in a country, all well and good for broad campaigns but I now consider 'geo advertising' as being able to pin-point where a user is and serve them ads for places that are close.

Still a lot to do.....

ChinaMobi
10-29-2010, 06:10 PM
Oh boy, I have "returned" most of my math knowledge to my teachers. (I even majored in pure math in my first year in university.)

On a side note: Hey, your bio is very personal and upfront. I like it. (One link led to another and I found myself reading your bio on http://andymoore.info/). The only line that completely loses me is:

To sum me up: I'm an autodidactic INTJ but then I can also be an ENTJ depending on who's home that day; I have no idea what you are talking about.

think
10-29-2010, 09:00 PM
Oh boy, I have "returned" most of my math knowledge to my teachers. (I even majored in pure math in my first year in university.)

On a side note: Hey, your bio is very personal and upfront. I like it. (One link led to another and I found myself reading your bio on http://andymoore.info/). The only line that completely loses me is:
I have no idea what you are talking about.

Me thinks Internet junkie or Entertainment junkie :D

think
10-29-2010, 09:03 PM
BTW Andy congratz on the progress. The technical aspects are over my head but it sounds like the geo ad marketing concept is coming together for you. Very impressive.

andymoore
10-30-2010, 11:22 AM
@china:

Autodidactic = self taught

INTJ = Introverted, Intuitive, Thinking, Judgemental
ENTJ = Extroverted version of above

http://en.wikipedia.org/wiki/Myers-Briggs_Type_Indicator

@think = also correct on both counts!

--

Progress update:

Now written the function to call ads, trying to keep it as easy as possible so it'll be something like this:


<?php

include('ad-call.php');
$ad_call = array(
'channel' => '1', // id of the channel / site you're showing ads on
'country' => 'GB', // show ads from this particular (or any) country
'type' => '29,28', // id or comma seperated ids for the format
'model' => 'CPA' // what revenue model is this ad spot: CPA, CPC, CPM
);

echo ad_call($ad_call);

?>

Calling ads that target a user with co-ordinates is just as simple:


<?php

include('ad-call.php');
$ad_call = array(
'channel' => '1', // id of the channel / site you're showing ads on
'country' => 'GB', // show ads from this particular (or any) country
'type' => '29,28', // id or comma seperated ids for the format
'model' => 'CPA', // what revenue model is this ad spot: CPA, CPC, CPM
'latitude' => '52.771321', // the latitude of the user for geo ads
'longitude' => '-1.207809' // the longitude of the user for geo ads
);

echo ad_call($ad_call);

?>

The only difference between the two is that the latter will also mix in any ads that are near the user.

Coming along.....

newdomainer
10-30-2010, 11:03 PM
Nothing short of heroic effort Andy! :adore:

I think you could be keeping yourself in clover for quite some time if you get this one up to speed! :coo2l:

andymoore
11-04-2010, 08:19 AM
@newdomainer thanks!

A little update:

Php function to serve ads written.
JavaScript function to serve ads written.
Additional include and exclude filters written.
Now has support for custom functions as fallback ads.
Installer script written.
Admin ip address not logged on views or clicks.
Blacklist of dodgy ip addresses to ignore.
No logging of views or clicks for spiders and robots.
You can now set a minimum value of an ad spot to exclude lower valued ads.

Getting much much nearer to getting installed on my heavy traffic site!

:)

noonoo1
11-04-2010, 11:49 AM
I soo looking forward to see your baby up and running!

andymoore
11-05-2010, 12:31 PM
Thanks folks!

Been thinking about how I license this thing for a while now.

My detect mobile browsers code is 100% open and as such is being used on thousands of commercial sites who technically speaking should have paid me to upgrade. The honesty box model only works with honest people; at least some do exist!

As such I've decided that I'll be licensing this on the following model, or something similar:

1) Downloading the files and 90 day test license will cost $0.01 or something stupidly small, that way I get to know who is using the software and where it is being used. 90 days is long enough to get to grips with it, thoroughly trial it and hopefully become dependent on it as a viable ad serving solution!

2) Some core files are going to be encoded using ioncube, inside the encoded files will be the code to read the license file and verify the install is legitimate. The script will come with ioncube loaders.

3) If the license isn't found, the install doesn't match the license or the license has expired the software will cease working.

4) To upgrade to a full lifetime license for that version of the software will cost more dollars

As much as I initially didn't want to encode any of the project I want a return on my time investment and the best way to ensure that is to make sure I don't get ripped off and make it so that only licensed sites can run the software.

Question time:

1) Anyone got any thoughts or suggestions on the model above.

2) I've spent a fair bit of time on this now and going by the self-manifesting project spec in this thread what do you think is a good, fair and reasonable price for both me as a seller and those who are buying?

noonoo1
11-05-2010, 01:56 PM
I will be looking to use this on all my sites.

andymoore
11-08-2010, 02:17 PM
Another week and another update:

Made the installer work on older version of PHP 4.4.7 as well as a more recent 5.2.14 - quashed a few bugs to make it more flexible over different versions of PHP.

Bought Ioncube Encoder so I can encode some of the scripts to build in a licensing model as explained a post or two back.

Worked out how to work with Ioncube both here, on the server and in the scripts.

Here's what is done so far:

Simple Ad Management System v1.0

Feature list:

Create and Manage:

An unlimited number of Channels
An unlimited number of Partners
An unlimited number of Ad Formats
An unlimited number of AdsAd Creation and Management:

Ads can target a country of have global scope
Support CPA, CPC and CPM revenue models
Set Ad value
Monitor Ad efficiency with Click Through Ratios
Select from IAB or MMA formats or use a custom format
Be shown in specific environments: mobile, desktop, iPhone, iPad
Ads can be either graphic, text-link, JavaScript / HTML or multimedia
Be scheduled to start and stop in the future
Can be scheduled to only run certain hours of the day
Be set to never expire
Ads can run every day, a certain day, alternative days
Expire after a set number of clicks or impressions
Target to a demographic, gender or age range
Target to within a mile of the user's location
Pass 'Link-Love' / 'Page Rank' or hold it back
Target secure or non-secure capable browsers
Show your own Ads or public service Ads with your House AccountAd Display:

Show your Ads on any of your websites
Total control over how you place your Ads
Simple Ad serving or advanced targetting
Simple PHP or JavaScript functions to show Ads
As easy to integrate as Google AdSense
Highest value Ads shown first
Dynamic rotation cycles through Ads by value
Show Ads from one or many formats
Include or exclude Partners
Set a minimum value for each Ad slot
Set country, demographic, gender and age filters
Location aware sites can show local Ads targeted to within a mile of the user
Set fallbacks so when there's no Ads agency Ads or custom functions are used
Administrator views not logged
Robot / Spider / Automated requests not logged
Blacklist IP addresses to ignore and not log
Repeat clicks not logged
Impressions and clicks ignored once threshold has been met
Realtime Ajax log monitor
Automatic purging of logging database
Custom onlick functions like Google Analytics or custom JavaScript functions
To come:

Add support for User ID in ad serving to bypass cookie logging
Create XML feed into showing Ads - requires logging of user iD noted above first
Video tutorialsThat final point of video tutorials should help make it easier to work with, I've got a microphone here and a premium screencast-o-matic.com account so I'll put something together.

I was hoping to have it releasable this week but I keep tweaking things and adding new features so it's a little behind but I reckon it'll be available by next year at the latest, that covers my butt and buys me time!

:)

I feel this is really starting to come together now after many many code and thought hours.

Ladies and gentlemen this is your final curtain call for feature suggestions!

pilot
11-08-2010, 03:10 PM
Ladies and gentlemen this is your final curtain call for feature suggestions!

The only other feature that I'd like to see is your code being able to create a cup of coffee for me and change the amount of milk that it adds depending on my mood for that day. Your code does everything else, why not coffee?! Well done Andy! :adore:

gogo
11-14-2010, 09:43 AM
Hi sounding good here.

Was looking around and found this which also offers white label services http://www.01pages.com/

Not sure its relevant, but they offer geolocated campaigns.

andymoore
11-14-2010, 11:03 AM
@pilot thanks. make coffee is on the future features list, probably version 7.3 at the earliest! It'll involve custom hardware: a multi-talented coffee machine with built in GSM modem, wireless networking chip, x10 (awesome home automation stuff) and a static IP address. You'll be able to either send it a text message saying what you want to drink like mocha or double espresso and it'll make it, the wireless and IP address means you'll also be able to send it HTTP requests and have it make coffee on demand. X10 is a home automation protocol which can be computer controlled and would do the hard work in response to texts and HTTP requests.

It is possible. No, really it is!

:)

@go thanks, I like the concept of that site but think the execution is appalling to the point where I'm not inspired to contact them.

Is it just me or do they look (when you have a bit of a sniff around at them) to not really be going anywhere?

andymoore
11-14-2010, 01:25 PM
A big step forward! It finally has a name!

It will be called 'Ad Senator' and I just got the .com on a five year reg.

The name came to me in a flash whilst sitting at Hill Street at the Market in Amsterdam on Friday. You can't beat getting away from it all and chilling 'Dam style for a bit of inspiration sometimes!

Main reasoning for the name is that it has the word ads at the start for happy SEO URLs; senators being those who govern and this software having a primary function to govern which ad is shown to whom, when and where - it all seemed to make sense to me...

:)

andymoore
11-15-2010, 01:11 PM
Now it has a name of Ad Senator (http://adsenator.com/) it hit me that often is the case that whilst a Senator governs they're also sometimes open to bribery which throws all the rules out of the window.

How could I title this Ad Senator (http://adsenator.com/) without it being open to accept bribes? Plus it's been mentioned here a couple of times that people want to sell ads on their site.

As such I'm working on an e-commerce module for it to allow you to sell an ad slot outright for $X per X days, weeks, months or years; all through PayPal.

It can now also show a fully customizable 'advertise here' link which lets you set the value of the ad and so on.

Possible sales options:

UID - unique ID for that ad slot
Permalink: the URL of the page where this ad is booked
Price: how much
Frequency: D – for days; 1 to 90 | W – for weeks; 1 to 52 | M – for months; 1 to 24 | Y – for years; 1 to 5
Duration: how many cycles of the above frequency are to elapse before repeat billing
Text: anchor text for the advertise here link
Cancel Discount: An optional value, if the user hits the cancel button on PayPal do you want to show them a discounted trial offer? Use 33 10 etc for the percentage values

So you'll be able to call an ad with a set of rules, if and only if it's been sold the rules are forgotten and the purchased ad (dare I say 'paid link') will be shown.

If no paid ad then the regular rotation of scheduled ads is shown.

I just want to make sure that:

1) I'm giving really good value for money on the $99.99 license
2) Anyone who installs it has as many chances to max their ROI as possible

Not figured the rest of it out but it's moving forward and progressing every day.

:)

developmy.mobi
11-15-2010, 01:22 PM
Just read alot of this discussion, sounds awesome Andy.

gogo
11-16-2010, 07:46 AM
Hi Andy

this is looking like a case of being in the right place at the right time.

It's a case of following the money - check out this funding and monetisation graph:
http://gigaom.com/2010/05/28/geolocal-the-rise-of-consumer-location-based-services/


It seems location based promotions are also time-sensitive, well that should be obvious but...

http://venturebeat.com/2010/07/13/lbs-need-brands/


But in the end, it may be that just knowing somebody’s exact location isn’t enough to make smart marketing decisions. Jeff Montgomery, location-based ad company Placecast’s (http://www.placecast.com/) chief revenue officer said the company has learned three things on location-based advertising, and they are 1) time affects a location, meaning that a hotel is very different on a Monday morning than a Saturday evening, and this impacts the user’s experience and needs concerning that location 2) consumer behavior can be changed, but the message – the ad – has to give consumers time to react, not reach them as they walk into a store, and 3) give consumers control on the messages and ads they receive.
Which is something that Erick Tseng, Facebook (http://www.facebook.com/)’s head of mobile products, brought up on stage in a fireside chat with VentureBeat’s Matt Marshall, speaking about the classic coupon promotion with location-based services.
“How many people have ever used a type of coupon where an offer is pushed to you based on your proximity to a store?” Tseng asked a full room. Zero hands went up. “To me, those types of coupons feel like spam.” However, Tseng continued, if there is social intelligence on top of the location-based ad that makes it more relevant to the person, that’s a different story. “If you see that 30 of your friends are raving about the new pumpkin-flavored frappuccino, and maybe two of your friends are inside, that could be more relevant to you,” Tseng mused.

andymoore
11-17-2010, 02:21 PM
@Dave thanks stranger!

@go - Cool.

I find the mix of location and social media quite scary, privacy is my main concern for example isn't foursquare a burglars best friend for telling them when you're at Starbucks so they can go around yours and rob your nice new flat-screen TV you just tweeted about buying?

;)

ChinaMobi
11-17-2010, 05:02 PM
I find the mix of location and social media quite scary, privacy is my main concern for example isn't foursquare a burglars best friend for telling them when you're at Starbucks so they can go around yours and rob your nice new flat-screen TV you just tweeted about buying?;)Very true. That's the negative side of social networking.

morse
11-19-2010, 03:17 PM
I had been saving my posting in this tread to get a hang of it when its completed.
IT IS AWESOME
However andy can you please specify the server capability the service would require if it was to publish ads like 1000 ads published in a matter of second? Also can you customize it a bit, if someone has individual demands?

andymoore
11-19-2010, 03:51 PM
It's mysql based so how many updates can you handle a second?

I suppose for huge volume memcache can be used instead with an update of all rows per second for example.

andymoore
11-19-2010, 04:48 PM
I thumbed that out whilst in the line at the supermarket.....

Forgot to say 'Thanks Morse!'

:)

Actually it's a select to get the ads and an update to increment the impressions and clicks, that could be memcached I've not had any need to add that, I did have thoughts about hosting it in the cloud too in order to make it scalable but haven't ventured into that either.

When I deploy it for real I'll be putting it under 250,000 uniques a month on one site which is as much traffic as I can personally throw at it to test with.

A little update:

You can now call an ad sales link, this takes the user through to a page saying how much for how often to own that spot outright, it then presents a link to PayPal to subscribe. Once the payment has gone through the IPN request comes in, the account is automatically made for the advertiser and the ad is created from an empty template.

If it is a repeat payment the life of the ad is extended by however long it needs to be.

That's as far as I've got with it but still a load of work to go......

As for customise, yes I want folk to be able to play with it and make it sing but at the same time don't want to put myself in a situation where all the code is open and I'm left with no $ - I need to find the balance of making it open enough to make it sing and closed enough to protect me and ensure a return on my time investment.

developmy.mobi
11-19-2010, 06:16 PM
I'm following this closely now. Lots of great ideas Andy.

I modified your mobile detect script to tell my site what kind of ads to show, but this sounds much better.

andymoore
11-20-2010, 09:44 AM
Just put the first live test transaction through and it worked, well worked 99% right..... A ten cents a day ad was ordered, paid for and setup ready to go live once configured by 'the client' post sale.

The 1% that didn't work was as a client I didn't get an email so couldn't log in to create my ad, not that the login system for advertisers exists yet.....

Also added revenue stats to the control panel

Total: $0.10
Today: $0.10
Week: $0.10
Month: $0.10

I remember saying really early on in this thread that I didn't want to sort out a database for transactions or write a user login system, well I'm a hypocrite and created a simple table last night to log the sales.

So much more still to do!

:)

*james*
12-14-2010, 04:13 PM
"As such I'm working on an e-commerce module for it to allow you to sell an ad slot outright for $X per X days, weeks, months or years; all through PayPal."

http://burstly.com are doing the sell your own ads thing quite well on mobile

andymoore
12-14-2010, 05:44 PM
That's a pretty smart model and sweet design.

:)

andymoore
02-18-2011, 05:16 PM
Hey folks,

Demo time:

http://217.37.49.209/adserver/

Username: Demo
Password: Demo

Capital D - log in and have a look.

Not forgotten about this, just got burnt out on the same thing and needed to rest and test......