Showing Adsense In Posts On A Single Post

Memasukan Adsense di postingan tunggal

mungkin trik ini kawan-kawan sudah tahu semuanya, tapi saya mencoba menulis ulang kembali. Mungkin kalian sudah tahu bagaimana memasukan adsense dalam postingan, nah saya mencoba memberikan sedikit tips bagaimana memasukan adsense kedalam postingan tetapi hanya pada postingan tunggal saja. Sebelumnya kalian sudah tahu kalau memasukan adsense dalam postingan akan meningkatkan CTR (click through rate) atau bahasa indonesianya RKPT (rasio klik per tayang) yang akan menghasilkan pendapatan adsense anda lebih banyak.

nah sekarang yang saya ingin berbagi adalah, bagaimana memasukan adsense dalam post yang hanya pada postingan yang dipiih saja, adsense tersebut tidak akan muncul dalam halaman utama (home page) dan dalam halaman arsip (archive).

baik lah kalau begitu, kita kupas lebig lanjut tips yang mudah-mudahan bermanfaat bagi kawan-kawan semua..


Showing Adsense In Posts On A Single Post

I didn’t want this ad unit to appear on the home page or on archive pages.

It would be easy enough to do this in WordPress / PHP, but I had no idea how to customize a Blogger template. I consulted Blogger’s Help facility and found a list of Layouts Data Tags, which let me see what could be done. Despite the options being fairly limited, I found the answer I needed: The pageType tag, which can have a value of ‘item’, ‘archive’ or ‘index’.

My XML coding skills are a little rusty, but thankfully it wasn’t hard to work out how to include some HTML based on the type of page:



This says: If it’s a single post, include the HTML (obviously you have to put it in). So single posts (pageType of item) will display the HTML, but the home page (pageType of index) and archive pages (pageType of archive) will not.

Applying this to our Adsense problem, here is the full code you need (with the publisher specific information removed). Use this instead of the code in the Adsense Within Posts section above. The first and last lines should already exist in the template, the rest is what you’re adding.



Of course, this means that only two Adsense units will be shown on the home page. If you’re doing things properly, most of your visitors should arrive on single posts, via the search engines, so this solution’s good enough for me.

Comments (0)

Post a Comment