Skip to content

Add onpagehide event automatically in browser #294

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

Conversation

jordangarcia
Copy link
Contributor

Summary

With event batching, optimizely.close() needs to be called to ensure that events are flushed before the user navigates away. This PR ensures that optimizely.close() is called when the page unloads by hooking into the pagehide event or the unload event.

Test plan

  • Added a UMD bundle test, but this should be tested manually as well.

@mjc1283 mjc1283 requested review from mjc1283 and a team June 17, 2019 18:05
@mjc1283
Copy link
Contributor

mjc1283 commented Sep 12, 2019

This was incorporated into #347

@mjc1283 mjc1283 closed this Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants