1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

adsense in post for blogger

Discussion in 'Blogging' started by nikhil88, Dec 27, 2008.

  1. nikhil88

    nikhil88 Regular Member

    Joined:
    Jun 12, 2008
    Messages:
    208
    Likes Received:
    97
    Occupation:
    E&TC Engineering Student
    Location:
    Pune,India
    i had mentioned about this in another thread but now the threads been deleted. plus i had few ppl ask me for help so here it is

    METHOD 1: Using Default Blogger Widgets

    1.remove all adsense widgets/codes from ur blog
    2.go to layout --> page elements
    3.click on edit for blog posts
    4.enable ads in blog posts, choose the ad template u want
    5. now go to edit html
    6. check 'Expand Widget Templates'
    7. search for the following lines
    Code:
    <b:if cond='data:post.includeAd'>
            <data:adEnd/>
            <data:adCode/>
            <data:adStart/>
          </b:if>
    8.cut it and paste on notepad
    9. modify it to
    Code:
    <div style='float:left;'>
    <b:if cond='data:post.includeAd'>
            <data:adEnd/>
            <data:adCode/>
            <data:adStart/>
    </div>
    10. now find this line
    Code:
    <div class='post-body entry-content'>
    11. paste our modified code below this line
    12. make sure the next line after our code is
    Code:
    <data:post.body/>
    13. click on save template, u r done!!
    u can now add more adsense widgets to the sidebar or wherever as required

    the problem with this method is that u cant track the ads individually
    so for performance tracking use method 2

    METHOD 2: Using Adsense codes

    1. Make sure u have disabled show ads in post option
    2. from the adsene site create an ad, with the size and template desired. add it to a channel to track its performance
    3. copy the created adsense script on notepad as we need to modify it a bit
    dont worry this is not going to be against their TOS
    4. now modify
    < with <
    > with >
    " with "
    5. the final output should look something like this
    Code:
    <script type="text/javascript"><!--
    google_ad_client = "pub-0000000000000000";
    google_ad_width = 336;
    google_ad_height = 280;
    google_ad_format = "336x280_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "000000";
    google_color_text = "000000";
    google_color_url = "000000";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    6.add <div style='float:left;'> and </div> to the top and bottom respectively
    7.go to edit html-->click expand widgets
    8. find
    Code:
    <div class='post-body entry-content'>
    and paste our code below this line like steps 10,11,and 12 of method 1 above
    9. save template, u r done!

    this method can be used for any ads not just the ones in the post
    just make sure u modify the code as said


    hope this helps, ask me if u face any difficulties

    nikhil88
     
    • Thanks Thanks x 8
  2. MrsE

    MrsE BANNED BANNED

    Joined:
    Nov 7, 2008
    Messages:
    670
    Likes Received:
    875
    modifying an adsense ad WILL get you banned!!...

    *** make sure you personally e-mail google about parsing the ad before you do it!***

    sometimes, they don't give a fuck, and sometimes they do
     
  3. greenghost

    greenghost Regular Member

    Joined:
    Dec 22, 2008
    Messages:
    280
    Likes Received:
    271
    Thank you very much nikhil88 :)
    i was just looking for it...
     
  4. tjpasha

    tjpasha Registered Member

    Joined:
    Dec 1, 2008
    Messages:
    61
    Likes Received:
    15
    thanks gagain nikhil ...doing a gr8 job
    regards
    tjpasha
     
  5. shankarax

    shankarax Regular Member

    Joined:
    Oct 18, 2008
    Messages:
    375
    Likes Received:
    476
    Location:
    proxy-heaven.blogspot.com
    Home Page:
    I didn't know the second method.
    Thanks for sharing this mate.
     
  6. nikhil88

    nikhil88 Regular Member

    Joined:
    Jun 12, 2008
    Messages:
    208
    Likes Received:
    97
    Occupation:
    E&TC Engineering Student
    Location:
    Pune,India
    ^^ even i came to know bout it recently
    i just hate that u cant track the ads using default widgets in blogger
     
  7. freeufcdotinfo

    freeufcdotinfo Power Member

    Joined:
    Jun 12, 2008
    Messages:
    685
    Likes Received:
    155
    Could you not just

    1) great a html with adsense ad -
    2) place a iframe in blog under your product

    Maybe??
     
  8. nikhil88

    nikhil88 Regular Member

    Joined:
    Jun 12, 2008
    Messages:
    208
    Likes Received:
    97
    Occupation:
    E&TC Engineering Student
    Location:
    Pune,India
    @boosey12
    its not exactly modifying the code so u wont get banned by google
    what we are doing is changing the parameters to match the xml format of blogger templates
    after u save the template once, check out ur adsense code in the template. it will be exactly the same as google gave it to us.
     
  9. linder

    linder Newbie

    Joined:
    Dec 7, 2008
    Messages:
    19
    Likes Received:
    8
    Gender:
    Male
    Location:
    Nova Scotia Canada
    It is true...if you check the adsense code...it will appear just as google gave it to us. Thanks nikhil88.
     
  10. wakkaoaka

    wakkaoaka BANNED BANNED

    Joined:
    Sep 14, 2008
    Messages:
    1,113
    Likes Received:
    782
    hey boosey, i did this with my blog, it isnt changing the ad code at all, its just changing the placement. It uses that blogger 'show ads between posts' option. But instead your ads are in the post instead of under.
     
  11. letusgo

    letusgo Junior Member

    Joined:
    Nov 15, 2008
    Messages:
    199
    Likes Received:
    125
    hey,thx 4 the share.
    Uh... I want to show my adsense in the first post in homepage.Do you know how to achieve it?
     
  12. kittykat

    kittykat Junior Member

    Joined:
    Sep 17, 2008
    Messages:
    115
    Likes Received:
    66
    This is an excellent post! I have been trying to figure this out for a long time until I finally gave up a while back. I thanked you this really helps me out!
     
  13. nikhil88

    nikhil88 Regular Member

    Joined:
    Jun 12, 2008
    Messages:
    208
    Likes Received:
    97
    Occupation:
    E&TC Engineering Student
    Location:
    Pune,India
    i'm sorry, but i dint follow what u said
    this method is valid for all posts, homepage or wherever