Overview
Embed Adverfly surveys on your website
Embed Adverfly surveys directly on your website to collect customer feedback, post-purchase reviews, or NPS scores.
Quick Start
If you already have the Adverfly pixel installed, simply add this div where you want the survey to appear:
<div data-adv-survey-id="SURVEY_ID" data-adv-workspace-id="WORKSPACE_ID"></div>
Replace SURVEY_ID with your survey ID and WORKSPACE_ID with your workspace ID (both found in the survey settings).
The pixel automatically detects survey embeds and renders them.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data-adv-survey-id | string | Required | Your survey ID |
data-adv-workspace-id | string | Required | Your workspace ID |
data-adv-survey-version | string | Optional | Specific survey version (uses latest by default) |
data-adv-order-id | string | Optional | Order/transaction ID to link survey responses to a specific purchase |
data-adv-lang | string | Optional | Language code like de, fr, en, or default. Omitting it keeps the legacy English UI fallback. |
Customer & Transaction Tracking
Survey events automatically include customer_id and transaction_id when set via the Adverfly Layer. This allows you to link survey responses to specific customers and orders.
<script>
window.adverfly = window.adverfly || [];
function advPxl() { adverfly.push([!1, ...arguments]); }
advPxl("init", WORKSPACE_ID);
window.adverfly.store_currency = "EUR";
window.adverfly.store_timezone = "Europe/Berlin";
/* Set customer and transaction IDs */
window.adverfly.customer_id = "customer_123";
window.adverfly.transaction_id = "order_456";
</script>
Adverfly Layer Properties
| Parameter | Type | Required | Description |
|---|---|---|---|
window.adverfly.customer_id | string | Optional | Customer ID to associate with survey responses |
window.adverfly.transaction_id | string | Optional | Transaction/Order ID to link survey responses to purchases |
window.adverfly.store_currency | string | Optional | Store currency (e.g., EUR, USD) |
window.adverfly.store_timezone | string | Optional | Store timezone (e.g., Europe/Berlin) |
These properties are automatically included in all survey events (survey_opened, survey_answer, survey_completed).
Multi-Language Support
Surveys support multiple languages. Set data-adv-lang to display translated content. Use default to force the survey base content while keeping the UI fallback in English:
<div
data-adv-survey-id="SURVEY_ID"
data-adv-workspace-id="WORKSPACE_ID"
data-adv-lang="de"
></div>
| Code | Description |
|---|---|
default | Base survey content with English UI fallback |
en | English UI, and translations.en if configured |
de | German |
fr | French (if configured) |
If data-adv-lang is omitted entirely, the public embed keeps the legacy behavior: English UI with the survey base content. Translations must be configured in the survey settings within Adverfly.
Survey Features
- Required questions: Questions marked as required show a red asterisk (*) and validate before proceeding
- Multi-step navigation: Surveys display one question at a time with Back/Next buttons
- Progress indicator: Shows current step and progress bar
- Thank you screen: Customizable message after submission
Survey Requirements
For the embed to work, your survey must:
- Be set to live status
- Have the Adverfly v2 pixel installed on the page (surveys are not supported in the v1 pixel)
Survey Events
The pixel automatically tracks these events for analytics:
| Code | Description |
|---|---|
survey_opened | Fired when survey is displayed to user |
survey_answer | Fired for each question answered |
survey_completed | Fired when user submits the survey |
All events include form_id, submission_id, and (if set) customer_id and transaction_id.