Tracking Survey Responses to Google Analytics

The Survey Response Tracking extension sends the questions and answers from your survey campaigns to Google Analytics 4 (GA4) as events. You configure it with metadata on your campaign pages and elements, so no custom code is needed.

What you'll learn

  • How to install the Survey Response Tracking extension
  • How to create the GA4 custom dimensions that receive question and answer data
  • How to mark questions and answers with metadata
  • What events and properties the extension sends
  • What each notification means and how to fix common problems

New to metadata? See How do I add metadata?

Before you start

The Survey Response Tracking extension finds your questions and answers, but a separate tracking extension delivers the events. To send data to GA4, install the Google Analytics 4 Event Tracking Plugin from the same Tracking section of Extensions.

Important: if no tracking extension is installed, Survey Response Tracking stops and shows this message in the notification panel: A tracking app needs to be installed. Cannot find boxapi.trackEvent function.

Install the extension

  1. Click your account name in the top right corner and select Extensions.
  2. Under the Tracking section, find Survey Response Tracking and click Install.
  3. Click Publish to Your Site to activate the extension.

Create the GA4 custom dimensions

Before question and answer data shows up in your GA4 reports, your GA4 property needs two event-scoped custom dimensions. You can create them from the Google Analytics Integration page, linked from your profile menu in Digioh.

Custom dimensionWhat it receives
digioh_quiz_questionThe survey question text
digioh_quiz_answerThe answer text

Note: Digioh Quizzes use the same two dimensions. If you already track quizzes in GA4, these dimensions may already exist.

Set up your questions and answers

Each survey question needs its own campaign page. Add the question and answer metadata to that page:

Metadata keyWhere to add itValue
track_survey_questionThe page, or the text element that shows the questionPage: the question text. Text element: 1
track_survey_answerEach form field or button that is an answer choice1

Step 1: Add the question

Add one question per page, in either of these places:

On a text element (recommended). Add track_survey_question with the value 1 to the Element Metadata of the text element that shows the question. The extension uses the element's visible text as the question, so what appears in GA4 matches what visitors see.

text element question

On the page. Open the page's Layout tab, turn on Page Metadata, and add track_survey_question with the question text as the value, for example What are you shopping for?

page level question

Step 2: Add the answers

Add track_survey_answer with the value 1 to each answer element on the same page:

Form fields (dropdowns, radio buttons, checkboxes and text fields): add it under the field's Field Metadata.

form field answer

Buttons: add it under Button Metadata.

button answer

Each question needs at least 2 answers. Each option in a dropdown and each radio button counts as one answer, so a single dropdown with several options is enough.

Note: older campaigns may use the keys ga_survey_question and ga_survey_answer. The extension still accepts them, so you don't need to change existing campaigns.

How tracking works

When an answer is tracked depends on the type of answer element:

  • Form fields. Events are sent when the form is submitted. The extension sends one digioh_survey_response event for each answer field on the page.
  • Checkboxes. Events are sent on form submission, but only for checked boxes. The answer is the checkbox's label text. Unchecked boxes are skipped.
  • Buttons. Events are sent as soon as the button is clicked, without waiting for a form submission. Each click sends two events, digioh_survey_response and digioh_quiz_answer, with the same properties. The second event keeps button answers consistent with Digioh's quiz tracking. The answer is the button's visible text.

Events and properties

EventWhen it's sent
digioh_survey_responseEvery tracked answer: form fields, checked checkboxes and button clicks
digioh_quiz_answerButton answers only, in addition to digioh_survey_response

Both events include these properties:

PropertyDescription
digioh_box_nameThe campaign name, as shown in your campaign list
digioh_box_idThe campaign ID, for example 12345
digioh_quiz_questionThe question text, from page metadata or the question text element
digioh_quiz_answerThe answer text, from the submitted field value, checkbox label or button text

Test your setup

  1. Preview. Open the campaign in Digioh Preview. The notification panel shows a simulated message for each question and answer the extension would track, without sending real data. It also shows any setup errors (see Troubleshooting).
  2. QA mode. Open your live site with ?boxqamode added to the end of the URL. Answer the survey, and the events are sent to GA4 for real.
  3. GA4. Check that digioh_survey_response (and digioh_quiz_answer for buttons) arrive with the right question and answer values in GA4 DebugView.

Troubleshooting

The extension checks your setup when the campaign loads. If it finds a problem, it shows an error in the notification panel and stops tracking for that campaign until you fix it.

Message or symptomWhat it means and how to fix it
Invalid use of … track_survey_answer on [level]: must be a form input field or button elementThe answer metadata is on the page or another unsupported spot. Move it to a form field or button.
Invalid config for … track_survey_question: must be at page or text element levelThe question metadata is on something other than the page or a text element. Move it.
Only one … track_survey_question allowed per pageThe page has more than one question. Remove the extra one, or move it to its own page.
Page [page] has … track_survey_answer but is missing … track_survey_questionThe page has answers but no question. Add question metadata to that page.
Require at least 2 answers for question [question] on page [page]The question has fewer than 2 answers. Add more answer metadata, or check the dropdown or radio options.
A tracking app needs to be installed. Cannot find boxapi.trackEvent function.No tracking extension is installed. Install the Google Analytics 4 Event Tracking Plugin and publish.
Button answers send two eventsThis is expected. Each button click sends both digioh_survey_response and digioh_quiz_answer.
A checkbox answer sends no eventOnly checked boxes are tracked. This is expected.
Events arrive in GA4, but the question and answer are blank in reportsThe custom dimensions are missing. Create digioh_quiz_question and digioh_quiz_answer as event-scoped custom dimensions.

Best practices

  • Put the question on a text element where you can, so the tracked question always matches what visitors see.
  • Keep one question per page. A second question on a page stops tracking for the whole campaign.
  • Use clear answer text. For buttons and checkboxes, the visible text becomes the answer in GA4, so labels like "Option A" make reports hard to read.
  • Test in Preview first, then QA mode. Preview catches setup errors without sending anything to GA4.

Questions? Reach out to support@digioh.com.

Want to get more from Digioh?

Get the playbooks leading brands use to convert more visitors into revenue.

Browse the Playbooks

Platform Tour

See what else you can do with Digioh in our self-guided platform tour.

Take the Tour

Still Need Help?

Connect with our team for technical help.

Message Support