ianmurrays / ngdfp Goto Github PK
View Code? Open in Web Editor NEWDoubleClick For Publishers for Angular JS
License: MIT License
DoubleClick For Publishers for Angular JS
License: MIT License
It would be nice if the configuration had support for adding the companionAds()
service to slots.
Are you planning on adding support for Synchronous Request?
Type: "Out Of Page"
Ex. Mobile Adhesion Banner
When the ad is empty, the container doesn't hide.
I'd like to be able to make css changes based on the existence of an ad. I already hide when empty, but I need to also change padding on the parent container. Currently, I had to modify the source of the js and check it into my own code base to achieve this. Here's what I had to do, for reference:
.directive('ngDfpAdContainer', function () {
return {
restrict: 'A',
controller: ['$element', function ($element) {
function hide(mode) {
if (mode === 'visibility') {
$element.css('visibility', 'hidden');
}
else {
$element.hide();
$element.parent().parent().css('width', '0px'); // I added this
$element.parent().parent().css('padding', '0px'); // I added this
}
}
function show(mode) {
if (mode === 'visibility') {
$element.css('visibility', 'visible');
}
else {
$element.parent().parent().css('width', '100%'); // I added this
$element.show();
}
}
this.$$setVisible = function (visible, mode) {
if (visible) {
show(mode);
}
else {
hide(mode);
}
};
}]
};
Is there a more elegant solution?
Thanks!
I'm using almost the exact same code as what is in the readme (difference being that I'm using my IDs instead of the ones in the example) and I'm not seeing any responsive behavior.
It defaults all of my ads to the largest across the board.
i would ask if i can use this library for angular 2
i need it so bad !
Firstly this project has been a life saver for me so thank you.
My issue has been and this could be because of my shady Angular experience but when defining slots on my implementation a call is made for all adverts even those out of view which has caused issue for my client and they asked me to disableInitialLoad(), I think this would be a handy feature to add to the project I have manually added it to the copy that I have googletag.pubads().disableInitialLoad(); and it seems to work but others may benefit from this too.
Thanks again.
setPageTargeting
is a bit misleading. this could be documented also!
We are having some isses with Google indexer, because it doesn't load some js files, so the initialization of ngDfp fails and break js execution to get the page loaded.
My recommendation is to put a try catch on $get method, inside the callback function passed to
I'm looking for a maintainer for this project, since I don't have time to keep up with issues and to keep this up to date.
Is it possible to add cust_params when the slots are defined and refreshed? Maybe using $window.googletag.pubads().setTargeting(key, value)?
I want to send some targeting information to DFP.
Thanks in advance for your reply!
When clicked it appears that my DFP ads are being opened in the inappBrowser and the user is not able to return to the app without closing and reopening. Is there any way to force ad links to be open by the default device browser?
I want to open the link that is vinculate in DFP ad, but it's opening in the app and I can't to back to the app
I'm reading through the sourcecode and looking for a way to pass a callback function to check after the slot has rendered if it is empty, with the isEmpty
method available on DFP.
I found where I can call that method in the source, but I'm looking for a way to pass a callback function when I define a slot.
Not an issue with the library, it does what it says. I'm trying to take a stab at this myself, but I can't see how it can be done.
Did anyone try this?
e.g. in my case, because currently the directives data-ng-dfp-ad-hide-when-empty data-ng-dfp-ad-container
are not working for me and I need to hide my container.
I apologise if this is not the place for such questions, as it's not a technical issue more of a " does this feature exist " kind of thing.
I want to use defineOutOfPageSlot function for pageskin ads but i can't see its in your code. Can you add this feature? anyone help me?
Can you add documentation in the readme as to how slot targeting works?
in current version of ngdfp it only support "defineSlot",
is it possible to add defineOutOfPageSlot.
I have a big box ad on each sub page of my site. The ad displays properly on initial load but on route changes the ad won't reload and the area remains blank. My workaround is to call refreshAds()
on $routeChangeSuccess
events.
$rootScope.$on '$routeChangeSuccess', (e, newRoute, oldRoute) ->
DoubleClick.refreshAds 'div-gpt-ad-1234567890'
$interval.cancel dose not working, so $interval service still alive when come back with router.
I think it is necessary that $interval.cancel when DOM destroy. And $timeout too.
I've noticed that 'ng-dfp-ad-hide-when-empty' doesn't correctly detect when the advert isn't visible. I'm inspecting with the debug tools, and it still hides the div even when there is an advert inside.
Is there a way to get adverts to show if they're inside an ng-repeat/ng-if block? I seem to consistently get black spaces at the moment.
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
Hello,
Randomly my ads don't load and I get this error in my console.
$window.googletag.display is not a function
DoubleClickProvider.defineSlot('/530209488/Parties_1', [300, 100], 'div-gpt-ad-1470051144620-0')
.defineSlot('/530209488/Parties_2', [300, 100], 'div-gpt-ad-1470051144620-1')
.defineSlot('/530209488/Parties_3', [300, 100], 'div-gpt-ad-1470051144620-2');
DoubleClickProvider.setPageTargeting('city',localStorage.getItem('DFTcity'));
on changing the localStorage city value, the pageTargeting is not changing dynamically .
it is effecting after hard refreshing the page(this is due app.config() is re initializing at the time city value taking). How i can change pageTargeting from my controller.
Hi,
I just noticed that there is a problem injecting the ngDfp module into my angular application when the ngDfp source file is compressed using grunt uglify command.
Couldn't figure out where is the broken line.
Please take a look!
Regards,
Attila
Hello, I'm getting this error in my browser's console,randomly.
And when this error is thrown, the ads are not loading.
Any idea why?
This may be a dupe of #4, but I need to define slots later on rather than in the module config. The ad's ids, tags, etc. are managed in our CMS and come down into the client application via a $resource service inside of a controller. I tried to hack the service returned via the DoubleClickProvider to update the slots array but no luck. Any tips for this matter would be greatly appreciated. Thanks!
would be great to see some kind of support for googletag.pubads().collapseEmptyDivs();
Not sure if it's an issue on my side or issue on google's side or if anyone else had this problem. Does dfp generally work when you are on localhost?
As stupid as this question may seem, It worked for a while today, now again it's not showing ads. The request does get sent do and google responds with an empty ad.
My website is responsive and built using bootstrap 3.2. However I couldn't control the ads using ngDfp
This article suggest using multiple sizes
https://support.google.com/dfp_premium/answer/3423562?hl=en
But when I add this line in my angular code
DoubleClickProvider.defineSlot('/11xxx09/responsive_leaderboard', [[970, 90], [320, 50], [728, 90]], 'div-gpt-ad-14xxxxxxx51-0');
It always takes the first size ([970, 90] in that case).
How can I fix this? Does ngDfp support responsive ads or multiple ad sizes?
If I call
DoubleClick.refreshAds('ad-leaderboard', 'ad-leaderboard-sm', 'ad-square');
it only refreshes the first argument, the other two are ignored.
Calling
DoubleClick.refreshAds('ad-leaderboard-sm');
DoubleClick.refreshAds('ad-square');```
works as expected. Not sure if it's a bug or if you want to just adjust your readme.
The portal header my client supplied already loads the "www.googletagservices.com" script tag. It would be nice if ngDfp checked for the existence of once before it created its own.
I need to set targeting on the pubads()
service. Is there a formal time I should do this?
googletag.pubads().setTargeting('section','example');
googletag.pubads().setTargeting('page','example');
googletag.pubads().setTargeting("site","example");
googletag.pubads().setTargeting("network","example");
googletag.pubads().enableVideoAds();
googletag.companionAds().setRefreshUnfilledSlots(true);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.