Tech-savvy creators who don’t use the Raptive Ads WordPress Plugin can still take advantage of category targeting in Playlist Management. These instructions describe how you can assign playlists to page categories programmatically or manually.
How Category Targeting Works
Raptive Body Classes
You can use Raptive body classes to assign playlists to play on specific pages based on the page category. If you’re not using the Raptive Ads WordPress plugin on your site, you’ll need to add body classes to indicate the page-level categories.
Here’s an example of a typical body tag with added classes:
<body class="single single-post wp-embed-responsive content-sidebar singular brand-eoad adthrive-cat-grilling adthrive-cat-beef adthrive-cat-main-dish-recipes adthrive-device-desktop wpdiscuz_7.6.1" id="top">
In this example, you can see there are three categories applied to the page: “beef,” “grilling,” and “main-dish-recipes.” The additional classes in the example are used for other purposes.
The structure for all page category assignments added as body classes is adthrive-cat-category, where the category is the term you’ll save in the Raptive Dashboard. adthrive-cat tells Raptive that the page includes a body class with a page category for targeting playlists.
When creating categories for targeting playlists in the dashboard, use the exact category name from the body class.
Here’s an example where “beef” is the page category. When assigning a playlist to this category, it will be eligible to play on any page with the body class adthrive-cat-beef.