Has anyone come up with some ingenius way of integrating ads within Drupal? I've used them in blocks and recently added them inline at the start and end of articles.

I'm interested in what sorts of things the rest of you have come up with. :)

Comments

Bèr Kessels’s picture

The webcommunity http://www. adsensed .com / has lots of information, and is buit on Drupal. There might be some help there.

And if this solved you problem, would you be so kind to report back that it helped? This will help others whom are looking for the same solution.

[Ber | Drupal Services webschuur.com]

(update by bb: time has past, this site is now a parked domain, hence link deleted)

Lineman-at-lineman.net’s picture

I don't really have a problem. I'm just wondering what others have come up with. :)

Thanks for the link.

bertboerland’s picture

if you are willing to donate your money to drupal, see this thread.
--
groets
bertb

--
groets
bert boerland

thegenericgeek’s picture

Thought I would leave a note here that adsensed.com is under new management. Take a look for current news on the Google Adsense program. Let me know what you think.

adsensed.com

GenericGeek.Com More Geek, Less Nerd!

globefox’s picture

this link is sadly no longer relevant

dtan’s picture

I am also interested in how people are displaying adsense. It appears that most sites I've seen have been displaying inline or as a block on the side.

I would like to place the adsense along the top, like a banner. I have seen many people do this as well, however my main concern is violating the TOS by including the ads on non-content pages like login, search, 404s etc. From the many sites I've seen running the top banner, they have simply ignored this. Using blocks (at least in 4.5Head) or inline has the advantage of being able to limit the ads to content only pages.

I think in the end I will have to customize the template so that it checks against a list of 'invalid' urls, only displaying if the page is a 'content' page. Since the number of 'non-content' pages is relatively small, I will probably end up hardcoding them into the template.

Any thoughts on a better way to do this would be much appreciated. . .

dtan
--------------------------------------------------------------
Personal Blog Site

robertdouglass’s picture

You can use regular expressions or create a list of pages on which our block is to be shown. This feature is especially nice the CVS (soon to be 4.5.1) version of Drupal.

- Robert Douglass

-----
visit me at www.robshouse.net

dtan’s picture

Yup, I knew that this was possible with blocks, but like I mentioned earlier, I don't want to display the ads in blocks, but rather the banner.

I ended up copying the behaviour from blocks. Created a little module where I can input default adsense code and restrict the pages that they are shown.

dtan
--------------------------------------------------------------
Personal Blog Site
Critic Club (Under Construction)

carl ditzler’s picture

Any chance you could share this, with restriction of pages for adsense display?
Thanks

rational@rationaldev.com’s picture

I put together a little page about how I use PHPTemplate to Show/Hide Google Adsense Messages in Drupal 4.6

http://www.rationaldev.com/google-adsense-code-in-drupal---showing/hidin...

~-~
www.rationaldev.com

Steven’s picture

The block admin/path changes are part of CVS/HEAD. This means they will be available in the next major release, most likely 4.6.0.

4.5.1 is a minor release and only contains bugfixes that were apply to CVS/4.5. No new features are included.

Lineman-at-lineman.net’s picture

They've been changing their TOS a bit. On a lot of non-content pages, they don't even let the pages display.

I don't think they'll ban you or anything. They just may not pay you for blank pages getting clicks and such. They check a lot of this by hand, it seems.

dtan’s picture

when you say "they don't even let the pages display", the pages are the ads themselves? If this is the case, it would be ideal. I was actually looking checking to see if it were possible to not display ads on certain pages.

dtan
--------------------------------------------------------------
Personal Blog Site
Critic Club (Under Construction)

Lineman-at-lineman.net’s picture

Sorry. I meant the ads.

tmarkie’s picture

lineman,

regarding your site referred above: http://lineman.net/corporateforums.php, you have the adsense ads AFTER the end of the story/post/article (user, datetime, reads, print, email etc. line) and BEFORE the add comments section.

I'm using the chameleon theme and I can figure out how to add my adsense code exactly as you have it.

Could you provide some more details on how you did this?

Thanks,
Tom

thegenericgeek’s picture

I was able to embed my adsense block within the Drupal Interlaced theme by placing each line of Adsense code in $output .= ""; tags. Unfortunately, Drupal.org will not allow the code to be inserted as a comment, I keep getting suspicious input detected and it will not allow me to put it here. Check out the page on my site for sample code.

Hope this helps!

GenericGeek.Com More Geek, Less Nerd!

Gunny-1’s picture

Verify comment authorship, you have implemented captcha to it. can you let us know the procedure.

thanks

thegenericgeek’s picture

I searched the forums for captcha and found the following links that helped me impliment it. Hope this helps.

GenericGeek.Com More Geek, Less Nerd!

shyam2053’s picture

Hi

Just wondering how to put the google ads inline.

any ideas??

thanks

carl ditzler’s picture

Like this : http://www.scienceblog.com/cms/node/7481 ? On Science Blog, it looks like he included the adsense code within the template.

thegenericgeek’s picture

I have only been able to get them to show at the bottom of each node under the comments section. I really like the embedded use. If anyone has any other info, please post it here. I will take a look at the code tonight (when I'm not at work), hopefully I can figure it out.

GenericGeek.Com

Shameless web site plug (here)

smazsyr’s picture

Quam is right, I included it in the theme itself. And the real tricks were

1) To backslash-out all the quote marks so " becomes \"
2) Use a div style= blah blah blah wherein you define the syle to be float: right
3) Include the whole mess in an $output .= thing

If I were really clever I'd know how to cut and paste the actual code so you could see yourself, but I get the 'suspicious content' warning when I do.

What I'm struggling with is taxonomy image. I can;t figure out the right way to modify my theme so when it's a Bioscience story, for example, this hypodermic needle icon shows up; transportation shows a car, etc. Like Slashdot.

thegenericgeek’s picture

I was able to reproduce, but I get my skyscraper ad block on the main page, not just in node content pages... I have a rough interpitation of my code below (hoping not to get it blocked for "security reasons!" this is about 1/3 of the way down my .theme file.

output begin content

output (ADSENSE CODE)

output $content

output end content

Should it be another place to only show up in node pages? Weird...

GenericGeek.Com More Geek, Less Nerd!

KeithDaniels’s picture

All you have to do is paste it between these tags:

<code>

(Your code goes here)

</code>

Here is an example:

<table border="0" cellpadding="0" cellspacing="0" id="content">
  <tr>
    <!-- BEGIN: blocks -->
    <td id="sidebar-left">
      {blocks}
    </td>
    <!-- END: blocks -->
    <td valign="top">
      <!-- BEGIN: mission -->
      <div id="mission">{mission}</div>
      <!-- END: mission -->
      <div id="main">
        <!-- BEGIN: title -->
        {breadcrumb}
        <h1 class="title">{title}</h1>
        <!-- BEGIN: tabs -->
        <div class="tabs">{tabs}</div>
        <!-- END: tabs -->

BTW I created the above instructions for using the code tags by using the special HTML symbol for the < instead of the < symbol directly so that it would display instead of being taken for a HTML command and executed as such:

&lt;code>
<br/>
(Your code goes here)
<br/>
&lt;/code>

So now you have no excuse not to display your actual code... :-)

Keith Daniels

netceo’s picture

I want to place google ads just like this
http://www.scienceblog.com/cms/node/7481
in my content but dont want it to show up on the home page, which is front_page. Kindly help. I am using a phptemplate theme.

KeithDaniels’s picture

lineman,

Your method of inserting it between the node and comments is about the most ingenious way I have seen lately.

Like tmarkie, I am real interested in how you placed the the adsense ads AFTER the end of the node and BEFORE the comments section on your site: http://lineman.net/corporateforums.php

I know how to formulate the code and insert in into an xtemplate theme but "where" to insert the code is my problem. I tried to put it in the xtemplate.xtmpl file but it appeared in places I did not want it to. So I finally hacked a module together that put the ad in as a "fake link" in the links at the bottom of a node ("add new comment", etc.). This is crude to say the least so you would make my day if you could give me a sane way of doing it.

I am displaying adsense ads using phpAdsNew. Which works but is a little twitchy and doesn't seem to report the adViews correctly. Also there are occasional long waits for google to serve the ad which may or may not be a phpAdsNew problem.

TIA for any response

Keith Daniels

Bèr Kessels’s picture

---
if you dont like the choices being made for you, you should start making your own.
---
[Bèr Kessels | Drupal services www.webschuur.com]