DFP ads not always showing on all browsers - html

We have implemented multiple ads on our site and it has been working fine since recently. We have not touched our line items but created a few new creatives which are currently displaying. However, since this change, we randomly end up with certain ads not showing at all causing blank spaces. We have not touched the initial code or ids. We have tried logging into user accounts and that seems to cause ads to load more often but we still sometimes sit with an empty space block.
I have tried to research this subject but cannot find a solution. I have tried the fixes stated by this site but it did not help.
I have also looked at this discussion where they stated the importance of having a user account, which seemed to help but we still sit with blank spaces instead of ads from time to time.
<div>
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/191675786/bottom_mobile', [300, 250], 'div-gpt-ad-1470805011041-0').addService(googletag.pubads());
googletag.defineSlot('/191675786/top_mobile', [320, 50], 'div-gpt-ad-1470804718031-0').addService(googletag.pubads());
googletag.defineSlot('/191675786/bottom_widescreen', [728, 90], 'div-gpt-ad-1470804049204-0').addService(googletag.pubads());
googletag.defineSlot('/191675786/right_side_1', [300, 600], 'div-gpt-ad-1470775758148-0').addService(googletag.pubads());
googletag.defineSlot('/191675786/middle_mobile', [320, 50], 'div-gpt-ad-1490793232691-0').addService(googletag.pubads());
googletag.defineSlot('/191675786/right_side_2', [300, 250], 'div-gpt-ad-1470775758148-1').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</div>
<aside class='adverts'>
<div class='mobile-advert text-center'>
<!-- /191675786/top_mobile -->
<div id='div-gpt-ad-1470804718031-0' style='height:50px; width:320px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1470804718031-0'); });
</script>
</div>
</div>
</aside>
<aside class="adverts padding-medium-top">
<div class="widescreen-advert">
<!-- /191675786/bottom_widescreen -->
<div id="div-gpt-ad-1470804049204-0" style="height:90px; width:728px;">
<script>
googletag.cmd.push(function() { googletag.display("div-gpt-ad-1470804049204-0"); });
</script>
</div>
</div>
</aside>
<section class='rightside-container col-sm-4 col-xs-12'>
<aside class='adverts'>
<div class='mobile-advert text-center'>
<!-- /191675786/bottom_mobile -->
<div id='div-gpt-ad-1470805011041-0' style='height:250px; width:300px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1470805011041-0'); });
</script>
</div>
</div>
<div class='widescreen-advert'>
<!-- /191675786/right_side_1 -->
<div id='div-gpt-ad-1470775758148-0' style='height:600px; width:300px; margin-bottom: 20px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1470775758148-0'); });
</script>
</div>
<!-- /191675786/right_side_2 -->
<div id='div-gpt-ad-1470775758148-1' style='height:250px; width:300px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1470775758148-1'); });
</script>
</div>
</div>
</aside>
</section>
We have not found any solution as of yet and we do not understand why it only show ads sometimes but not always. Correct me if I am wrong but if the code was incorrect, wouldn't that mean that no ads would show ever?

Related

Hidden div in my html file

I am currently using scrollNav.js after I fused it in with my HTML I noticed there is some extra div showing in my HTML.
But I can only detect this div through Google Devtools (f12). Is this even possible?
This is my HTML file:
<section id="scrollNav-1" class="home scroll-nav_section">
<div class="container">
<div class="tagline post-article"> <!--row1-->
<h2>HI !</h2>
</div>
And this is the div according to DevTools (f12)
<section id="scrollNav-1" class="home scroll-nav_section">
<div class="container">
<nav class="scroll-nav fixed" role="navigation"><div class="scroll-nav__wrapper"><span class="scroll-nav__heading">Scroll To</span><ol class="scroll-nav__list"><li class="scroll-nav__item active in-view">HI !</li></ol></div></nav><div class="tagline post-article"> <!--row1-->
<section id="scrollNav-1" class="scroll-nav__section"><h2>HI !</h2></section>
</div>
*My current update now is I am able to delete the "scroll to" by typing False in showheadline and the rest of all additional div by setting display:none
and become like this:
But this is not the result that I wanted to. i want it to be crystal clear, where it came from and how to overcome it instead of just making it hidden.
<section id="scrollNav-1" class="home scroll-nav_section">
<div class="container">
<nav class="scroll-nav fixed" role="navigation"><div class="scroll-nav__wrapper"><ol class="scroll-nav__list"><li class="scroll-nav__item active in-view">HI !</li></ol></div></nav><div class="tagline post-article"> <!--row1-->
<section id="scrollNav-1" class="scroll-nav__section"><h2>HI !</h2></section>
</div>
the script:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="js/scrollNav/jquery.scrollNav.min.js"></script>
<script>
$('.post-article').scrollNav({
sections: 'h2',
subSections: false,
sectionElem: 'section',
className: 'scroll-nav',
showHeadline: false,
showTopLink: false,
topLinkText: 'Top',
fixedMargin: 40,
scrollOffset: 40,
animated: true,
speed: 500,
insertTarget: this.selector,
insertLocation: 'insertBefore',
arrowKeys: false,
scrollToHash: true,
onInit: null,
onRender: null,
onDestroy: null
});
</script>
How do I delete the extra div that I don't even know where it came from?
The extra div is not extra. It's created by the scrollnav library you're using. Many plugins and libraries create extra elements on the dom in order to add their features. Nothing to worry about :)

Show/Hide onclick - angularjs

This is what i'm trying to achieve.
section1 will be hidden at page load. When user clicks on Advanced, section1 should show & section2 should hide. On clicking Basic, the opposite should happen. Nothing happens when I click any of the anchor tags now. Where am i going wrong.
<div class="container" ng-init="advstatus=true">
Basic
<br/>
Advanced
<div class="section1" ng-hide="advstatus">
///...
</div>
<section ng-show="advstatus" class="section2">
///...
</section>
</div>
In AngularJS you need to use ng-click instead of onclick.
Also, ng-init isn't supposed to be used unless you're in ng-repeat, which you are not (take a look at the Docs).
You should set up the variable in your controller:
<div ng-app ng-controller="myCtrl" class="container" >
Basic
<br/>
Advanced
<div class="section1" ng-show="!advstatus">
Section 1
</div>
<section ng-show="advstatus" class="section2">
Section 2
</section>
</div>
Controller:
function myCtrl($scope) {
$scope.advstatus = true;
}
JS Fiddle
This one is easy to understand
<div class="section1" ng-show="state1">
Section 1
</div>
<div class="section2" ng-show="state2">
Section 2
</div>
<input type="button" value="Advance" ng-click="sec1_show()" />
<input type="button" value="Basic" ng-click="sec2_show()" />
<script>
function homecntrl($scope) {
$scope.state1 = false;
$scope.state2 = true;
$scope.sec1_show = function () {
$scope.state1 = true;
$scope.state2 = false;
};
$scope.sec2_show = function () {
$scope.state2 = true;
$scope.state1 = false
};
};
</script>
Very simple just do this:
<button ng-click="hideShow=(hideShow ? false : true)">Toggle</button>
<div ng-if="hideShow">hide and show content ...</div>

ng-show is not working in angularjs

my json responce is {isVimeo = true } in angular js
<div ng-show={{isVimeo}}>
----
----
------
</div>
I want to show this div when isVimeo is true,but it is not display at my html.when i click inspect element in my html page the following code is there
<div ng-show="true" class="ng-hide">
</div>
when i remove the ng-hide class in inspect element it is displaying.By default it is not displayong
Can anyone help!
Thanks!
<div ng-show="isVimeo">
And be sure $scope.isVimeo is set to true in the current scope.
angular.module('testApp',[]).controller('testCTRL',function($scope)
{
$scope.wantToShow = true;
$scope.dontShow = false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<head>ng-show example:</head>
<body data-ng-app="testApp">
<div data-ng-controller="testCTRL">
<br>
<b>ng-show is true:</b>
<span data-ng-show="wantToShow"> It is showing this becuase ng-show is true</span>
<br><br>
<b>ng-show is false(So,nothing we are showing):</b>
<p data-ng-show="dontShow">It is showing this becuase ng-show is true</p>
</div>
</body>

Bootstrap Carousel Wont Start Cycle Automaticly

I've been working on my carousel and it seems to be working now.
It start cycling, but not before I've hovored my cursor once over it. How do I make it start cycle automaticly, so people doesn't have to hover the carousel.
Heres my code:
<div id="slider" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<img src="img/slide1.jpg" id="picture">
<div class="carousel-caption">
<center><h4>ADD TEXT LATER</h4>
<p>ADD TEXT LATER</p></center>
</div>
</div>
<div class="item">
<img src="img/slide2.jpg" id="picture">
<div class="carousel-caption">
<center><h4>ADD TEXT LATER</h4>
<p>ADD TEXT LATER</p></center>
</div>
</div>
<div class="item">
<img src="img/slide3.png" id="picture">
<div class="carousel-caption">
<center><h4>ADD TEXT LATER</h4>
<p>ADD TEXT LATER</p></center>
</div>
</div>
<div class="item">
<img src="img/slide4.png" id="picture">
<div class="carousel-caption">
<center><h4>ADD TEXT LATER</h4>
<p>ADD TEXT LATER</p></center>
</div>
</div>
</div>
<a class="carousel-control left"href="#slider" data-slide="prev">‹</a>
<a class="carousel-control right"href="#slider" data-slide="next">›</a>
</div>
<script>
$('.carousel').carousel({
interval: 1000
})
</script>
<script src="js/bootstrap-carousel.jss"></script>
Other than adding placeholder images, I took your exact HTML and it seems to work correctly for me # http://www.bootply.com/66558 .
Perhaps you could double-check everything is good with your CSS and JS files, or alternatively try using CDN versions for troubleshooting
Good luck!
EDIT
If the above still doesn't work for you, try initialising with
$(document).ready(function () {
$('.carousel').carousel({
interval: 1000
});
$('.carousel').carousel('cycle');
});
See live: http://www.bootply.com/66559
It seems to work with the "cycle" but how do I change the interval then? It goes so quickly if I add the cycle.
EDIT
Never mind, I just took the interval from 1000 to 10000, now it seems to work perfectly. THANKS YOU SIR!
Still havent helped me, nor browsing git hub discussions.
Everybody seemed not to see the real problem that the carousel is really pausing when the mouse is on the container....so I had to read through the .carousel docs
and its really there... pause atribute have to be set on null or its on default set to "hover" which will pause it ...
so for me add this is the resolution:
add the interval, set pause on null, and then manually call the carousel
<script>
$(document).ready(function () {
$('.carousel').carousel({
interval: 3100,
pause:null
});
$('.carousel').carousel('cycle');
});
</script>
I had to add delay for carousel starting function. For some reason it did not start after routing to another page view.
This is what did the trick for me:
<script>
setTimeout(function() {
$('.carousel').carousel();
}, 3000);
</script>

angularjs template ng-view

Anyone can please tell me what im doing wrong here:
i just update the library, and seems that the code broke for some reason it's not doing anything.
angular library
html5 code
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<header id="header">
<h1 id="logo"></h1>
<div id="menu">
<a ng-click="setRoute('home')" class="btn">Home</a>
<a ng-click="setRoute('about')" class="btn">about</a>
<a ng-click="setRoute('experiments')" class="btn">Experiments</a>
</div>
<div class="color"></div>
<div class="clear"></div>
</header>
<!-- //top -->
<div class="shadow"></div>
<div id="container">
<div ng-view></div>
</div>
angular.js
angular.module('WebSite', []).
config(function($routeProvider) {
$routeProvider.
when('/about', {templateUrl:'folder/test.html', controller:AboutCtrl}).
when('/experiments', {templateUrl:'folder/test.html', controller:ExperimentsCtrl }).
when('/home', {templateUrl:'folder/test.html', controller:HomeCtrl }).
otherwise({redirectTo:'/home'});
});
function AboutCtrl($scope) {
$scope.title = 'About Page';
$scope.body = 'This is the about page body';
}
function ExperimentsCtrl($scope) {
$scope.title = 'Experiments Page';
$scope.body = 'This is the about experiments body';
}
function HomeCtrl($scope) {
$scope.title = 'Home Page';
$scope.body = 'This is the about home body';
}
First you need to use ng-app to setup the angular application with your module. Maybe you already did, but it is not part of the snippet you posted:
<html ng-app="WebSite">
Also, about the setRoute(), I don't know where you copy that from, but you don't need it. Just use the href with the hash, for example:
about
You need to check out the source from github at https://github.com/simpulton/angular-website-routes
There is no changeRoute method. After some dialog, I realized it was best to handle the anchors tags as naturally as possible.
Your menu element should look like this
<div id="menu">
Home
About
Experiments
</div>
Hope this helps!