I need to automate a very simple task: controlling the flow of ads from the Popads ads network (which has its own API). I am using the tracker Bemob (which also has its own API).
At the start of the process the user enteres the login details of both tracker and ad network, and the name of the campaign. The user then enters the pre-defined Threshold Conversion Figure. When any site ID on the tracker reaches this figure, WITHOUT a click being recorded on the tracker, it stops ads being served to this site ID by copying and pasting the site ID into the PopAds blacklist.
The user also enters (at the start) a figure called the Acceptable Conversion Rate. This is the percentage figure which the 'surviving' site IDs (i.e. which have not been blacklisted) must continually achieve in order not to be blacklisted. If it fails to achieve this at any point, it is blacklisted.
At any point the utility can allow any site ID to be ignored from this automated process (i.e. it will allow manual control of any site ID).
Example: I enter the login details for Bemob and PopAds and the campaign name. I enter 50 for the Threshold Conversion Figure and 2% for the Acceptable Conversion Rate. (Note that these two figures will usually have an arithmetical relationship with each other). This means that if any site ID is recorded by Bemob as having had 50 ads served WITHOUT a click being recorded on Bemob, then this site is deemed a site which is not relevant to the present campaign, and so is eliminated from the campaign by being blacklisted.
Site IDs which have clicks are continually monitored by the ytility, and if their Conversion Rate falls below 2% they are blacklisted. For example, if a site ID has 99 ad impressions and 1 click it is still in contention, but if it reaches 100 ad impressions without getting 2 clicks (which would maintain its 2% conversion rate) it will be blacklisted.
In this way, for any average campaign, several days may be spent steadily blacklisting the vast majority of site IDs which fall below the acceptable conversion rate. This indicates that people who look at those site IDs are not interested in the advert being shown on that particular campaign. The number of 'surviving' site IDs will always be in the tiny minority.