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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰Don't fire STAMP ads analytics if no ads #17756

Merged
merged 2 commits into from Aug 29, 2018
Merged

馃悰Don't fire STAMP ads analytics if no ads #17756

merged 2 commits into from Aug 29, 2018

Conversation

calebcordry
Copy link
Member

Some analytics that were triggered by listening to page changes would break if no ad pages existed. This appears to be caused by INI_LOAD on the story firing very late or not at all (will file separate issue to investigate)

Closes #17593

@calebcordry
Copy link
Member Author

cc/ @gmajoulet who may be working on the same issue.

@@ -546,6 +546,13 @@ export class AmpStoryAutoAds extends AMP.BaseElement {
this.uniquePageIds_[pageId] = true;
}

if (this.adPagesCreated_ === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should move this check together with the uniquePagesCount_ logic to the top of this method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if (this.adPagesCreated_ === 0) {
// This is protection against us running our placement algorithm in a
// story where no ads have been created. Most likely because INI_LOAD on
// the story was fired very late, or not at all.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely because INI_LOAD on the story hasn't been fired yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@calebcordry
Copy link
Member Author

I wasn't 100% sure where you wanted to register handleStateChange_. Let me know if this isn't what you meant.

@lannka lannka merged commit 3c7bb7b into ampproject:master Aug 29, 2018
@calebcordry calebcordry deleted the story-early-exit branch August 29, 2018 15:02
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants