Can I Set Up an Ad Campaign to Display Only for a Specific Blog Category in SoCast Engage?

Can I Set Up an Ad Campaign to Display Only for a Specific Blog Category in SoCast Engage?

Can I Set Up an Ad Campaign to Display Only for a Specific Blog Category in SoCast Engage?

This guide explains how to target ads on your website based on a blog post’s category in SoCast Engage. For example, if a visitor reads a post in the Morning Show category, you can display ads that sponsor the Morning Show.

Step 1: Add the Ad Setup Code

To target ads by blog category, first define your ad slots and add your ad setup in the Ad Setup Code field.

  1. Navigate to the Ad Setup Code field:

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

    Below is an example using the setTargeting method. 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%) // Dynamically targets categories
          .addService(googletag.pubads());
        googletag.enableServices();
      });
    </script>
    
    • Explanation:
      • The setTargeting method passes the blog categories into ad targeting dynamically.
      • Update your 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, add the slot you defined in the Ad Setup Code to the appropriate ad unit.

  1. Open the Ad Units section:

    • While on the Advertising page, locate the Ad Units section.
    • Select the ad unit you want to modify (for example, “Blog Content Header Ad” or “Blog Content Footer Ad”).
    • Click the pencil icon next to the ad unit to edit the ad code.
  2. Insert the slot code:

    Here is an example for 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 code references the ad slot defined in the Ad Setup Code section.
      • Modify this code as needed for your specific ad unit setup to ensure the correct ad displays.

Step 3: Set Up Category Targeting in Google Ad Manager

After configuring your ad units in SoCast Engage, set up Google Ad Manager to target ads based on blog categories.

  1. Log in to Google Ad Manager:

    • Access your Google Ad Manager account.
  2. Create or edit a line item:

    • Go to the campaign where you want to apply 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 to target (e.g., morning-show, news, entertainment).
    • You can input multiple values. Google Ad Manager will serve the ad if any value matches the categories passed from the blog post.
  4. Assign the line item to the ad unit:

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

Additional Resources