I have an Angular site with AdSense and it will load Ads on first load or refresh, but if I browse to another route, it doesn't load the Ads. Here is the directive I am using:
.directive('googleAdSense', function () {
return {
restrict: 'A',
replace: true,
templateUrl: "../../templates/googleads.html",
controller: function () {
(adsbygoogle = window.adsbygoogle || []).push({});
}
};
});
Here is where I place my script tag in the head of the index file. All views load in/out of the index file via ng-view:
<!-- Google Adsense -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Here is the usage:
<div data-google-ad-sense></div>
How can I resolve this so it loads the Ads once I go to another View?
Update: After further testing, it only loads the first 3 ads, which is consistent with Google preventing more than 3 ads per page.... the problem is that I have multiple views that aren't being treated as "pages". I am wondering if HTML5 modes handling of history has anything to do with this...