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

Make sure analytics behave correctly when parent element reload. #9021

Closed
zhouyx opened this issue Apr 27, 2017 · 2 comments
Closed

Make sure analytics behave correctly when parent element reload. #9021

zhouyx opened this issue Apr 27, 2017 · 2 comments

Comments

@zhouyx
Copy link
Contributor

zhouyx commented Apr 27, 2017

Analytics have no idea on other elements' reload.
For example a config like this

"on": "visible",
"selector": "#test-ele",
"visibilitySpec": {
  "totalTimeMin": 10000,
  "waitFor": "ini-load"
}

Assume during first layout, test-ele takes 2s to ini-load, then it's visible for 3sec. Then user switch to another page in viewer carousel. When user comes back to this page, the test-ele will be laid out again, where this time it will take another 2s to ini-load. Analytics however will have no idea that the test-ele is re layout and take the 2sec into account for total visible time.

Inserted analytics elements by A4A however will stop tracking once element has been unlaid out (will create another analytics element next time) due to here

Which kind of behavior is desired? When an element relayout does it make sense to continue tracking visibility/signals? If so how we deal with the signals?

@zhouyx zhouyx added this to the Sprint H1 May milestone Apr 27, 2017
@zhouyx zhouyx self-assigned this Apr 27, 2017
@zhouyx zhouyx changed the title Make sure inserted analytics behave correctly when parent element reload. Make sure analytics behave correctly when parent element reload. May 1, 2017
@zhouyx zhouyx modified the milestones: Sprint H2 May, Sprint H1 May May 12, 2017
@jasti jasti self-assigned this May 16, 2017
@rudygalfi rudygalfi assigned jasti and unassigned jasti May 16, 2017
@jasti
Copy link
Contributor

jasti commented May 16, 2017

As discussed with @zhouyx and @lannka . We decided to reset analytics in cases where the unlayout happens. The two cases we know are:

  1. when user swipes between documents and goes back to the original document - this happens rarely and resetting analytics in this case shouldn't impact metrics by a lot
  2. AMP ad refresh case - since ads ship their own analytics in the A4A case, this case is fine. (and in the non-A4A case - ads have their own way of collecting metrics using JS). The one case that might not be handled is when a publisher is trying to do ad related analytics measurement as a parent but the chances of this happening are very few in combined with the ad un layout scenario.

@zhouyx
Copy link
Contributor Author

zhouyx commented Jun 1, 2017

So:
We will ignore the publisher inserting analytics element case since it happens very rarely.

Analytics in FIE: FIE won't be destroyed during unlayoutCallback and there's no new ad request, thus it makes sense to keep the analytics element inside FIE as well.

Analytics inserted by ad. If not using FIE, we will remove inserted analytics element during unlayoutCallback and re-insert them again if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants