I embedded PollUnit, but the page isn’t appearing. What can I do?
PollUnit is automatically initialized as soon as your website triggers the DOMContentLoaded
event. If PollUnit or the embed code is loaded after this point for any reason, you can manually start the initialization with pollUnitInit()
.
Possible reasons why the event does not fire as expected:
- Script is added later: e.g. via cookie consent manager or tag manager. At this point, DOMContentLoaded has already passed.
- Single Page Application (SPA): Frameworks like React, Angular or Vue load content dynamically without firing a new DOMContentLoaded event.
- Inline script blocking: Some content security policies or ad/script blockers prevent events from being registered correctly or scripts from being executed.
- JavaScript error: An error in a script before PollUnit can stop the execution of subsequent event listeners.
- Script is deliberately »lazy loaded«: Some optimization tools postpone script loading to improve page speed.
- Consent tools (GDPR): The script only loads once the user has accepted cookies.