- 操作Google AdSense
如何才能在自己的網頁上展示廣告?一句話,就是把Google的代碼粘貼在你的個人主頁上就行了。只要有人在訪問你的主頁時Click了一下其中的廣告,Google就會付錢給你,實際操作步驟如下:
(1).申請一個博客,如和訊博客,CSDN博客等都可以。之所以先要開個blog,是因爲下面第2步申請google賬戶時,google工作人員要審覈(可能要看一下你所說的blog),這好比你在申請工商執行時先要有個經營場所。
(2).向Google申請一個賬號。
你可以點擊我左邊公告欄內的鏈接"透過Google AdSense使您的網站產生收益",然後按照要求填表即可,注意:爲了以後方便收到錢,申請時儘量輸入真實的信息,別在申請時搞個假名,以後收到Google支票卻取不出錢就慘了。Goole在收到你的申請後會在幾天之內把賬號寄到你的郵箱裏,當然如果google同意你的申請的話。我是頭天提交,第二天就收到賬號了,據說有人申請一個星期,甚至一個月都沒反映,我猜想可能是因爲你做的blog太簡陋了,Google認爲你沒有吸引用戶的能力。或者你填的年齡太小,純屬未成年人等等。
(3).在blog上寫一篇文章,這篇文章越吸引人越好,當然也可以一個字也沒有。當然Google對於如何做廣告是有一整套規定的(google稱之爲計劃政策),一個字也沒有可能屬於違規,對違規最嚴重的懲罰是註銷賬號,你的名字被記入黑名單,以後也申請不到賬號。
(4).在Google AdSense網站上把生成的代碼(可以產生廣告)加到文章上,有的博客文章內容不讓嵌入代碼,那你只有想點歪辦法了比如放在公告欄,我的公告欄的最上面的廣告就是代碼產生的,你可點擊一下觀察效果。
(5).把文章發表在blog上,或者在能貼這篇文章的任何地方(這個我沒試過)。如果有人看到文章,正好又對上面的廣告感興趣點了一下,恭喜你,你的賬號上就有收入了。據傳有做得好的人可月入2000美元。
Google的廣告產品按其形式分,常用的有三種,我稱之爲“點,搜,推”。“點”式廣告:就是隻要點擊就會產生收入的廣告。比如我的公告欄最上面的廣告就是一個“點”式廣告,可以點一下看看效果。“搜”式廣告:就是一個搜索欄,你輸入關鍵字後,按搜索按鈕,就會出現一整頁廣告鏈接,點擊鏈接之後,纔會有收入。“推”式廣告:簡單的說,就是推銷,你只有推銷成功纔會有收入,點擊是不會有收入的。那麼什麼是推銷成功呢?不同的廣告有不同的定義,有的把客戶在網上下訂單定義爲成功,有的把填寫一份調查表定義爲成功。想象得出來“推”式廣告比較難做一點,但一旦做成,效益可觀,想像一下由於你的推銷用戶在網上購買了一棟房產,你該拿多少提成? - 解密Google廣告
學會了操作Google廣告,你一定在想,怎麼才能提高點擊數,能不能作弊而不被發現,對這個問題我作了相當的研究,答案是肯定的。原因在於本質上,Google無法判斷某一次Click是真正的Click還是故意的Click,只要你能模擬出足夠偶然的Click,Google是沒有辦法查到的,Google的調查只能是統計意義上的,Google能推出AdSense,我相信它一定對各種作弊模型作過測試,並提取了種種模型的特徵,Google就是依據這些特徵來對你進行審查,這有點類似於病毒軟件查殺病毒,常見的作弊相當於一般病毒,Google早已有了這些作弊手段的特徵碼,只有新的病毒才能逃脫Google的查殺,當然這種“新”也是暫時的,Google一旦發現這種新的作弊方法,它就變舊了,換句話說,你不能總是用一種方法去作弊,因爲你的作弊時間是有限的,或者說只要你找到了一個新的作弊方法,你必須在儘量短的時間內讓它產生儘快的“收益”,撈一票就走。如果你想作弊的話,這是我的一點建議。當然難度是很大的,Google對於審查的算法是保密的,因爲你只能申請有限的賬號,只能作有限次數的測試。在學會作弊之前,還是先學習一下Google AdSense的技術基礎。
當你訪問我的blog主頁時,其中的廣告是如何產生的?有一定經驗的人可能會查看網頁的源代碼,當然很可能很失望,源代碼裏並沒有具體廣告內容,只有一小段javascript有點嫌疑:<script type="text/javascript"><!--
google_ad_client = "pub-9628594186868585";
google_ad_width = 120;
google_ad_height = 125;
google_ad_format = "125x125_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
這正是你當初粘上去的廣告代碼,廣告從何而來?看來祕密就藏在show_ads.js中,爲了搞清楚當你訪問的我的主頁時,廣告到底是如何生成的?Browser到底收到些什麼數據又發送了些什麼數據,爲此,我使用了ethereal進行抓包。如下圖
http://pagead2.googlesyndication.com/pagead/show_ads.js.
http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-4407151184523702&dt=1159003441093&lmt=1159003438&alt_color=ECEBF5&format=120x240_as& output=html&url=http%3A%2F%2Fwesnerm.blogs.com%2F&color_bg=ECEBF5&color_text=6F6F6F&color_link=0000CC&color_url=008000& color_border=ECEBF5&ad_type=text_image&cc=100&u_h=768&u_w=1024&u_ah=704&u_aw=1024&u_cd=32&u_tz=120&u_his=1&u_java=true&u_nplug=25&u_nmime=106
從圖中可以看出當你訪問我的主頁時發生了兩次請求(與廣告有關的),一次是下載show_ads.js,一次是請求http://pagead2.googlesyndication.com/pagead/ads?client=...,顯然後者就是要求Google傳廣告的請求,分析show_ads.js之後得知此請求是由show_ads.js中的代碼發出的。下面是我截獲show_ads.js源碼如下,並做了一點註釋google_ad_url = '';
google_date = new Date();
google_random = google_date.getTime();
google_org_error_handler = window.onerror;
/* 將字符串abc變成"abc",即加2個引號 */
function quoted(str) {
return (str != null) ? '"' + str + '"' : '""';
}
/*
escape 方法返回一個包含了 charstring 內容的字符串值( Unicode 格式)。所有空格、標點、重音符號以及其他非 ASCII 字符都用 %xx 編碼代替,其中 xx 等於表示該字符的十六進制數。例如,空格返回的是 "%20" 。
字符值大於 255 的以 %uxxxx 格式存儲。
*/
function google_encodeURIComponent(str) {
if (typeof(encodeURIComponent) == 'function') {
return encodeURIComponent(str);
} else {
return escape(str);
}
}
function google_write_tracker(tracker_event) {
var img_url = window.google_ad_url.replace(/pagead/ads/, 'pagead/imp.gif'); /* 將pagead/ads 替換爲pagead/imp.gif */
var img_src = img_url + '&event=' + tracker_event;
var img_tag = '<i' + 'mg height="1" width="1" border="0" ' +
'src=' + quoted(img_src) +
' />';
document.write(img_tag);
}
function google_append_url(param, value) {
if (value) {
window.google_ad_url += '&' + param + '=' + value;
}
}
function google_append_url_esc(param, value) {
if (value) {
google_append_url(param, google_encodeURIComponent(value));
}
}
function google_append_color(param, value) {
if (value && typeof(value) == 'object') {
value = value[window.google_random % value.length];
}
google_append_url('color_' + param, value);
}
/*獲取本地客戶端數據*/
function google_get_user_data() {
var javaEnabled = navigator.javaEnabled();
var tz = -google_date.getTimezoneOffset();
if (window.screen) {
google_append_url("u_h", window.screen.height);
google_append_url("u_w", window.screen.width);
google_append_url("u_ah", window.screen.availHeight);
google_append_url("u_aw", window.screen.availWidth);
google_append_url("u_cd", window.screen.colorDepth);
}
google_append_url("u_tz", tz);
google_append_url("u_his", history.length);
google_append_url("u_java", javaEnabled);
if (navigator.plugins) {
google_append_url("u_nplug", navigator.plugins.length);
}
if (navigator.mimeTypes) {
google_append_url("u_nmime", navigator.mimeTypes.length);
}
}
function google_show_ad() {
var w = window;
w.onerror = w.google_org_error_handler;
if (w.google_num_ad_slots) {
w.google_num_ad_slots = w.google_num_ad_slots + 1;
} else {
w.google_num_ad_slots = 1;
}
if (w.google_num_slots_to_rotate) {
w.google_prev_ad_formats = null;
if (w.google_num_slot_to_show == null) {
w.google_num_slot_to_show = w.google_random % w.google_num_slots_to_rotate
+ 1;
}
if (w.google_num_slot_to_show != w.google_num_ad_slots) {
return;
}
} else if (w.google_num_ad_slots > 3 && w.google_ad_region == null) {
return;
}
w.google_ad_url = 'http://pagead2.googlesyndication.com/pagead/ads?';
w.google_ad_client = w.google_ad_client.toLowerCase();
if (w.google_ad_client.substring(0,3) != 'ca-') {
w.google_ad_client = 'ca-' + w.google_ad_client;
}
w.google_ad_url += 'client=' + escape(w.google_ad_client) +
'&dt=' + w.google_date.getTime();
google_append_url('hl', w.google_language);
if (w.google_country) {
google_append_url('gl', w.google_country);
} else {
google_append_url('gl', w.google_gl);
}
google_append_url('gr', w.google_region);
google_append_url_esc('gcs', w.google_city);
google_append_url_esc('hints', w.google_hints);
google_append_url('adsafe', w.google_safe);
google_append_url('oe', w.google_encoding);
google_append_url('lmt', w.google_last_modified_time);
google_append_url_esc('alternate_ad_url', w.google_alternate_ad_url);
google_append_url('alt_color', w.google_alternate_color);
google_append_url("skip", w.google_skip);
if (w.google_prev_ad_formats) {
google_append_url_esc('prev_fmts', w.google_prev_ad_formats.toLowerCase());
}
if (w.google_ad_format) {
google_append_url_esc('format', w.google_ad_format.toLowerCase());
if (w.google_prev_ad_formats) {
w.google_prev_ad_formats = w.google_prev_ad_formats + ',' + w.google_ad_format;
} else {
w.google_prev_ad_formats = w.google_ad_format;
}
}
google_append_url('num_ads', w.google_max_num_ads);
google_append_url('output', w.google_ad_output);
google_append_url('adtest', w.google_adtest);
if (w.google_ad_channel) {
google_append_url_esc('channel', w.google_ad_channel.toLowerCase());
}
google_append_url_esc('url', w.google_page_url);
google_append_color('bg', w.google_color_bg);
google_append_color('text', w.google_color_text);
google_append_color('link', w.google_color_link);
google_append_color('url', w.google_color_url);
google_append_color('border', w.google_color_border);
google_append_color('line', w.google_color_line);
google_append_url('kw_type', w.google_kw_type);
google_append_url_esc('kw', w.google_kw);
google_append_url_esc('contents', w.google_contents);
google_append_url('num_radlinks', w.google_num_radlinks);
google_append_url('max_radlink_len', w.google_max_radlink_len);
google_append_url('rl_filtering', w.google_rl_filtering);
google_append_url('rl_mode', w.google_rl_mode);
google_append_url('ad_type', w.google_ad_type);
google_append_url('image_size', w.google_image_size);
google_append_url('region', w.google_ad_region);
google_append_url('feedback_link', w.google_feedback);
google_append_url_esc('ref', w.google_referrer_url);
google_append_url_esc('loc', w.google_page_location);
google_get_user_data();
w.google_ad_url = w.google_ad_url.substring(0, 1000);
w.google_ad_url = w.google_ad_url.replace(/%w?$/, '');
if (google_ad_output == 'js' && w.google_ad_request_done) { /*輸出js */
document.write('<scr' + 'ipt language="JavaScript1.1"' +
' src=' + quoted(google_ad_url) +
'></scr' + 'ipt>');
} else if (google_ad_output == 'html') { /* 輸出 html */
if (w.name == 'google_ads_frame') {
google_write_tracker('reboundredirect');
} else {
document.write('<ifr' + 'ame' +
' name="google_ads_frame"' +
' width=' + quoted(w.google_ad_width) +
' height=' + quoted(w.google_ad_height) +
' frameborder=' + quoted(w.google_ad_frameborder) +
' src=' + quoted(w.google_ad_url) +
' marginwidth="0"' +
' marginheight="0"' +
' vspace="0"' +
' hspace="0"' +
' allowtransparency="true"' +
' scrolling="no">');
google_write_tracker('noiframe');
document.write('</ifr' + 'ame>');
}
}
w.google_ad_frameborder = null;
w.google_ad_format = null;
w.google_page_url = null;
w.google_language = null;
w.google_gl = null;
w.google_country = null;
w.google_region = null;
w.google_city = null;
w.google_hints = null;
w.google_safe = null;
w.google_encoding = null;
w.google_ad_output = null;
w.google_max_num_ads = null;
w.google_ad_channel = null;
w.google_contents = null;
w.google_alternate_ad_url = null;
w.google_alternate_color = null;
w.google_color_bg = null;
w.google_color_text = null;
w.google_color_link = null;
w.google_color_url = null;
w.google_color_border = null;
w.google_color_line = null;
w.google_adtest = null;
w.google_kw_type = null;
w.google_kw = null;
w.google_num_radlinks = null;
w.google_max_radlink_len = null;
w.google_rl_filtering = null;
w.google_rl_mode = null;
w.google_ad_type = null;
w.google_image_size = null;
w.google_feedback = null;
w.google_skip = null;
w.google_page_location = null;
w.google_referrer_url = null;
w.google_ad_region = null;
}
function google_error_handler(message, url, line) {
google_show_ad();
return true;
}
window.onerror = google_error_handler;
if (window.google_ad_frameborder == null) {
google_ad_frameborder = 0;
}
if (window.google_ad_output == null) {
google_ad_output = 'html';
}
if (window.google_ad_format == null && window.google_ad_output == 'html') {
google_ad_format = google_ad_width + 'x' + google_ad_height;
}
if (window.google_page_url == null) {
google_page_url = document.referrer;
if (window.top.location == document.location) {
google_page_url = document.location;
google_last_modified_time = Date.parse(document.lastModified) / 1000;
google_referrer_url = document.referrer;
}
} else {
google_page_location = document.referrer;
if (window.top.location == document.location) {
google_page_location = document.location;
}
}
google_show_ad();