Repository navigation
feat: Surveys 2.0 - #168
Open
boehlerlukas wants to merge 18 commits into
Open
boehlerlukas wants to merge 18 commits into
boehlerlukas wants to merge 18 commits into
Conversation
…ort, inline page) Card: 348px corner popover with 18px radius and enter animation; on phones a bottom sheet with handle, scrim and safe-area inset. Full: covers the viewport, the messenger draws the background and close button. Page: inline frame in a host container that follows the survey's height. Card and page surveys stay invisible until the messenger reports their height. Safe-area insets are sent to the messenger (survey-safe-area). Reduced motion respected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ner, resume) Legacy format strings keep working. start-survey keeps `format` as the messenger app mode (survey | survey_full | survey_web | survey_page) and adds surveyFormat, fields, personalToken, resume, outboundAction and safeArea. showSurvey before the session is ready opens once it is; an inline survey page is never replaced by a triggered survey. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Handles the messenger's survey-legacy (back to the pre-2.0 card / centred full-screen chrome) and survey-shown / survey-answered / survey-completed / survey-closed, exposed as SDK events (typed in index.d.ts). survey-shown now comes from the messenger only; outbound-sent stays on notify-event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…takes keyboard focus when shown by a trigger Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inset 8px from the edges and above the home indicator, 32/40px corners, layered shadow; legacy card surveys get the same floating panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Relays the messenger's survey-step-viewed message as an SDK event. When the survey (data.forward) or the project (flowConfig surveyAnalyticsForwarding) enables it, survey shown/step viewed/answered/ completed are pushed as gleap_survey_* events to window.dataLayer, gtag and fbq with survey_id, survey_name, step_index and block_key only (no answer values). Off by default; every sink optional and guarded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eta Pixel Wires GleapSurveyAnalyticsForwarder into the messenger message handler and types the survey-step-viewed event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rd (sheet-viewport) so the header and Next stay pinned Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y surveys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-theme) Sharp 10px card / 14px sheet, Pill 32px card / 40-46px sheet; rounded card 24px (matches the editor). Messengers that never send survey-theme keep the rounded outline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er steps aside while a survey is open - survey-theme surface + dark: the phone sheet (handle strip included) and the card's underlay use the survey's surface, the handle its light/dark - the survey page frame takes the survey's color-scheme so it stays transparent on any host backdrop - the launcher hides while a survey is open (a pill or sharp card showed it peeking out behind its corner) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… moves to a new step Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oes nothing unless a card survey sheet is lifted visualViewport scroll/resize fire many times a second while any page with the SDK scrolls; every event touched the frame container's styles even with no survey on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surveys 2.0:
showSurveyoptions, survey containers and embedThis is the web SDK side of Surveys 2.0. It adds:
Gleap.showSurvey;survey-embed.js.Old format strings keep working, and a legacy (not yet migrated) survey switches the frame back to the old look when the Messenger-App reports
survey-legacy.Head at time of writing:
a686d32(18 commits). Program overview, master rollout and risks: https://github.com/GleapSDK/Server/pull/2011. Contract:SURVEYS_V2_SPEC.md§7, §13. Design: https://claude.ai/artifact/AnPuqYBjvmVxxgxHozHfi1Scope
API
Gleap.showSurvey(id, formatOrOptions). Options:{ format: 'card'|'full'|'page', fields, personalToken, container, resume }.'survey'maps to card;'survey_full'and'survey_web'map to full.resume,resumeDataandoutboundActionto the Messenger-App, for resume reminders.index.d.ts:survey-shown,survey-answered,survey-completed,survey-closed,survey-step-viewed.outbound-sentandfeedback-sentkeep firing. For migrated surveys they carry the legacy field names (handled by the Messenger and Server).outbound-<id>-submittedlike legacy surveys (9e3f35a).Containers (
UI.js,GleapFrameManager.js)sheet-viewportto the messenger, so the header and Next stay pinned;container(orbody), grows with the content, scrolls the frame's top into view on step change, and forwards keys typed on the host page.survey-thememessage. An old Messenger sends no message, so the default is rounded.Analytics forwarding (opt-in per survey or project, off by default)
gleap_survey_shown|step_viewed|answered|completed{ survey_id, survey_name, step_index, block_key }go todataLayer,gtag('event')andfbq('trackCustom'). Answer values are never sent.Embed
survey-embed.js(about 3 KB):<div data-gleap-survey="ID" data-api-key="KEY" data-mode="inline|popup|tab">loads the SDK on demand. Embeds are a paid channel: on Free the Server refuses embed answers.Performance (
a686d32)visualViewportscroll/resize handler runs at most once per animation frame, and returns at once unless a card sheet is lifted.showSurveyor triggers, and listeners are registered once.CHANGELOG
build/ship with the release commit; build output is not committed here.Risk and safety
outbound-<id>-submittedfor 2.0 completions; 3 live EU rules depend on it.latestusers get everything automatically.showSurvey(id, { format: 'page', … })fromsdk.gleap.io/latest.npm test514/514 andnpx webpack, re-run on 2026-10-07 ata686d32(the branch is level withmaster, nothing to merge). The build output (build/,published/) stays uncommitted, as for every feature PR here; the local stack serves a copy. The container and UI code gets no new unit tests (workspace rule).survey-legacy;showSurvey(id, 'survey')on a migrated survey;Rollout (this repo)
Release after Server#2011, Messenger-App#238 and Frontend#2221 are live (at least EU). Release to npm and the CDN (
latest), and set the version in the CHANGELOG. Then:documentation/javascript/surveys.mdx).Everything else is in the master checklist at https://github.com/GleapSDK/Server/pull/2011.
Surveys 2.0 PRs
🤖 Generated with Claude Code