Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

    • CommentAuthormediaverse
    • CommentTimeApr 21st 2009
     

    Can you define an ad zone to only display on this or that category? In other words, if I want a netflix ad on "movies" and "entertainment" categories only, and expedia ad on "travel" category only. For sites with wildly different categories (e.g. newspaper sites) this is might be a critical feature. Thx.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeApr 21st 2009 edited
     
    Project Admin

    It's not an implicit feature, however it can be achieved:

    1.) Name each zone in line with the category of ads you want it to display. You now have 1 zone per category.

    2.) Add the output code to your site, setting the ad zone using the category:

    //category to zone array
    $zones = array( 'cat_id1'=>'zone_id1', 'cat_id2'=>'zone_id2' );
    //get current category ID
    $cat_id = get_query_var('cat');
    //get zone ID
    $zone_id = $zones[$cat_id];
    //use a default zone ID, if no category match found
    if(empty($zone_id)) {
    $zone_id = 1;
    }
    //display zone
    oiopub_banner_zone($zone_id);

    As you can see, there is a small amount of manual work involved, but all it does is create a relationship between each Wordpress category ID and OIO zone ID that you need, then uses it to call the correct zone.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorRedspain
    • CommentTimeAug 8th 2009
     

    I'm trying to do this but I can't!

    I've 3 categories called flowers,plants and roots their ids are 100, 101 and 102

    I made 3 zones called just like my categories: flowers,plants and roots their ids are 2, 3 and 4

    Now, what code I've to add in my site?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeAug 8th 2009 edited
     
    Project Admin

    If using Wordperss:

    The latest version contains a feature (for Wordpress only) that lets you filter ads by category automatically. If switched on, an advertiser making a purchase in that zone is asked to choose a category and their ad is only displayed if the page matches that category. You can then just use the standard php output code.

    To turn it on, navigate to the ad zone settings in the admin area and look for the "Use Wordpress Categories" option.

    Not using Wordpress:

    If you're not using Wordpress, the code would look something like this (surrounded by <?php ?> tags):

    //category to zone array
    $zones = array( 100=>'2', 101=>'3', 102=>'4' );
    //get current category ID
    $cat_id = get_app_catID();
    //get zone ID
    $zone_id = $zones[$cat_id];
    //use a default zone ID, if no category match found
    if(empty($zone_id)) {
    $zone_id = 1;
    }
    //display zone
    oiopub_banner_zone($zone_id);

    To complete that example, you'd need to substitute "get_app_catID()" with whatever code your application uses to retrieve a page's category ID.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorjuniorBRA
    • CommentTimeJan 10th 2014
     

    Hi,

    I'd like to know if it is possible to define an ad zone to only display on this or that category using Inline Ads?

    Thanks

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 11th 2014
     
    Project Admin

    Not with inline ads - that option is only available with standard banner / text ads. You could display a banner ad zone within your posts though (e.g. using another plugin to manage placing content within posts automatically).

    Need help?  Quick start guide | Troubleshooting | All help topics