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

Allow external amp-consent flow to make iframe no-display before closing #32748

Open
ptrickney opened this issue Feb 19, 2021 · 4 comments
Open

Comments

@ptrickney
Copy link

Describe the new feature or change to an existing feature you'd like to see

Currently, when the consent-response is sent to the parent AMP page, the iframe is closed immediately. While it is expected that the UI be immediately removed from the user's view, the CMP on the external iframe may need to also send a record of consent for the user choice to an external server (this is required for GDPR). However, because the iframe is closed immediately the call to the service is canceled before the record can be made.

This request to provide the ability to hide the iframe without closing until the external iframe responds that is ready to be closed.

Describe alternatives you've considered

  1. We have tried using the beforeunload event handler to ensure the call is completed, however, closing the iframe also cancels these and records are not recorded.
  2. We have tried waiting for record call to finish before sending the consent-response to AMP. However, this caused a poor user experience as the UI within the iframe closed, but because the iframe still existed on the AMP the user wasn't able to interact with the page immediately.
  3. We have tried resizing the iframe as well before sending the response, however, amp-iframes can only be sent to a minimum height of 100px which is still too large.

Additional context

Logging records of consent is a requirement under GDPR and other privacy regulations.

@micajuine-ho
Copy link
Contributor

Does #30049 fit what you're trying to do?

@ptrickney
Copy link
Author

Thanks for the response @micajuine-ho.

That enhancement does work when using a CMP via the integrated method (promptUIsrc). However, there are use cases where the CMP needs to be embedded via an amp-frame directly where the iframe SRC is not shared for all clients of that CMP, External User Consent Flow.

In this case the iframe is still being closed immediately, thus canceling the request.

@micajuine-ho micajuine-ho self-assigned this Feb 22, 2021
@micajuine-ho
Copy link
Contributor

@ptrickney I believe this is the same issue:
#30049

It was fixed in #30402, which allows the iframe to run in the background for 1 second after it is closed. This should give you enough time to send the response back to your servers.

Please let me know if it is sufficient.

@stale
Copy link

stale bot commented Nov 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Nov 23, 2022
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