chriswgerber
Forum Replies Created
-
Forum: Plugins
In reply to: [DFP Ad Manager] Load time thoughts?I can say I have it running on a site with 400k+ uniques a month with no problems. The code itself uses core WordPress APIs (Custom Post Types) and metadata to create the positions, so it’s cacheable and everything without needing custom implementation. The JS itself is also very lightweight. The source code is available for you to checkout here: https://github.com/ThatGerber/dfp-ads
The library here doesn’t use jQuery, because I didn’t want to include a JS dependency where it wasn’t needed, especially jQuery. The plugin marks it as a dependency, but that’s for extentions (though it probably could be removed). Check out this talk on [why you don’t need jquery](https://wordpress.tv/2014/05/08/josh-broton-you-dont-need-jquery/) – Slides here: https://github.com/joshbroton/you-dont-need-jquery
Forum: Plugins
In reply to: [DFP Ad Manager] Ads not showing up sometimes, until I fixed a for loopThanks for the suggestion, AaronWebstey.
I would prefer to investigate the root of the problem: Why is the loop running an extra time? What needs to be changed to prevent that from happening for others?
However, I’ve updated the function to loop for/while loop, as well as added a new constant to that allows you to set whether or not to use the minified or full JS. https://github.com/ThatGerber/dfp-ads/pull/31
Forum: Plugins
In reply to: [DFP Ad Manager] Trouble shooting, sidebar wide skyscraper not appearing?Sometimes it takes a bit before a booked ad appears.
I’m going to mark this as resolved if it seems to be working.
Forum: Plugins
In reply to: [DFP Ad Manager] Ads does not appearI’m trying to investigate, but I’m unable to determine why it wouldn’t be showing up on your site.
Do you have any error logs from your site related to the plugin that you could share? Does it display when other plugins are disabled?
Forum: Plugins
In reply to: [DFP Ad Manager] TargetingThanks! Glad you find it useful.
Development for the plugin is done on Github (https://github.com/ThatGerber/dfp-ads) if you’re curious about following or would like to submit this as a feature request.
Forum: Plugins
In reply to: [DFP Ad Manager] TargetingElvin, I’ll look into that!
Right now, it’s set up to pass values at the page level, so you can feed any targeting you want by adding to the object before it’s sent to javascript. However, that doesn’t include targeting for individual positions. It is part of my plan to add the ability to set targeting values to individual positions, as well. Overall, I want it to be blazingly simple to setup for people who don’t need much, and still provide options for people looking for more.
If you want to add additional page-level targetin, there’s a filter called
pre_dfp_ads_to_js
that contains the data needed to setup the ad positions. To filter in new targeting, you would add a key to the “page_targeting” along with an array of values.Example:
add_filter( 'pre_dfp_ads_to_js', function( $dfp_ads ) { $dfp_ads->page_targeting['custom_key'] = array('of', 'values'); return $dfp_ads; } );
Forum: Plugins
In reply to: [DFP Ad Manager] TargetingHey elvinf,
The plugin will automatically pull the page name (broken out by
/
), categories and tags for a given page/post/post type, and automatically set them at the page-level for targeting.For example: The key:value pair for targeting a tag “Chocolate” would be
category=chocolate
or for example.com/about-us/ would be ‘page=about-us`.Here are some example screenshots:
Creating category key: https://www.chriswgerber.com/assets/uploads/2015/08/creating-targeting-key.png
Setting category value: https://www.chriswgerber.com/assets/uploads/2015/08/category-is-chocolate.png
Forum: Plugins
In reply to: [DFP Ad Manager] Sidebar widgets not showing upHmm. That’s no good.
Let me see where the issue is. I’ll have a fix up by the end of the day.
Sorry for the inconvenience.
Forum: Plugins
In reply to: [DFP Ad Manager] Integrate with headerGlad I could help. Thanks for the kind words!
Forum: Plugins
In reply to: [DFP Ad Manager] Integrate with headerThis is a bit tricky as other css on the page can get in the way, and sometimes things are sized or positioned awkwardly and it makes it harder to correctly position.
You mean if you want to center it on the page? You would need to target the ad position again with css and set the margin to auto.
Example for position titled “Website_ROS_Header”:
#ad_pos_website_ros_header { margin: auto; }
Forum: Plugins
In reply to: [DFP Ad Manager] Integrate with headerYes. Here’s an example snippet of code. I have a position titled “Website_ROS_Header” that I want to display within the header.
First I call the position to a variable. Then I run the position display it where I want it to display by calling
$header_position->display_position();
.<?php $header_position = dfp_get_ad_position_by_name( 'Website_ROS_Header' ); ?> <header> <div class="header-ad"> <?php $header_position->display_position(); ?> </div> </header>
Forum: Plugins
In reply to: [DFP Ad Manager] Integrate with headerHi spin_linda,
To implement tags in the header, you would need to edit your theme or child theme files to allow for a widget to appear in that slot or to run a function directly in that spot.
dfp_get_ad_position_by_name( $title )
will pull in an ad position based on the title.If you wanted to prevent the display of the ad on smaller devices, you would need to include custom CSS to hide those positions or all positions. For example:
@media (max-width: whatever-your-width-is) { .dfp_ad_pos { display: none; } }
Adding that to Jetpack custom CSS or to your theme’s/child theme’s style.css will had all ad positions on screens smaller than whatever you set the width to be.
Forum: Plugins
In reply to: [DFP Ad Manager] What goes in 'code'?Here is what you see when creating the position in DoubleClick. The “Code” field should match up with the WordPress “Code” field.
Forum: Plugins
In reply to: [DFP Ad Manager] target window "_blank" not workingGlad you’re enjoying it!
As for why things are display in the same window, that’s more of a DoubleClick question since it’s related to the actual rendering, so I’ll answer it as best I can.
Start from the lowest and work up: Is the creative set to open in a new window? Is the line item set to open in a new window? It’s possible that the setting for the line item or the creative is overriding the position as a whole. Double check that everything all the way up is correct.
Forum: Plugins
In reply to: [DFP Ad Manager] DFP Ad Manager and Google DFP ad tags?Thanks for the kinda words! Marking it as resolved.
In keeping with WordPress’s motto of “Decisions not Options”, the plugin makes a lot of decisions for you. But there are a lot of hooks and filters that can be used to customize the results.
Right now I’m working on putting together a full documentation and opening up APIs for developers to work from. So there’ll be more in the future, but hopefully it doesn’t mean more work for those who need a simple solution.