Example of a Built-in Ad Server

The following example is an ad translator which can be used to serve video ads without the use of an ad server. This example is given as an alternative to using a real ad server or to using ad XML without an ad server.

Note: The steps outlined in this topic are for Flash based players only.

This example is only for video ads; banners and overlays are not supported. Video ads are served by using a video selected from your Video Cloud account, and only one video can be chosen in the key/value pair. Videos that are used as ads will show up within Video Bandwidth in the Video Cloud reports, but the video ads will not show up as a Video Play in the reports.

Using the Ad Translator

Here are the basic steps for using the standalone translator:

  1. Download StandaloneTranslator.zip.
  2. Place the Standalone.swf file on your webserver. We do not host the standalone ad translator, so you will need to provide your own URL for it.
  3. Set the ad translator at the player or account level.
  4. If you are using video ads, upload the video in the Media module.
  5. If you are using video ads, get a Media API read token, which you can request from customer support. You must also ask customer support to have this token expose the FLV URL.
  6. Set up the key/value pairs that are needed for a video ad as described in the next section. The key/value pairs can be set in any of the places they are allowed, such as in the player edit screen.
  7. Set the rest of the ad policy settings you would like for the player, and then preview the player to see the ad.

Required Key/Value Pairs for Video Ads

The key/value pairs mentioned in step 6 above are essential to using the ad translator. Before we go over the key/value pairs that are required for video ads, note that your Video Cloud account must be configured to deliver video content via progressive download (that is, HTTP or PD delivery) or be configured for universal delivery service. If you have an account that delivers content via streaming but does not have universal delivery service enabled, video ads will not play in this example.

You will need to use a key/value pair to provide a video ID so that there is an ad to play. The video ID is specified as follows:

    videoID=<The id of the video that you would like to use as an Ad>;

This ID can be found in the media module when the video is selected, as shown below.

video ID

If you are providing a video ID, you must also provide the Media API read token, which you can request from customer support. You must also ask customer support to have this token expose the FLV URL.

    token=<The Read Token given to you by customer support>;

If you are using the universal delivery service, you must also set a key/value pair for this.

    uds=true;

Optional Key/Value Pairs

You can also provide a Google Analytics ID for tracking the ads. For example:

    googleAnalyticsID=<The Google Analytics account id to send tracking data to>;

The ad translator will send an event before the ad has started and when it completes. Note that the start event is not the same as the IAB standard impression event.

If you are providing a video ID, you can specify a click-through URL:

    videoClickURL=<URL for the video ad>;

And if you're having problems, you can add a debug key to see more debug info in flashlog.txt:

    debug=true;

Combining Key/Value Pairs

All of the key/value pairs mentioned above need to be put together on the same line in whatever location you use to set up your key/value pairs. Here's an example of a standalone translator set up to serve a video ad and use Google Analytics:

    token=pCODGcrykerP4-LuBio.;videoID=12345;googleAnalytics=UA-111-222

Compiling the Ad Translator

The source is provided in the zip file so that you can make your own changes to the ad translator as needed. The example is heavily commented to make it easy for you to do more with it.

In order to compile the ad translator, follow the steps given in the documentation for creating an ad translator. One additional step is needed, which is that a Google Analytics SWC has to be in the library path to compile. Use the analytics.swc from Google.

Limitations

There are a few limitations with the standalone ad translator. It only serves video, and so it does not have support for banners or overlays. Also, the start event that's sent to Google Analytics is not an IAB standard impression event. The start event may be good enough for your own tracking, however. As noted above, only one video can be chosen in the key/value pair.

If you are willing to compile and make changes to the ad translator yourself, all of the limitations above could be removed. The banners and overlays could be set up by passing in a new key/value pair that gives the URL of a SWF. An IAB standard impression could be added by inserting a startTrackURLs element into the ad XML. More than one video could be chosen by changing the media API call to look at a playlist or to search for a tag.

One limitation that cannot be removed is that the standalone translator is a simple class compared to a real ad server. Ad servers such as Doubleclick and Tremor provide a great deal of functionality, such as day-part targeting, ad campaign frequency capping, etc., that can't be replicated here. Brightcove has many advertising partners that you can talk with about your advertising needs.

Comments?

If you have problems using the standalone ad translator, have made some reusable changes you'd like to share, or want to suggest something more we can do, head over to the developer forums and let us know about it!

Post new comment

The content of this field is kept private and will not be shown publicly.
0

Comments