Module: dfp-size

A directive for specifying an ad size.

A dfp-size directive specifies a (width, height) pair of ad dimensions. This directive can not be defined on its own, but is only valid:

  1. when nested directly under a dfp-ad directive, or
  2. when nested directly under a dfp-responsive directive.

In the former case, the dfp-size directive specifies a fixed ad-slot size as would be passed as the second parameter to the `googletag.pubads().defineSlot()`` method. In the latter case, the directive specifies a size mapping member for certain viewport dimensions.

License:
  • Apache Copyright 2016 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
See:

Example

Example usage of the `dfp-size` directive.

<dfp-ad ad-unit="path/to/my/ad-unit">
  <dfp-size width=728 height=90></dfp-size>
  <dfp-responsive viewport-width=1024 viewport-height=800>
    <dfp-size width=320 height=50></dfp-size>
  </dfp-responsive>
</dfp-ad>