Hello,
I've just recently installed Drupal, but I must admit I wish I'd done it a long time ago. Great CMS and very easy to use IMO.

My question(s) involve the best way to integrate advertising on a website using Drupal by having ads display by keyword AND the ads must be displayed within the "content" portion of the page right above the body or product content and below the main content/page navigation, like where Home > Shopping > Dvd Players, would appear on each page for example.

The goal is to simply have PPC looking ads much like the green block "sponsored ads" section like MSN displays at the top of any search results page.

So, what I need some help with would be:

1) Do I use an app. like PhpAdsNew, where we create all the ads, set up ads to display by keyword(s), and go with PhpAdsNew use code from this app. to populate each of the page ads (if an ad exists for that keyword)?

2) I'm using the Pushbutton theme, and unfortunately am not a php programmer. So, what would the PHP code look like and where do I insert the code within the Pushbutton theme to display the PhpAdsNew ads (if that's the best method).

3) Lastly, can I also include the same code for the Search function/results by keyword? So, if someone types in "Dvd player" and clicks search, then the most relevant ads would display at the top of the search results page - much like MSN search results pages do.

Ideally, I'd like the easiest Advertising integration possible without changing core code or components, and allowing for easier Drupal updates or, worst case scenario, easiest and less difficult move possible if we had to change hosts, etc.

I appreciate any help!! Thanks!

Comments

trueMarketing’s picture

I wondered if there was documentation on adding PHPAdsNew and integrating it into a theme easily, but keep finding variations of what I need but not specifics on exact PHP code snippets to insert, etc..

Anyone? Por Favor?

SEOPosition.com
http://www.seoposition.com
Offering Pure CSS Design, Web Optimization & SEO Consulting

DallyBoy’s picture

I created a phpadsnew module that allows the placement of ads by zone in my template, just by calling the required function with the zone id. It is pretty rough and ready and needs cleaning up but it works :) However, 90% of the code came from a third party vBulletin plugin. I don't know if I can release my implementation into the wild though...

If you need to know anythng, just let me know...

Cheers

trueMarketing’s picture

Hello DallyBoy,
Does the code have the ability to display ads only if there is a keyword asociated with it? Also, what core files did you have to change to get it running?

You also said, "placement of ads by zone in my template, just by calling the required function with the zone id."

What exactly do you mean by zone, like if there was a node created in Drupal at sitenamewidget.com/section/electronics/dvd-players, then the ads would be the same for all sub-pages under that main category, or it can be different based on keywords for different product pages?

Thanks for the first reply and for your help!

SEOPosition.com
SEO Position
Offering Pure CSS Design, Web Optimization & SEO Consulting

DallyBoy’s picture

The code has the ability to display ads with either keywords or zones. Zones are setup in phpadsnew and allow you to define "sections" where different ads can be shown. For example, I can display text ads in a specific zone by calling zone:1 and another set in another place by calling zone:2.

No core mods at all, the module just adds the required function to the namespace so it can be called from anywhere.

These are the params that can be passed to the function:

/**
* Calls view_raw function from phpAdsNew either locally or via xml-rpc to get HTML advertisement code, see phpAdsNew for infos.
*
* @param	string	Zone name (zone:x) or keywords (keyword1|keyword2|...)
* @param	integer	Client-ID
* @param	string	Target
* @param	string	Source
* @param	integer	Withtext
*
* @return	string
*/

function phpads_serv_view_ad($what, $clientid = 0, $target = '', $source = '', $withtext = 0)

All the management of the ads falls to phpadsnew and this function merely displays them in your template. At the moment I am only calling 1 zone via:

<div class='advert'><?php print phpads_serv_view_ad("zone:1"); ?></div>

If I wanted to display ads via keywords instead I would call it like this:

<div class='advert'><?php print phpads_serv_view_ad("foo|bar"); ?></div>

When I first saw this in the VB forums I instantly thought - cool! should be able to get this working in Drupal! THis implentation is a little different in Drupal as I need to call the function directly. In VB the template parser takes care of that and allows easier definition of what to serve up.

Cheers

trueMarketing’s picture

I know you said the code might not be ready for release yet, but it sounds like what I'm looking for. I'd like to just set up phpadsnew independently and have ads pulled in based on keywords on possibly several drupal sites that are themed the same way (promoting similar products). Your method sounds ideal.

If it can work within drupal's search capability as well, i.e. when someone searches for a particular keyword, then the ads also come up in search, I'd be very interested in your method...

If I'm using the pushbutton theme, where would changes take place to get something like this up and running? The main template file?

Also, if I'm working with potentially thousands of keywords for pages in drupal that I'll want to be showing targeted keyword ads, how does your version scale to this size?

The line:

@param string Zone name (zone:x) or keywords (keyword1|keyword2|...)

Would I have to potentially include all the keywords here, even if it's into the hundreds for that particular zone?

Again, thanks for your help. Some great info you've given so far.

SEOPosition.com
SEO Company
Offering Pure CSS Design, Web Optimization & SEO Consulting

DallyBoy’s picture

I'd like to just set up phpadsnew independently and have ads pulled in based on keywords on possibly several drupal sites that are themed the same way (promoting similar products).

This is what I have setup. Phpadsnew is under it's own subdomain but is in the same database as the rest of the sites. I don't see why this shouldn't work for multiple sites...

If it can work within drupal's search capability as well, i.e. when someone searches for a particular keyword, then the ads also come up in search, I'd be very interested in your method...

I haven't taken it to this level yet as I only use zones. You would have to pass the keywords into the function within the main template.php file somehow I should think...

If I'm using the pushbutton theme, where would changes take place to get something like this up and running? The main template file?

Hmmm, not sure on this one. I have a custom theme I am working on but it is based on the phptemplate engine. I suppose if the pushbutton theme can take php calls in it, it should work. Don't quote me on that though as, like I said, I use a phptemplate engine based theme...

Also, if I'm working with potentially thousands of keywords for pages in drupal that I'll want to be showing targeted keyword ads, how does your version scale to this size?

The line:

@param string Zone name (zone:x) or keywords (keyword1|keyword2|...)

Would I have to potentially include all the keywords here, even if it's into the hundreds for that particular zone?

I suppose the number of keywords passed through the function would only be limited by the maximum size of the string variable. But then managing thousands of keywords in phpadsnew would get a bit nightmareish I should think....

Again, thanks for your help. Some great info you've given so far.

No probs, glad to be of help. As a Drupal newbie I don't find many things I can contribute to. Oh, as for trying it out, I might clean it up a little and then contact you via your site...

Cheers

trueMarketing’s picture

Thanks Dallyboy,
I'd like very much to be able to use something like that. Perhaps I can compensate you for helping out once you get a chance to clean up the code and contact me via SEOposition.com.

I would like to manage thousands of keywords, but we'll see how this goes in the meantime I guess...

Thanks again.
Brian

SEOPosition.com
SEO Company
Offering Pure CSS Design, Web Optimization & SEO Consulting

trueMarketing’s picture

Hello Dallyboy (or anyone else who can help),
After having lunch with one of my friends who is a programmer this afternoon he mentioned a much better way of doing this whole text advertising by keyword project.

First, he mentioned adding the option to "tag" each post within the site. this would just simply be an open field under or above the post "title" that would allow for a keyword to be entered for that particular page topic.

Example (basic functionality with just one extra field when you add a new page/blog/forum topic, etc):

Title = 10 Tips to Successful Online Marketing
"Tag" = online marketing
Body = blah blah text goes here....

Now, this is where phpadsnews would come into play and would only have to use the keyword defined in the "tag" for that page. "Online marketing" in the example above.

This seems much more simple and easy to manage, rather than having to insert potentially hundreds of keywords into the php code you mentioned above.

phpadsnew says: "It is even possible to use XML-RPC which allows you to integrate phpAdsNew with other server architectures or applications."

So, the code to inserted into the template for drupal would be XML using that particular keyword tag.

Does this make sense? It seems easier and we use this with several other large directories where we pull in ads via XML from Overture and Google - all based on that page keyword.

How easy/hard would this be to add? the potential for better revenue is extremely more than contextual advertising with Google Adsense or Yahoo Publishing Network YPN since you can either serve your own ads or tie into any PPC distribution partner, like Searchfeed, Infospace, Findwhat, etc...

thanks for listening...
Brian

SEOPosition.com
SEO Company
Offering Pure CSS Design, Web Optimization & SEO Consulting