Send survey responses to Shopify Flow and Google Analytics 4

Zenith has no native integrations. Besides the CSV export, your responses have two ways out, and both run on tools you control. A Shopify Flow trigger starts a workflow for every response, which Flow can turn into a Google Sheets row, a Slack message or an email. A browser event carries each answer to a custom pixel you paste, which sends it to your own GA4 property. Neither does anything until you set it up.

Shopify Flow: Google Sheets, Slack, email and more

Before you start

  • Shopify Flow, a free app from Shopify on the Basic, Grow, Advanced and Plus plans. It is not available on Shopify Starter.
  • Zenith's survey block on your Thank you or Order status page. The install guide walks through adding the survey block.
  • For Google Sheets: a spreadsheet your Google account can edit, with a tab ready for responses. Flow's Add row to spreadsheet action comes from Shopify's Google Sheets connector, and you connect your own Google account to Flow. Zenith never sees that account.

Build the workflow

  1. Install Shopify Flow

    If Flow is not in your admin yet, install Shopify Flow from the Shopify App Store. It is free.

  2. Create a workflow

    In your Shopify admin, go to Apps > Flow and click Create workflow.

  3. Select the Zenith trigger

    Click Select a trigger, choose Zenith: Post Purchase Survey, then Survey response received.

  4. Add an action

    Click + and choose Action. For a spreadsheet, choose Add row to spreadsheet; if Flow asks you to install its Google Sheets connector or to connect a Google account, do that first. For Slack, choose Send Slack message. For email, choose Send internal email. Anything else in Flow's catalogue works the same way, including Send HTTP request.

  5. Map the fields

    Insert Zenith's fields into the action with Add a variable. All eleven are listed below. For a spreadsheet, fill in Spreadsheet URL, Tab name and Row contents, and read the note on commas first.

  6. Turn it on

    Click New Workflow to give it a name, then click Turn on workflow.

The fields Flow receives

Every response carries all eleven, in the same order as the columns of your CSV export. Typed answers and comments are included as the customer wrote them.

FieldVariableWhat it holds
Question IDquestionIdA stable ID for the question. It stays the same when you reword the question.
QuestionquestionThe question text exactly as the customer saw it.
Question TypequestionTypemultiple_choice, multi-select, scale or free-text.
Scale PresetscalePresetnps, csat or ces on a rating question that uses a preset. Arrives as n/a otherwise.
Scale RangescaleRangeThe rating scale the answer was given on, such as 0-10. Arrives as n/a for other question types.
Statusstatusanswered, or skipped when the customer moved past the question.
AnsweranswerThe answer. A rating as a number, several choices as one comma separated list, typed text up to 500 characters. Arrives as n/a when skipped.
CommentcommentThe comment the customer added, or what they typed after choosing Other, up to 1000 characters. Arrives as n/a when there is none.
Submitted AtsubmittedAtWhen the answer was submitted, as an ISO 8601 time in UTC.
Order IDorderIdThe order's internal Shopify ID, as plain digits. This is not the order name your customers see.
Session IDsessionIdShared by every answer from one survey sitting, so you can group them back together.

Every field is always sent, so a field with nothing in it arrives as n/a rather than as an empty value. Write your conditions against that: to act only on answers that carry a comment, use Comment is not equal to n/a.

Commas and empty cells in Google Sheets

Row contents is split on commas, so a value with a comma in it spreads across extra columns. That includes every answer with several choices, which arrives as a list such as Instagram, A friend. Swap the commas out of any field that can hold one. Shopify also notes that an empty value can shift the cells after it. Zenith never sends an empty field, so that cannot happen to your rows: a field with nothing in it arrives as n/a. The order below still reads best:

{{submittedAt}}, {{orderId}}, {{question | replace: ",", ";"}}, {{answer | replace: ",", ";"}}, {{status}}, {{comment | replace: ",", ";"}}

What to know

  • One run per question. A customer who answers three questions starts the workflow three times. Skipped questions start it too, with Status set to skipped; add a condition on Status if you only want answers.
  • Zenith cannot see your workflows. It sends every response to Flow whether or not a workflow exists, and Flow gives no sign either way, so Zenith cannot tell you when a workflow is missing, turned off or failing. Check the workflow in Flow itself.
  • Order ID is a number, not an order. Zenith does not ask for access to your orders, so a workflow cannot look up the order's customer, items or total from this trigger.

Google Analytics 4: survey answers as events

Zenith can send each survey answer to your GA4 property as an event. You set it up once by pasting a custom pixel into your Shopify admin. Zenith never connects to Google and never asks for access to your Google account: your pixel receives the answer on your Thank you page and sends it with your own GA4 tag.

What gets sent

Each answered question sends one zenith_survey_response event with these parameters:

ParameterExample
zenith_question_idcmtrlorb50002unq4lfgc9tat
zenith_questionHow did you hear about us?
zenith_answerInstagram
zenith_order_id7677568713013

Values longer than 100 characters are shortened to 100. An answer with several choices is sent as one comma separated value, for example Instagram, A friend.

Typed text stays out of Google Analytics

Free-text answers and comments are never sent to GA4, by design. Google Analytics does not allow anything it could use to identify a person, and a text box is where a customer is most likely to type an email address or a phone number. Leaving all typed text out means no survey answer can put your property in breach of that policy. That covers open-ended questions and whatever a customer types after choosing Other, which reaches GA4 as the answer Other. Every typed answer is still in Zenith and in your CSV export. Skipped questions are not sent either.

Before you start

  • A GA4 property with a web data stream, and its Measurement ID, which starts with G-. Find it in Google Analytics under Admin > Data streams.
  • Zenith's survey block on your Thank you page.

Add the pixel

  1. Open Customer events

    In your Shopify admin, go to Settings > Customer events.

  2. Add a custom pixel

    Click Add custom pixel, name it Zenith to GA4, and click Add pixel.

  3. Set the privacy permission

    Under Customer privacy, set Permission to Required and select Analytics. Set Data sale the way you set it for your other Google Analytics tags; that choice is yours to make for your store.

  4. Paste the code

    Replace everything in the code box with the snippet below, and change G-XXXXXXXXXX to your own Measurement ID.

  5. Save and connect

    Click Save, then Connect pixel.

// Zenith survey answers to Google Analytics 4
const MEASUREMENT_ID = "G-XXXXXXXXXX"; // your GA4 Measurement ID

const script = document.createElement("script");
script.src = "https://www.googletagmanager.com/gtag/js?id=" + MEASUREMENT_ID;
script.async = true;
document.head.appendChild(script);

window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag("js", new Date());
// Your existing Google setup records page views. This pixel only sends survey answers.
gtag("config", MEASUREMENT_ID, { send_page_view: false });

analytics.subscribe("zenith:survey_response", (event) => {
  gtag("event", "zenith_survey_response", {
    ...event.customData,
    // Records your Thank you page as the page, instead of the pixel's own sandbox address.
    page_location: event.context.document.location.href,
  });
});

Register the parameters in GA4

GA4 only lets you filter and break down reports by a parameter after you register it as a custom dimension. Do this once for each parameter you want to report on; most stores want zenith_question and zenith_answer.

  1. In Google Analytics, open Admin and, under Data display, click Custom definitions.
  2. On the Custom dimensions tab, click Create custom dimensions.
  3. Enter a Dimension name, set Scope to Event, enter the parameter name, such as zenith_answer, as the Event parameter, and click Save.

Google says a new custom dimension can be added to reports 24 to 48 hours after it is created and data has been sent.

What to expect

  • Thank you page only. Set this up for answers given on the Thank you page. The Order status page runs pixels only when your customer accounts use your own domain, so answers given there may not arrive.
  • This counts answers. It is not attribution. Use it to see how many customers gave each answer alongside the rest of your GA4 data. Do not read a survey event's source or medium as the channel that brought that customer in: the event is sent from your Thank you page, so GA4 may credit it to a different session or to Direct. Zenith's own dashboard is where answers are tied to order revenue.
  • Consent. An answer is only sent when the customer has allowed analytics. Zenith checks this before sending, and the pixel's Customer privacy setting checks it again.
  • Your other tags are unchanged. If you already send events to the same property from another tool, this pixel does not touch them. It only adds zenith_survey_response.

Check it works

  1. Open the Realtime report in Google Analytics.
  2. Place a test order and answer a multiple choice question on the Thank you page, with analytics cookies accepted.
  3. Look for a zenith_survey_response event.

If nothing arrives, check that the pixel shows as connected under Settings > Customer events and that the Measurement ID is correct.

Install Zenith from the Shopify App Store