Can I Set Up An Ad Campaign To Appear Only With A Specific Blog Category?

Can I Set Up An Ad Campaign To Appear Only With A Specific Blog Category?

This guide will help SoCast Engage users target ads on their website based on the blog post category. For example, if a user visits a blog for the morning show, you can display ads sponsoring the morning show.

Step 1: Add the "Ad Setup Code"

Before you can target ads by blog post category, you need to define the ad slots and set up the ads using the "Ad Setup Code" field on the Advertising page.

  1. Navigate to the Ad Setup Code Field:

    • Log in to your SoCast Engage account.
    • Go to Website > Website Settings > Advertising.
    • Scroll down to the "Ad Setup Code" section.
  2. Modify the Ad Setup Code:

Below is an example of what the "Ad Setup Code" might look like with the setTargeting method included. The %socast.blog.categories% macro dynamically inserts the blog categories for targeting:

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> <script> window.googletag = window.googletag || {cmd: []}; googletag.cmd.push(function() { googletag.defineSlot('/1234567/blog_category_targeted_ad', [300, 250], 'div-gpt-ad-123456789-0') .setTargeting('category', %socast.blog.categories%) // Modify this line to target categories dynamically .addService(googletag.pubads()); googletag.enableServices(); }); </script>
  • Explanation:
    • In this example, the setTargeting method is used to dynamically pass the blog categories into the ad targeting.
    • This method is new, and users should modify their ad setup code to include the correct targeting key (category) and the %socast.blog.categories% macro.

Step 2: Add the Slot to the Ad Units Section

Next, you need to add the slot you defined in the "Ad Setup Code" to the appropriate ad unit.

  1. Navigate to the Ad Units Module:

    • While still on the Advertising page, locate the "Ad Units" section.
    • Select the ad unit you want to modify (e.g., "Blog Content Header Ad" or "Blog Content Footer Ad").
    • Click the pencil icon next to the ad unit to edit the ad code.
  2. Modify the Slot Code:

Below is an example of what the slot code might look like in the "Ad Units" section:

<div id="div-gpt-ad-123456789-0" style="width: 300px; height: 250px;"> <script> googletag.cmd.push(function() { googletag.display('div-gpt-ad-123456789-0'); }); </script> </div>
  • Explanation:
    • This example shows how to reference the ad slot defined in the "Ad Setup Code" section.
    • Users should modify this code according to their specific ad unit setup to ensure the correct ad is displayed.

Step 3: Set Up Category Targeting in Google Ad Manager

After setting up your ad units in SoCast Engage, you'll need to configure Google Ad Manager to target ads based on the blog categories.

  1. Log in to Google Ad Manager:

    • Access your Google Ad Manager account.
  2. Create or Edit a Line Item:

    • Navigate to the campaign where you want to apply the blog category targeting.
    • Create a new line item or select an existing one to edit.
  3. Set Up Custom Targeting:

    • In the targeting section of the line item, select "Custom Targeting."
    • Add a new key-value pair:
      • Key: category
      • Value: Enter one or more categories you want to target (e.g., morning-show, news, entertainment).
    • You can input multiple values, and Google Ad Manager will serve the ad if any of the values match the categories passed from the blog post.
  4. Assign the Line Item to the Ad Unit:

    • Make sure the line item with the custom targeting is assigned to the ad unit you set up in SoCast Engage.
    • This ensures that ads are only displayed when the blog post belongs to the specified categories.

Additional Resources


    • Related Articles

    • How Do I Setup The Default Blog List Ad Frequency? (New)

      This Article Is For: Users who have: Advertising Permissions This is applicable to: All Themes These are the instructions for setting up your Deafult Blog List Ad Frequency. Only users who have advertising permissions will have access to the ...
    • How Do I Setup A Blog Header Ad?

      This Article Is For: Users who have: Advertising Permissions This is applicable to: All Themes Note: Please allow for up to 3 hours for ads to start displaying correctly before you contact Google DFP's customer support asking them for help. If it has ...
    • How Do I Setup The Blog List Ad Code? (New)

      This Article Is For: Users who have: Advertising Permissions This is applicable to: All Themes Note: Please allow for up to 3 hours for ads to start displaying correctly before you contact Google DFP's customer support asking them for help. If it has ...
    • How Do I Create Responsive Ad Units for my Website?

      This article is for users with the following permissions: Manage Website Settings Manage Advertising Settings Access to Google Ad Manager This article is based on using Google Ad Manager for ad serving. If you do not have Google Ad Manager you can ...
    • Blog & News List Element

      This Article Is For: All users who have access to one/all of the following: pages, blogs, contests, and sidebars This is applicable to: All themes These are the instructions for filling out the 'Blog & News List' element. Once this element is added ...