Advertiser | Publisher | Internal

Yieldbot Tagging, with DFP SB and GAM Tags

Use of Yieldbot tagging with GAM tags breaks into three main areas:

This document describes both the use of the Intent Tag as well as ad slot targeting and operations with DFP.

Document Styling

Code found in regular document text appears as:'1234');

This is regular code in references
This is highlighted code in references

Reference Code

The following reference code shows both the Yieldbot Intent Tag as well as the ad serving tagging for DFP in a simple example page.

<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <title>Example Publisher</title>
    <!-- DFP -->
    <script src='' type='text/javascript'></script>
    <!-- Intent Tag -->
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">'1234');
    <!-- END Intent Tag -->
    <!-- Note, this break between the two blocks required -->
    <!-- Yieldbot DFP/GAM ad targeting, BEFORE calls to GA_google_AddSlot() -->
        yieldbot.gam_manager("ybot_1", "728x90-banner");
        yieldbot.gam_manager("ybot_2", "300x250-right");
    <!-- END Yieldbot DFP/GAM ad targeting -->
        GA_googleAddSlot("ca-pub-xxx", "728x90-banner");
        GA_googleAddSlot("ca-pub-xxx", "300x250-right");
    <p>Content before ad.</p>
    <div> <!-- 728x90 ad location -->
    <p>More content.</p>
    <div> <!-- 300x250 ad location -->

Yieldbot Intent Tag

The Yieldbot Intent Tag is shown in the first highlighted code above in the reference code, lines 14 through 22.

The Yieldbot Intent Tag brings state of the art analytics technology, data mining and realtime matching to your site. It is the collection mechanism for Yieldbot publisher analytics and the first step towards harvesting your site intent for increased visitor intelligence and monetization.

This tag can be used with or without ad serving, with no modification to the tagged page.


For ad serving, the Yieldbot Intent Tag must come after the calls to GS_googleEnableAllServices() and before the Yieldbot DFP targeting tag section. It’s recommended that this tag be installed where it will need to be for ad serving even prior to enabling the Yieldbot advertising system so that the tag can remain untouched when the transition to ad serving is made.

In the example above, line 17 of the intent tag,'1234');, configures the unique identifier for the publisher site that it sits on – in this example the dummy value ‘1234’. To install Yieldbot on your site you must get your own version of the tag which will have the unique value assigned to your site for identification in the Yieldbot platform.

Line 18, yieldbot.defineSlot('728x90-banner');, defines the ad slots that are on the current page. If not being used for ad serving, calls to defineSlot() will not be present. If ad serving is enabled then there should be a call to defineSlot() for each ad slot on the current page.

Ad Targeting Tags

The tagging for ad serving is shown in the reference code in lines 26 through 31.

Line 28 shows the call to target an ad slot for Yieldbot ad serving: yieldbot.gam_manager("ybot_1", "728x90-banner");. This call defines a mapping between the custom criteria that will be used to identify Yieldbot has an ad to place in the specific ad slot ("ybot_1"), and the name of the ad slot defined on the page ("728x90-banner"). Note that this will only result in a Yieldbot ad being requested from DFP SB if Yieldbot determines that it has an ad to serve on the current page.

DFP Configuration

The optional Yieldbot ad serving is accomplished by using the DFP “Custom Criteria” functionality. When Yieldbot has ads available the ad request will come in with a Custom Criteria for the ad slot that was Yieldbot can place an ad for, eg: "ybot_1" with a value of "y" to serve an ad for the 728x90-banner ad slot in this example.

Configuring Custom Criteria

The configuration of Custom Criteria requires two steps. First, the Custom Critera must be defined, and second it must be applied to a DFP Line Item. Defining Custom Criteria Key

Custom Criteria are defined under the “Inventory” tab of DFP, via the “Custom Targeting” navigation item.

  1. Use the “+ New key” button to define a new Custom Criteria key, and give it the desired name, e.g. “ybot_1”
  2. Select the “Users will select from pre-defined targeting values” option, and then the “Add Values” button.
  3. Define a single value of “y” and use the “Apply” button to complete the adding of values.

Finally, the “Save” button will finish adding the Custom Criteria key.

Applying Custom Criteria to Line Item

For any Line Item that represents Yieldbot serving the ad, make the serving of the Yieldbot Line Item depend on the Custom Criteria key (e.g. “ybot_1”) having a value of “y”.

This can be done under the Settings for the Line Item, in the “Add targeting” area choose “Custom Criteria” and add the constraint that the value of “ybot_1” is “y”.

Thirdparty Creative

With DFP SB and GAM tags, each ad slot needs to have a thirdparty creative configured that contains the long ad slot name.

The following is the example thirdparty creative that would get configured in DFP for the Yieldbot campaign in the publisher ad server for the “728×90-banner”.

<!-- Creative Tag -->
<script type="text/javascript" src=""></script>
<script type="text/javascript">
    var ybotq = ybotq || [];
    ybotq.push(function () {
<!-- END Creative Tag -->