Sign up for PayPal and start accepting credit card payments instantly.



Thursday, November 22, 2007

Google AdSense Inside Post

Useful Information

Yipeee! I've done it again. If you still remember, the main reason I created this blog, was to see whether I can do it again after my flag-ship blog My Journey To Recovery gained a PR4. I wanna make sure that My Journey To Recovery's PR4 was not a fluke coz I put in a lot of efforts, and times to promote it.

Web Directory was introduced to the WWW mainly to the Blogosphere for all to see on June 15th, 2007. With only her second post, SEO, it was already been listed on Google and now after only twenty two posts that has been published so far, I'm proud to announce that Web Directory is now a PR3 blog. Look like she's bound to have beautiful things in her future life.

Right on, enough bragging for now. Here's another useful information for those who has been asking me via emails and the like, how to wrap Google's AdSense in a post? The latest email I received asking this type of question was from Smsaroni, the King of Malaysia's PayPal. Head over to his Website now if you're frustrated with not being able to cash your PayPal funds. And he will show you, not one, but THREE ways to withdraw your PayPal funds WITHOUT spending USD1,000 to open up a US Bank account!

I assume you must have Google AdSense account. Login to your AdSense account and after seeing how much you've earned today (I'm sure AdSense is your main revenue) click on AdSense Setup -> Products and choose “AdSense for Content”.

Then, select “Ad unit” and follow the instructions on picking out the size of ad, color combination, channel and so on and so on, right to the end when AdSense automatically generate HTML codes for you. Copy this code and paste it on Notepad or WordPad or on any editor of your choice.

I know and understand that copying and pasting your AdSense code can sometimes be confusing, especially if you're new to HTML and web design. Have you ever tried to insert the Google AdSense code directly into your Blogger XML Template? I'm sure you have and I'm sure too you've received a big read error notice from Blogger like below;

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Ever since Blogger started using XML everything became more strict and standardized. The above error simply mean that AdSense code is not a standardized XML. Before you can copy and paste your AdSense code, you have to parse your AdSense code first. Parse mean you do a slight modification to your AdSense code. All you got to do is change the characters on AdSense code, reds in colour to the blues.

< with &lt;
> with &gt;
" with &quot;

After parsing your AdSense code, it will look like this;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;pub-xxxxxxxxxxxxxxxx&quot;;
//468x60, created 11/20/07
google_ad_slot = &quot;xxxxxxxxxx&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&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;

To ease your mind if you thought it is against AdSense TOS, here is an email from AdSense;

Thanks for your email. We do permit minor edits to the AdSense code to
allow AdSense to be placed into Blogger.

Please keep in mind that in general, publishers are not allowed to alter
the AdSense ad code for any reason. Once you've generated the ad code in
your AdSense account pages, you may not alter any portion of the code or
manually change the layout of the ads. For instance, publishers may not
alter the ad height variable to mask the Ads by Google moniker.

Thanks for your cooperation.

Sincerely,

Sean
The Google AdSense Team


Step One: Now comes the part that you've been waiting for. Login to your Dashboard. Go to Template -> Edit HTML and click the box next to “Expand Widget Templates”. Before editing your template, you may want to save a copy of it. Click on "Download Full Template". This is your back-up. With a backup, you can easily restore the template to the prior state if your PC explode to kingdom come! Lol, I'm sure it will not come to that. I mean with a backup you can go back to your original template if anything goes wrong.

Step Two: Placing the AdSense code

i) Next to your post

<div style="float:left;">
<!--parsed AdSense code-->
</div>

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

ii) AdSense after your post

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

<div><!--parsed AdSense code--></div>

<div class='post-footer'>
<p class='post-footer-line post-footer-line-1'>
<span class='post-author'>
<b:if cond='data:top.showAuthor'>
<data:top.authorLabel/> <data:post.author/>

Step Three: Preview before saving.

With the above two example, you can manipulate by placing anywhere you want AdSense to be on your blog. To align AdSense with your post, you can add margin or padding on the table where you gonna place AdSense.

That's it for now. Shoot me an email if you need any help. Before closing here's some news brought to you by The News Room. I'm wondering when Google AdSense gonna come to Malaysia? Have a good week my friends.





Subscribe to My Journey To Recovery

A candle loses nothing by sharing its flame.

2 Responses to "

Google AdSense Inside Post

"
SM Saroni a.k.a smsaroni said...

Thanks. It's really help me to organize my blog. Look clean and readable. Bravo man and keep it up the good work.
smsaroni
http://hotvision.blogspot.com

yaya said...

yes this is what im looking for.

Teringin buh adsense tapi tak reti hehe =D

keep up givin useful info, especially to people [not-realy-know-how-to-blog] like me hehehe.

Post a Comment

I loves to receive comments from everybody and I tried to make everything easier for my readers to comments. So please, be nice even though you totally disagree with me. No comment moderation and whatnot here. So, please respect the privileges given.

God's willing, all comments will be followed and replied.

p/s Please leave your URL so that I can follow it and leave comments on yours. No URL = No Comments. It is as simple as that. Thank you in advance.


~ ArahMan7



Back To Top