DFP – Different Ad Code Depending on Category?
-
Hello All, thanks in advance for any help with this.
I am converting our Adsense ads to the DFP Ad Server, and I’m not able to set this up so far so that we can target specific categories with different ad codes. So if a 3rd party advertiser wants to buy ad space to display only in the Fitness category, for example, I need a way to do that.
I am trying this so far:
<?php if ( in_category( 'Recipes') ): ?> AD CODE 1 <?php elseif ( in_category( 'Fitness') ): ?> AD CODE 2 <?php elseif ( in_category( 'Menu Planning') ): ?> ADE CODE 3 <?php endif; ?>
…and of course I’ve added the header part of the ad code just before the closing </head> tag in header.php.
Maybe this is a case of where I’m placing the ad code, but it’s not showing up anywhere, and I have given it quite some time because I know it can take some minutes for the ads to start appearing.
Any suggestions or instruction from anyone who has successfully done category-specific targeting with DFP?
Thanks again,
Eric
- The topic ‘DFP – Different Ad Code Depending on Category?’ is closed to new replies.