Adsense block IP to avoid the invalid clicks.

April 2nd, 2009 Script Posted in Google adsense, PHP script No Comments » 124 views

When my adsense was disable, i very sad for this…, I try thing whats the problem due to my adsense account disable ? I cant understand whats the reason make my adsense disable.

Today i want to introdue to everybody known, the ways to avoid invalid clicks from yourseft, your wife, or your children…

Go to C:\WINDOWS\system32\drivers\etc\hosts open it and add this code belows:  Add the following line to your host file:

127.0.0.1                   pagead2.googlesyndication.com

On your webpage, add this code:

Option 1:

<?
if ($blockadsense == “yes”) {
echo “<!– Nothing to show–>
<table width=\”400\” height=\”400\”>
<tr><td>Nothing here</td></tr>
</table>
“;
} else {
echo “<!– Adsense code here –>”;
}
?>

Option 2:

<?
if ($blockadsense == “yes”) {
echo “<!– Nothing to show here –>”;
} else {
echo “<!– Adsense code here –>”;
}
?>

Have fun, Done

AddThis Social Bookmark Button

How to Adsense anywhere in blogger ?

February 28th, 2009 Script Posted in Ebooks - Tips, Google adsense, How to, Themes Blogger No Comments » 91 views

The guide below provides tips and tricks on where should the parsed HTML ad code (after replacing several special characters with HTML code) be pasted and inserted in the Blogger XML-based template. In essence, the steps are exactly the same when positioning the ad next to and within post content, except that the text string to search (where to paste the ad code) is different.

adsense-in-content-blogger_float_right

To recap, go to Blogger Template tab for the blog you want to change, then click on Edit HTML. Remember to tick Expand Widget Templates check box, and perform the backup.

The ad banner will appear below post title but above and before the start of blog content. It’s actually exactly the same with tip above to wrap AdSense around the post, except that now the ad unit does not float but instead been place at the center without wrapping, and thus pushing content below it.

Search for the line of:

<p><data:post.body/></p>

Paste the parsed Google AdSense ad code inside <center><div>Adsense code </div></center> right before the above line so that it looks like below after change:

<div class= ‘post-header-line-1′/>

<div class=’post-body entry-content’>
<center><div>Adsense code</div></center>
<p><data:post.body/></p>
<div style=’clear: both;’/>

<!– clear for photos floats –>

After Post Content Before Footer Credits

The Google AdSense ad unit or other display ads banner will appear at the bottom of the blog post, after the end of content and just before the ending credits, within inside the post.

Search for:

<div class=’post-footer‘>

Paste the parsed Google AdSense ad code inside <div> and </div> right before the above line so that it looks like below after change:

<div class=’post-body entry-content’>
<p><data:post.body/></p>
<div style=’clear: both;’/> <!– clear for photos floats –>
</div>
<div>[parsed Google AdSense ad code]</div>
<div class=’post-footer’>

To center the ads unit, add the wrapper of <center> and </center>.

After Footer Credits

Unlike the above where the ad unit appear before the credit right after post content, this time the ad unit will appear after the credit for the post is displayed. The easiest way to achieve the task is using built-in feature of “Show Ads Between Posts” in Blogger. Turn off and enable the feature will display ads between posts when view in home, index or category pages, and also at the bottom most part when view in single individual post page view.

If you plan to use non-AdSense ads or want to add in custom channels, you have to manully edit the template HTML to add in the ad code. In this case, search for:

<p class=‘post-footer-line post-footer-line-3′/>

Paste the parsed Google AdSense ad code inside <div> and </div> right after the above line so that it looks like below after change:

<p class=’post-footer-line post-footer-line-3′/>
<div>[parsed Google AdSense ad code]</div>
</div>
</div>
</b:includable>

To center the ads unit, add the wrapper of <center> and </center>.

adsense-in-content-blogger_float_right-1

Reupload and test run it now.

AddThis Social Bookmark Button

How to add adsense with display simple posts

February 28th, 2009 Script Posted in Ebooks - Tips, Google adsense, How to, Themes Blogger No Comments » 110 views

A popular free blog publishing service from Google, has a extremely easy to use and convenient template system that allows users to design the blog user interface presentations by selecting a theme and then drag and drop various page elements such as poll, newsreel, video bar, feed, label, logo, AdSense, HTML/JavaScript and more to align them according to users’ preference on blog layout. However, it also comes with serious limitations, such as when you want to make certain elements (i.e. Google AdSense ad unit) to appear and show when visitors visit single post item individually, or just want to shown the widget component block on homepage, archive and label or category pages.

Blogger.com allows users to manually the XML-based template HTML, thus allows a hack which enables users to manually edit the HTML code to achieve the aim to display and show certain widgets or part of webpages on individual post page view only. However, you have need to have a basic HTML knowledge to modify the HTML code of Blogger’s template, which as editable by clicking on Template tab (or Layout of the blog you want to change if at Dashboard), and then click on Edit HTML.

The trick is show a widget in single post item view only is to add the following two lines of code to the top and bottom of the code block respectively:

<b:if cond=’data:blog.pageType == “item”‘>
</b:if>

The above lines will add in a condition which value is negative is the blog is not showing individual post content page. Thus anything that are wrapped inside it won’t be shown on homepage, label or category pages, or archive pages. For example, while wrapping the AdSense ads manually beside the post content, you can make the ads displayed only when individual posts are viewed by adding above 2 lines to the code, so that it will has the following structure:

<b:if cond=’data:blog.pageType == “item”‘>

Parsed Google AdSense Ad Code (guide to parse the HTML code of AdSense JavaScript with escape character)<

</b:if>

To display the page elements or ad units on every pages except individual post content view pages, wrap the following lines of code instead:

<b:if cond=’data:blog.pageType != “item”‘>
</b:if>

The above statements make use of conditional statements similar to IF, ELSE, END IF in most programming languages. The Blogger XML support these three conditional statements too. Two already been used above, with the third one ELSE is <b:else>. You can make use of <b:else> to instruct Blogger template to display this widget (e.g. AdBrite ads) on all pages except single post pages, and show another widget (e.g. AdSense ads) on individual post pages.

Other than ads code or JavaScripts that are manually inserted into Blogger HTML, the above trick can be applied to widget based page elements that are added to the layout. But you need to study carefully the HTML code to identify which blocks of code is the element in order to add in above codes to wrap on top and bottom around them.

AddThis Social Bookmark Button

How to add adsense code into themes Blogger ?

February 28th, 2009 Script Posted in Ebooks - Tips, Google adsense, How to, Themes Blogger 1 Comment » 97 views

Advanced users of Blogger.com service may have tried to insert and put Google AdSense ad code which is actually a Java script directly into the blog pages by manually editing the XML-based template HTML coding interface. Actually, it’s possible add any ad code by using HTML/JavaScript page element within the Blogger new XML template system, but the place where you can place the new block is rather limited, i.e. above or below the post body, header, footer, within sidebar or between blog posts. In case you want to put the ads inside the post, or align the ads to float and wrap around the text, or just within the single individual article content view, you will have to edit directly the HTML coding of Blogger template.

The resolution to the JavaScript based coding does not work in Blogger HTML template error can be solved by replacing special characters or symbols in the script to HTML code. Check out the list below for which ASCII characters that need to be replaced with their corresponding HTML code. Using HTML code will ensure that Blogger render the character correctly when serving the page to the viewer.

< – &lt;
> – &gt;

Above two is enough to make Google AdSense works in Blogger template. For other scripts, such as AdBrite ad code, you will need to replace more characters such as those listed below.

AdSense or JavaScript Ad Code Directly to Blogger HTML Template:

& = &amp;
” = &quot;

Google AdSense code should become looks similar to code below:

<!– Adsense Begin /–>

&lt;script type=”text/javascript”&gt;&lt;!–
google_ad_client = “pub-Your ID here“;
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = “336×280_as”;
google_ad_type = “text_image”;
google_ad_channel = “”;
google_color_border = “FFFFFF”;
google_color_bg = “FFFFFF”;
google_color_link = “000000″;
google_color_text = “000000″;
google_color_url = “000000″;
//–&gt;&lt;/script&gt;
&lt;script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”&gt;
&lt;/script&gt;

<!– Adsense end /–>

Simply use the text editor to parse the code and then replace the characters. Don’t worry about violating AdSense TOS or other terms and conditions, as once the blog’s web pages are rendered and presented to the viewers and visitors, the code will be exactly same as the original code before any replacement.

AddThis Social Bookmark Button

How to add Adsense Code to Blogger ?

February 28th, 2009 Script Posted in Ebooks - Tips, Google adsense, How to, Themes Blogger No Comments » 84 views

There are many who know this trick. But recently, I was contacted by at least dozen of people asking How to add Adsense Code to Blogger. So, Here is brief guide abut adding your Google Adsense Ad code to Blogger Template. This Post will teach you how to add the code, how to show your ads at particular place such as Ads below the post, in the post, before the post, etc.

Modify Your Code before adding to your Blogger template

Let me clarify this point. This Method will only work for New or Beta Blogger templates. For Old Blogger, Amit has very interesting and informative article on how to insert Adsense in Old Blogger template.

Blogger Template is XML template. So some of the characters such as

<– or !–>

are not allowed in Blogger Template. So you will have to modify a bit in order to work in Blogger template.

Caution: Before doing any experiments with your template, I suggest you to Download your template first and keep a good backup copy of your template.

#1 : Modify Blogger Template Manually

Generate your Adsense Code and now paste it in any word editor. I prefer WordPad. Now find the code <!– and replace this code with &lt;!– .

And find another code //–> and replace this code with //–&gt;

#2 : Use HTML parser to do this jobs

Use automated parser to parse your code. Just use HTML parser from BlogCrowds.

Is Modifying Code Legal

Yeah, Google has responded at least hundred times. Read the clear Google Adsense Support Response.

Now you must be ready for the Special Modified code for Blogger templates. Now, I will tell you how to insert the ads at various locations. Following guide includes how to insert Google ads After the Post, Before the Post, Just after the Title of the Post, How to show ads on main page only, how to show ads on Post pages or Label pages only.

Show Adsense after the Post

Just open you download template in WordPad and find the following code

<p><data:post.body/></p>

Now insert your code just after <data:post.body/>. So you Adsense code will look like this.

<p><data:post.body/>Adsense Code Here</p>

Show Adsense before the Post
Find this code in your template. If you are using my first hack then you have already found it.

<p><data:post.body/></p>

Now insert the code just before <data:post.body/>. Now you code will look like this.

<p>Adsense Code Here<data:post.body/></p>

Show Adsense Ads just after the Title of the Post

Just find the code. <div class=’post-header-line-1′/> . Add the code below this line.

Show Ads in Post Footer

Just find the code. <div class=’post-footer’> Add the code above this line.

<div class=’post-body’>
<p><data:post.body/></p>
<div style=’clear: both;’/> <!– clear for photos floats –>
</div>

<div>Adsense Code Here</div>

<div class=’post-footer’>

Show Ads after Author Name (Credits)
Just find the code. <p class=’post-footer-line post-footer-line-3′/> add the code just below it.

<p class=’post-footer-line post-footer-line-3′/>

<div>Adsense code Here</div>
</div>
</div>
</b:includable>
</b:widget>
</b:section>

So, I normally use these places to show my ads. Remember try to change your ad placement once in 15 days. It will try to reduce Ad blindness. Further you can use some Adsense Optimization tips to increase your Adsense revenue.

Adsense Optimization

If your posting rate is good, then Google will not be able to serve you exact contextual ads on Homepage. So it’s better to show your ads on Post pages only. Note that following method only work if you are using HTML/Java box from Add a page element option. Learn How to Show ads on Post pages, Home Page Only, On Particular Page Only.

Wrap Your Ads To increase CTR

Wrapping Ads is very good practice for increasing your revenue. You can also wrap your ads. Just add the simple code above and below your Modified Adsense code.

To Wrap the ads to Right : Add the code as shown below.

<div style=”float: Right;”>
Adsense Code Here
</div>

To Wrap the ads to Left : Add the code as shown below.

<div style=”float: Left;”>
Adsense code</div>

Done. Keep recomment here to have best answers for you! have fun…

AddThis Social Bookmark Button

How to add google sitemap into Blogger ?

February 20th, 2009 Script Posted in Ebooks - Tips, Google adsense, How to, SEO tool No Comments » 284 views

How to add Google sitemap to your blogger.com account and increase your chances of being indexed in Google search engine result. You can add a Sitemap to your account to give Google more information about the pages in your site to help Google crawl them more effectively.

Step # 1: Login to Google sitemap account:

add-sitemap-blogger
Next  paste URL of your blog (Example http://www.vuicafe.com or http://yournameblog.blogspot.com).

Click on Ok button. Next you will get confirmation message ” Your site has been added to your account. “.

Step # 2: Now you need to verify your ownership of blog to view detailed statistics. Click on verify link. Google offers two methods of verification. You can either upload an HTML file with a name we specify (which is not possible with Google Blogger account), or you can add a META tag to your site’s index file. Adding META tag via template code is possible so just select Add a META tag from drop down menu:

add-sitemap-blogger-1

It will generate code for you, copy the meta tag and paste it into your blogger.com template section).

Step # 3: Go to your blogger.com and login to your account. Goto your blog > Click on Template
Paste the META tag code after section:

add-sitemap-blogger-2

Click on Save Template changes button

Click on Republish Index only button > Wait for few seconds so that your blog being published successfully.

Step # 4: Now goto sitemap account and click the box that read as follows:

I’ve added the META tag in the home page of http://vuicafe.com. Click on Verify button.

add-sitemap-blogger-3

Step # 5: Now your site is added to sitemap account and verification is done. Next you need to add actual sitemap url. Since blogger.com account donot allow you to create a text file or anything else you need to add your site feed (ATOM xml) file as a site map. Click on add a sitemap link:

add-sitemap-blogger-4

Step # 6: You can add a Sitemap to your account to provide Google additional information about about your blog. Google will process your Sitemap and provide information on any errors in the Sitemaps tab as well your sitemap will be downloaded everyday to index your blog fast.
Select type as : Add General Web sitemap:

Now you need to add Atom 0.3 feeds. Generally, you would use this format only if your site already has a syndication feed and this is the only way to add sitemap to your blogger.com account.

Paste url of your Atom feed:

add-sitemap-blogger-5http://vuicafe.com/atom.xml

http://vuicafe.com/feeds/posts/full

Add Web sitemap.

add-sitemap-blogger-6

Waiting for a minutes your sitemap have been submited. Done

AddThis Social Bookmark Button

How to add adsense into Blogger ?

February 14th, 2009 Script Posted in Google adsense, How to, Java script, Themes Blogger No Comments » 90 views

1. Adsense Within Posts:

As I mentioned above, you can’t place Adsense ads within the post body using the built-in gadgets. To do this, we’re going to have to put our Adsense code directly into the template.

We still can’t put the ad unit in the middle of the post, but we can put it at the top of the post, below the title, with the text wrapping around it. Great! That’s proven to be the most effective placement, so that’s exactly what we want.

Now, the technique used to do this isn’t new. In fact I learned how to do it by reading Bonnie Calhoun’s Wrapping Adsense in Blog Post. You can go and read her post for the full instructions, but here are the basic steps:
Get your Adsense code from the Adsense website
Parse the code to replace special characters with HTML entities
In Blogger, go to Layout, then choose Edit HTML
Make a backup of your template by clicking Download Full Template
Click Expand Widget Templates
Search for:

<data:post.body/> or <p><data:post.body/></p>
Place your Adsense code on the line immediately above this
Save the template

Note 1: It’s very important to parse the code as per Bonnie’s site (ie replace < with &lt; and > with &gt; etc). If you do not do this, your Adsense units will not display correctly and you risk being banned by Google.

Note 2: You probably want to place your Adsense code within a floating div, so that the text wraps around it.

Here’s what the code will look like (with the publisher specific information removed). The first and last lines should already exist in the template, the rest is what you’re adding.

Before paste this code adsense, you should encode it same:

<div class=’post-body entry-content’>
<div style=’float: left;’>
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!–
google_ad_client = &quot;pub-xxxxxxxxxxxxxxxx&quot;;
google_ad_host = &quot;pub-xxxxxxxxxxxxxxxx&quot;;
google_ad_slot = &quot;xxxxxx&quot;;
google_ad_width = 336;
google_ad_height = 280;
//–&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
</div>
<p><data:post.body/></p>

This solves the problem of getting Adsense to appear within the post, driving up CTR. However, the sidebar unit will still disappear on the home page, as there will be more than 3 units on the page (one embedded in each post).

2. Only Showing Adsense In Posts On A Single Post:

To solve the problem of the sidebar unit disappearing, I decided that I only wanted to show Adsense within the post (ie solution in the previous section) on single posts. 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:

<b:if cond=’data:blog.pageType == “item”‘>
Put your adsense code here
</b:if>

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.

<div class=’post-body entry-content’>
<b:if cond=’data:blog.pageType == “item”‘>
<div style=’float: left;’>
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!–
google_ad_client = &quot;pub-xxxxxxxxxxxxxxxx&quot;;
google_ad_host = &quot;pub-xxxxxxxxxxxxxxxx&quot;;
google_ad_slot = &quot;xxxxxxxxxx&quot;;
google_ad_width = 336;
google_ad_height = 280;
//–&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
</div>
</b:if>
<p><data:post.body/></p>

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.

Save template and test it now !

AddThis Social Bookmark Button