Surveys Documentation

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:

Request
<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

ParameterTypeRequiredDescription
data-adv-survey-idstringRequiredYour survey ID
data-adv-workspace-idstringRequiredYour workspace ID
data-adv-survey-versionstringOptionalSpecific survey version (uses latest by default)
data-adv-order-idstringOptionalOrder/transaction ID to link survey responses to a specific purchase
data-adv-langstringOptionalLanguage 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.

Request
<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

ParameterTypeRequiredDescription
window.adverfly.customer_idstringOptionalCustomer ID to associate with survey responses
window.adverfly.transaction_idstringOptionalTransaction/Order ID to link survey responses to purchases
window.adverfly.store_currencystringOptionalStore currency (e.g., EUR, USD)
window.adverfly.store_timezonestringOptionalStore 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:

Request
<div
  data-adv-survey-id="SURVEY_ID"
  data-adv-workspace-id="WORKSPACE_ID"
  data-adv-lang="de"
></div>
CodeDescription
defaultBase survey content with English UI fallback
enEnglish UI, and translations.en if configured
deGerman
frFrench (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:

CodeDescription
survey_openedFired when survey is displayed to user
survey_answerFired for each question answered
survey_completedFired when user submits the survey

All events include form_id, submission_id, and (if set) customer_id and transaction_id.