GithubHelp home page GithubHelp logo

bhanditz / angular-dfp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleads/angular-dfp

0.0 2.0 0.0 700 KB

Semantic DoubleClick integration with AngularJS

License: Apache License 2.0

JavaScript 99.33% Python 0.67%

angular-dfp's Introduction

angular-dfp

Semantic DoubleClick for Publishers (DFP by Google) integration with AngularJS.

<dfp-ad force-safe-frame collapse-if-empty ad-unit="/path/to/my/ad-unit">
  <dfp-size width="728" height="90"></dfp-size>
</dfp-ad>

Description

AngularDfp allows you to interact with Google's GPT library and DFP services using only Angular directives, effectively replacing any JavaScript to define and customize your ad slots, as you usually would. Also, it was built especially with infinite-scroll and other dynamic content strategies in mind and has out-of-the-box support for it.

What does it solve?

This library solves two problems:

  1. You can define your ad slots using only HTML, which is just plain sweet.
  2. It solves problems that are sometimes encountered with GPT and Single-Page-Applications (SPAs) by giving you manual control over when to fetch and refresh ads (typically on page redirects within Angular).

Examples

We have defined (nested) directives that effectively cover all the functionality of the GPT library.

Simple Fixed Size Ad

In the simplest case, you'll simply want to define an ad with a fixed size. In that case, you would have a dfp-ad directive, which requires at least one nested dfp-size directive. The dfp-ad directive additionally takes some optional attributes, such as the collapseEmptyDiv option you may be familiar with from the GPT library. For all options, refer to the documentation, which can be generated from jsdoc with gulp docs:

<dfp-ad force-safe-frame
        collapse-if-empty
        refresh='3s'
        ad-unit="/path/to/my/ad-unit">
  <dfp-size width="728" height="90"></dfp-size>
</dfp-ad>

Demo

A live demo can be found at angular-dfp-demo.appspot.com.

License

This project is released under the Apache License. For more information, see the LICENSE file.

angular-dfp's People

Contributors

goldsborough avatar vintharas avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.