JavaScript-API
Nach dem Laden von feedback.js steht window.usertraxSurveys bereit (wenn Umfragen für den Auth-Key verfügbar sind).
Methoden
Section titled “Methoden”// Popup programmatisch öffnen (ohne Trigger)usertraxSurveys.open(42);
// Popup schließenusertraxSurveys.close();
// Inline in einen Container mountenusertraxSurveys.mount('#survey-slot', 42);usertraxSurveys.mount(document.getElementById('survey-slot'), 42);
// Inline entfernenusertraxSurveys.unmount('#survey-slot');Data-Attribute
Section titled “Data-Attribute”<div data-usertrax-survey="42"></div>Beim Boot und bei SPA-Navigation mountet das Script automatisch alle Elemente mit data-usertrax-survey.
Display-Modi
Section titled “Display-Modi”- popup — Trigger-Engine (URL → Sampling → Delay → Exit-Intent). Pro Pageview höchstens eine Auto-Popup-Umfrage.
- inline — nur Mount/API/
data-usertrax-survey, kein Auto-Trigger.
Cooldown
Section titled “Cooldown”Nach Complete oder Dismiss speichert das Script einen Cooldown in localStorage (usertrax_survey_cooldown:{id}), Dauer konfigurierbar pro Umfrage (cooldown_days).