Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tunes ad loading heuristic. #1786

Merged
merged 1 commit into from
Feb 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,7 @@ window.draw3p = function(opt_configCallback) {
window.context.reportRenderedEntityIdentifier =
reportRenderedEntityIdentifier;
delete data._context;
// Run this only in canary and local dev for the time being.
if (location.pathname.indexOf('-canary') ||
location.pathname.indexOf('current')) {
manageWin(window);
}
manageWin(window);
draw3p(window, data, opt_configCallback);
nonSensitiveDataPostMessage('render-start');
};
Expand Down
6 changes: 0 additions & 6 deletions builtins/amp-ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ export function installAd(win) {

/** @override */
renderOutsideViewport() {
// Before the user has scrolled we only render ads in view. This prevents
// excessive jank in situations like swiping through a lot of articles.
if (!this.getViewport().hasScrolled()) {
return false;
};

// If another ad is currently loading we only load ads that are currently
// in viewport.
if (loadingAdsCount > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/service/resources-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function getElementPriority(tagName) {
if (tagName == 'amp-ad') {
return 2;
}
if (tagName == 'amp-pixel') {
if (tagName == 'amp-pixel' || tagName == 'amp-analytics') {
return 1;
}
return 0;
Expand Down