Code Monkey home page Code Monkey logo

Comments (5)

ianmurrays avatar ianmurrays commented on August 16, 2024

How are you displaying your ads with ngdfp? I do get those errors and I haven't been able to figure out why they're occurring bug my ads do show. —
Ian Murray S.

On Thu, Sep 11, 2014 at 10:51 PM, Anas Qadrei [email protected]
wrote:

Hello
My ad is being displayed using dfp generated tags but it is not being displayed when I use ngDfp. The error I am getting the console when I use ngDFP is:

Uncaught TypeError: Cannot read property 'addService' of null    angular-dfp.js:57
(anonymous function)                                             angular-dfp.js:57
q                                                                angular.min.js:7
_initialize                                                      angular-dfp.js:56
(anonymous function)                                             angular-dfp.js:118

I'm using angular v1.3.0-beta.9

Reply to this email directly or view it on GitHub:
#1

from ngdfp.

anasqadrei avatar anasqadrei commented on August 16, 2024

I just followed the instructions and changed the ids to my ids

first step, I created angular-dfp.js in my project and then I copied and pasted the code from github.

/lib/ng-dfp/angular-dfp.js

second, I included the library at the bottom of my html page

<script src="/lib/angular/angular.min.js"></script>
...
<script src="/lib/ng-dfp/angular-dfp.js"></script>

third, I changed my my ng-app.js

var myApp = angular.module('myApp', [
...
'ngDfp',
...
]);

myApp.config([..., 'DoubleClickProvider', function(..., DoubleClickProvider) {
    DoubleClickProvider.defineSlot('/11xxxx09/test_wide_skyscraper', [160, 600], 'div-gpt-ad-14xxxxxxxxx61-0');
}]);

Finally, in my html page I added this line

<div data-ng-dfp-ad="div-gpt-ad-14xxxxxxxxx61-0"></div>

from ngdfp.

ianmurrays avatar ianmurrays commented on August 16, 2024

Can you verify that the directive is actually doing something? Inspect the element and see if dfp is serving the ad?

Thanks!

from ngdfp.

anasqadrei avatar anasqadrei commented on August 16, 2024

Not sure what happened here but now it is working.

Before I had both google dfp scripts and ngDfp scripts on my page to compare them. So when I wanted to inspect ngDfp, I removed all google dfp scripts and then ngDfp served ads successfully!

Maybe you can call the ad twice from the same page or something.

from ngdfp.

ianmurrays avatar ianmurrays commented on August 16, 2024

Well that's it, you can't have a tag twice on a page, they're unique. 

I'll leave this ticket open since the error you described is technically still a bug though. 

Thanks. 

Ian Murray S.

On Thu, Sep 11, 2014 at 11:55 PM, Anas Qadrei [email protected]
wrote:

Not sure what happened here but now it is working.
Before I had both google dfp scripts and ngDfp scripts on my page to compare them. So when I wanted to inspect ngDfp, I removed all google dfp scripts and then ngDfp served ads successfully!

Maybe you can call the ad twice from the same page or something.

Reply to this email directly or view it on GitHub:
#1 (comment)

from ngdfp.

Related Issues (20)

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.