I wanted to see if you could give me a hand with your module. I'm an experienced PHP developer, and completely comfortable maintaining ad campaigns in Google DFP, but I'm having a problem figuring out your module. Admittedly, I'm new to drupal and been tearing through it for the last two weeks, and have a decent sense of it already, but there is still a good amount for me to learn. I'm hoping this isn't one of 50 emails you receive a day, because i know that'd become pretty difficult to handle..

I'm working on a side project of my own and decided to try out drupal as opposed to develope my own after I heard some pretty good things about it. I wanted to start planing DFP ad campaigns on the site, but haven't had any luck getting them to work. I've installed the "Doubleclick for Publishers" module, placed my network ID in there, then created an Ad, but I'll admit, i'm not sure how to use the ad unit pattern (or what exactly I'm supposed to achieve from it). I read your post here, http://bleen.net/blog/doubleclick-publishers-drupal, and i believe the ad unit pattern in that example at least is used for matching up the url to know if you're in the right area to show an ad. I've also added the ad block to the header of my page, but so far I haven't been able to get an ad to appear on my site. I also feel like i'm missing a step in connecting the ad unit specifically to the ad in the dfp module. (I hope that makes some sense). Again, I hope you don't get 50 of these emails a day and could help me out. I'd really appreciate it. If there's any other info I could provide that might help, please let me know!

Comments

bleen’s picture

When you create your ad tag as a block and then add it to your header region, does the ad tag itself actually appear in your markup (I understand that you do not see an ad)? If so, can you paste an example of the ad tag that is appearing in your markup so I can take a look? Also, it would be helpful if you gave an example of an ad unit you have setup in the DFP tool. The name of the ad unit in DFP generally corresponds to the ad unit pattern so if you have an ad unit in DFP called sports/baseball/yankees, then your ad unit pattern should match that. Most of the time you want your ad unit pattern to be dynamically set so this module integrates with "tokens" ... if you havent already, please install the token module as it will make using tokens much easier. Anyway, to include a token in your ad unit pattern you should see a list of them below the ad unit field. Just copy and paste the one you want to use into the field and when your ad tag is placed on your page you should see that the token is replaced with the desired value (ex. the user:name token will be replaced with "fred" if that is the current user's username).

Hopefully this helps some.

faceless105’s picture

I've checked the code in the header, but I don't believe I'm able to see the ad code. I'm including a link to my site (http://www.brobility.com - it's pre-launch so please ignore the plain looks to it, lol).

The two ad units I'm attempting to use are labeled "bro-front_right-300x250", and "bro-front-top-728x90". They are named the same in google DFP and in the DFP module. I have one block placed in the header (the 728x90), and one block placed in the right rail of my front page (the 300x250).

For their tokens I've only got a call out to, "[dfp_tag:network_id]". If I'm understanding this correct, to get them appear, I should have the Ad slot name match the name of the ad unit in DFP, and the ad unit pattern should match the name of the ad slot at some point to come up? I think it's likely the usage of the ad unit pattern is what is really throwing me off.

If that's the case, is there a way to simply have an ad always show anywhere it is placed?

bleen’s picture

are you positive that the DFP blocks have been placed in those regions? You should at least see an empty div in there even if the ads are not properly configured...

Some notes:
- the [dfp_tag:network_id] token is included automatically so you shouldn't need to add that

I should have the Ad slot name match the name of the ad unit in DFP

This is incorrect. The ad slot name is for your administrative purposes only. You should have the ad unit pattern should match the ad unit in DFP.

faceless105’s picture

Man, I feel like a broken record on getting this up and running. I dug deeper in the source, the ad units are attempting to be displayed. I gave the block on the page a custom css style to make it easier to find. It had the message, "Placeholder for empty "DFP tag: bro-front_right-300x250"" - which is the correct DFP ad unit. This is for the front page, and you can tell from an ad unit name like, "bro-front_right-300x250" it's unlikely I'll ever match that with a token. So the next step would be having an ad that's always on. I pasted that ad unit name into the ad unit pattern, but still no luck. So in that instance, I would ask, how would I get that ad unit to show up? As of this moment I'm planning to show it only on the front page, so I'm not worried about making a poor approach that won't work universally. I just want to see it working somewhere to start playing with the settings from there out.

Again, I really appreciate the help with this!!!

faceless105’s picture

I've been studying the source codes, and I see the problems now, though I'm not sure on the solution just yet.

On my home page (where I am trying to show an ad), and on the DFP test page, the both have the following..

var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];

and...

googletag.cmd.push(function() {
  googletag.pubads().enableAsyncRendering();
  googletag.pubads().enableSingleRequest();
  googletag.pubads().collapseEmptyDivs();
});
googletag.enableServices();

But on the home page, that's all I'm seeing on the home page.
I don't see the tags being defined
(Instead of the network id, I replaced it with 'xxxx')

googletag.defineSlot("xxxxx/bro-front_right-300x250", [300, 250], "dfp-ad-clone_of_front_top_728x90")
  .addService(googletag.pubads());

Or the calls to the ads to display,

googletag.cmd.push(function() {
      googletag.display("dfp-ad-clone_of_front_top_728x90");
    });

I'm still unsure why this is the case, but at least I feel like I'm moving forward.

faceless105’s picture

still no luck with this module

bleen’s picture

someone recently posted an issue that may be causing your problems here: #1780844: Ads never rendering in blocks

I haven't posted a patch there yet (still needs tests) but you can easily try the fix recommended. Hopefully it helps

faceless105’s picture

That fixed it for me, You have no idea how happy this has made me, lol.

I appreciate the time too, I know developing a widely used module can be time consuming enough without having to help troubleshoot it with people like me!! but definitely thanks for the help!!

bleen’s picture

Status: Active » Fixed

glad that worked ... closing this issue

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cllamas’s picture

Hi, i just installed your module and I opened an account on DFP, I'm trying to figure out how to create a Test Ad so I can check if it works on my site before purchasing any Ad. Is that possible?

I have an Ad Unit in my DFP site called "featured" and one DFP block in your module called "featured" as well, but nothing shows here... What can I be doing wrong?

:)

Thanks a lot!

piyushpoddar’s picture

Try using Google Publisher Console to debug the DFP ads, if need be.

Append ?google_console to your page's URL.

For example, if your page is located at www.drupal.com/page, you’d modify the URL to www.drupal.com/page?google_console.

Use the keyboard shortcut Ctrl+F10 (on a Mac, use Function+Ctrl+F10) to open the console

https://support.google.com/dfp_sb/answer/181070?hl=en