Javascript, track iframes redirecting top window

前端 未结 4 1459
谎友^
谎友^ 2021-02-12 23:38

Since there is no way to prevent an iframe from redirecting the top frame besides sandboxing which prevents other features required for viewability tracking I would like to trac

4条回答
  •  孤城傲影
    2021-02-13 00:04

    From the individual iframes, can you set a cookie when the redirect happens? Say it happened from iframe1, you may set a cookie like

    document.trackFrame = "FrameName=iframe1";  
    

    And once the redirect completes, can you try reading the cookie and there by determine which iframe caused the re-direct?

提交回复
热议问题