Ads

This document explains all functionality built in the Courant News platform to aid in integration with external ad serving platforms such as OpenX or Google Ad Manager.

Support Ad Services

Google Ad Manager

Integration with Google Ad Manager consists of two template tags. The iFrame method of embedding is used.

{% load gam %} should be placed at the top of any template that uses these template tags.

gam_init

{% gam_init %} should be placed in the <head> HTML tag of any page that will be serving ads. In most cases, this should be in a base.html template, or else in the extra_head block in a child template.

Renders using the ads/gam/init.html template.

gam_display_ad

Inserts an ad into the page based on the supplied ad slot name and display dimensions:

{% gam_display_ad "ad_slot_name" width height %}

Renders using the ads/gam/display_ad.html template.

OpenX

Integration with OpenX. The iFrame method of embedding is used by the default templates.

{% load openx %} should be placed at the top of any template that uses these template tags.

openx_display_ad

Inserts an ad into the page based on the supplied zone id and display dimensions:

{% openx_display_ad zone_id width height %}

Renders using the ads/openx/display_ad.html template.

Invocation code types

The default template that ships with Courant News uses the iFrame type invocation code. Other invocation code types can be used by overriding the template.

Future Services

If there are other services that you would like to see support, please file a ticket or post on the mailing list.

Table Of Contents

This Page