Recommended approach to configure Google DFP

Posted in: Newsmag
Post count: 9

Hi, We use DFP to power our ads on our site.

We have about 6 different types of pages (Home, Movie Reviews, Photos, Box Office numbers, Polls, Videos), and will need to serve different ad tags depending on mobile or web.

On a given page, we would want to have 3 or 4 locations for an ad – e.g. header, footer, sidebar, in-article ads

And there would be different tags for mobile and desktop.

1) How do you recommend the ad slots are declared ? Would it be necessary to define 6 X 4 x 2 ad slots ?

2) Correspondingly, how would you recommend the ad slots are defined in your themes / page types, to get called per device and page type ?

Our primary goal is to be able to report and target based on page type and device, without having to lose too much hair managing the multiple ad slots.

Post count: 6535

Hi

1. The code which render the ad-spots it’s located in td_block_ad_box.php: http://screencast.com/t/PqHOTJvI

2. I assume that that you want to display different ad-spots according with the post type displayed. To achieve that you will need a condition which check what post type it’s displayed and depending by result display a specific ad. Here is an example for header ad: http://screencast.com/t/4e9sKBons This is just a basic example about how can you check what post type it’s displayed and manipulate the ads according with the result.
You can create new ad-spots following the solution offered in this topic: https://forum.tagdiv.com/topic/how-to-add-more-custom-ad-spots/ and use them in your post types.
Using do_shortcode function and some proper conditions you can display ads according by the custom post type displayed. For more details about the function’s usage check these links: https://forum.tagdiv.com/topic/different-ad-tags-for-the-category-templates-vs-the-homepage/
https://forum.tagdiv.com/topic/sub-page-no-standard-top/https://forum.tagdiv.com/topic/header-ad-on-top-of-menu/

I hope this help but if you need additional informations please provide more specific details about what you’re trying to do and maybe I can help.

Thanks!

Post count: 9

Thank you for the detailed write-up.
What is the quick check to determine if the user is on a mobile vs desktop ?

Post count: 6535

Hi

The easiest way it’s by using media queries with css like in this example:

@media(max-width: 768px){
.container-for-mobile{
display: none;
}
}

This code will load the same content on mobile as on desktop but will hide the container-for-mobile container on screens with the width bigger than 769px. For more details about media queries usage you can check this link: http://www.w3schools.com/cssref/css3_pr_mediaquery.asp

Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.