First of all, let’s popularize the current types of Internet advertising. They generally include CPC, CPM, CPA, CPS, and CPV.
CPC is calculated by click (Click), CPM is calculated by pop-up window (Mxxx?), CPA/CPS is calculated by registration and sales, and CPV is calculated by the number of displays. Therefore, CPC, CPA, and CPS, which gain revenue based on the behavior of website visitors, are one category, while CPM and CPV, which are only related to website traffic, are another category.
As you can imagine, the effects of CPC, CPA, and CPS need to be adjusted by analyzing many factors such as visitor groups and click habits. They cannot be achieved overnight. In this article, I mainly want to study how to make a fuss about traffic without cheating. Obtain as much revenue as possible; when the advertising alliance uses it more and over time, it will also give some evaluations of different advertising alliances.
1. The most basic delivery
Taking the alliance as an example, embedding similar code directly anywhere on the web page can generate a display ad floating in the lower right corner.
<script type="text/javascript">
u_a_client="20326";
u_a_width="270";
u_a_height="200";
u_a_zones="37972";
u_a_type="1"
</script>
<script src=" http://www.XXXX.com/i.js"></script >
2. Rotation of similar ads from different ad networks
Because CPV/CPM calculates views based on IP, the same user browsing the same advertisement repeatedly will not increase revenue, so a carousel mechanism is introduced.
Normally, if it is the same alliance, it will automatically rotate randomly, but what if you want to rotate between CPV ads of different alliances?
In fact, you can do the randomization yourself and use Javascript to randomly generate codes at the corresponding positions. You can define the file dynamic.js and then import it at the corresponding location.
<script type="text/javascript" src="dynamic.js"></script>
Then dynamic.js uses document.write and Math.random functions to dynamically display advertisements from different websites. Here I used advertisements from another advertising alliance, Tai Chi Circle (I saw that playsc.com is using this alliance, so I also applied). The code is as follows:
var choice = Math.random()*2;
if (choice<=1){
document.write('<script type="text/javascript">u_a_client="20685";u_a_width="270";u_a_height="200";u_a_zones="63336";u_a_type="1";</script> <script src=" http://js.tjq.com/i.js"></script>' );
}else{
document.write('<script type="text/javascript">u_a_client="20326";u_a_width="270";u_a_height="200";u_a_zones="37972";u_a_type="1";</script> <script src=" http://www.admin6.com/i.js"></script>' );
}
Obviously, if there are three that need to be displayed, then random*3 and three branches will be enough, and so on. This is just a form. If there are many advertisements, you can define a dynamic.js file, put the above code in the function cpv, and then call the cpv function in the corresponding place. This facilitates unified management of ads.
Another advantage of doing this is that the static page does not need to be regenerated. You only need to modify the content of dynamic.js to modify the advertising content.
During use, I found that the random number generation in JavaScript is not very reliable, so you can also abandon the Math.random method and use the odd-even time method: display A advertisement in odd-numbered minutes, display B advertisement in even-numbered minutes, or even divide it by seconds. Supports up to 60 ad rotations (so perverted-.-). The basic idea of this method is that as long as the webpage is browsed for more than the length of the time slice (I use minutes here), two advertisements will inevitably be browsed at the same time. The code of dynamic.js is modified as follows
var now = new Date();
var minutes = now.getMinutes();
if (minutes%2==0){
document.write('<script type="text/javascript">u_a_client="20685";u_a_width="270";u_a_height="200";u_a_zones="63336";u_a_type="1";</script> <script src=" http://js.tjq.com/i.js"></script>' );
}else{
document.write('<script type="text/javascript">u_a_client="20326";u_a_width="270";u_a_height="200";u_a_zones="37972";u_a_type="1";</script> <script src=" http://www.xxx.com/i.js"></script>' );
}
Another advantage of the odd-even time method is that you can compare which advertising alliance has more volume, because it is conceivable that if the odd-even time allocation is used, generally speaking, the number of clicks allocated to the two alliances should be similar, for reference only.
3. The ultimate carousel trick
After using the methods in 2, compared with a single alliance, the advertising effect will immediately be *1.5, but this is still not enough. We should be more greedy: squeeze out the user traffic of every IP.
How can it be squeezed cleanly? Just imagine this algorithm:
The user visits for the first time that day and displays ad 1
The user visits for the second time that day and displays ad 2
As long as the number of user visits is less than the number of existing ads, different ads will be displayed every time he visits, and ads will be displayed as many times as he clicks on the page! CPV advertising is truly Cost Per View. (But will this be mistaken for cheating? Because the ratio of obvious display numbers to statistics is too high, it looks fake. This needs to be measured)
Another question is, how to determine which time a user visits and thus which advertisement is displayed? The simplest idea is to build a local traffic statistics system, such as the piwik system, and then query the local database. I really wanted to implement this at the beginning, but you can imagine how much this would drag down the performance of the host. Think about it, is there a way for JavaScript to save that access information by itself?
In fact, there are, that is, local cookies. As long as the cookie is automatically recorded, it will be obvious how many times the user has come; and since the cookie has an automatic timeout mechanism, we only need to let it set the timeout to 24 hours, then the second time The statistics will be automatically recalculated every day.
First, you need set_cookie and get_cookie functions
function set_cookie(name,value,expires){
var today = new Date();
today.setTime( today.getTime() );
expires = expires*1000;
var expires_date = new Date(today.getTime()+(expires));
document.cookie=name+"="+escape(value)+";expires="+expires_date.toGMTString()+";domain=simplecd.org";
}
function get_cookie(name){
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++){
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^s+|s+$/g,"");
if (x==name){
return unescape(y);
}
}
}
Then, we can slightly modify the algorithm and simplify the code: create its own cookie for each advertisement, with the value being the number of visits
The new algorithm is as follows:
1. Traverse the cookies of each advertising space
2. If there is a cookie that does not exist, display the ad slot and set the cookie.
3. If all cookies exist, any advertisement will be displayed or not displayed, and the cookie of the displayed advertisement will be updated at the same time.
Furthermore, in order to make the floating window less disturbing, you can also add another one:
If the total number of times the user has been shown an advertisement is greater than 6 times, then this type of advertisement will not be displayed today.
The entire next code is as follows:
var total_ad = 3;
var max_show = 6;
var cookie_PRe = 'cpvad_counter_';
var cookie_time = 60*60*8;
var show = -1; // show ad id
var show_counter = 0;
// first pass, round robin
for (var i=0;i<total_ad;i++) {
var cookie_name = cookie_pre+i;
var counter = get_cookie(cookie_name);
if (counter){
show_counter += parseInt(counter);
}else{
show = i;
break;
}
}
// show if not showed more than max_show times
if (show_counter < max_show){
// second pass, random show
if (show == -1){
show = Math.floor(Math.random()*total_ad);
}
//handle cookie
var cookie_name = cookie_pre+show
var cookie_value = get_cookie(cookie_name);
if (cookie_value){
set_cookie(cookie_name,''+(parseInt(cookie_value)+1),cookie_time);
}else{
set_cookie(cookie_name,'1',cookie_time);
}
// show add
switch(show){
case 0:
document.write('<script type="text/javascript">u_a_client="20685";u_a_width="270";u_a_height="200";u_a_zones="63336";u_a_type="1";</script> <script src=" http://js.tjq.com/i.js"></script>' );
break;
case 1:
document.write('<script type="text/javascript">u_a_client="20326";u_a_width="270";u_a_height="200";u_a_zones="37972";u_a_type="1";</script> <script src=" http://www.xxx.com/i.js"></script>' );
break;
case 2:
document.write('<script type="text/javascript">u_a_client="20685";u_a_width="283";u_a_height="189";u_a_zones="63369";u_a_type="1";</script> <script src=" http://js.tjq.com/i.js"></script>' );
break;
}
}
4. Summary
This article technically analyzes and realizes the maximization of revenue from the rotation of CPV ads. As for similar CPM ads, the same is true.
However, advertising is not just about maximizing effectiveness by playing with JavaScript. There are also other advertising categories such as CPC/CPA/CPS. There is also the relationship between quantity and quality, the relationship between position and display speed, and the relationship between nuisance and effectiveness. There are a lot of things to study.
In terms of Internet advertising, I am just a newcomer who has only been advertising for a week. There is still a lot to learn and research, so the title of this article is (1). When I have some insights and think I can write a separate article, That's (2). However, at present, I only have a rough idea of the experiment. I don't know when to do it and when to write it down.
Article source: http://obmem.info/?p=844 Please indicate the source link when reprinting.