Zenith sends 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 contacts Google and never asks for access to your Google account. Your pixel receives an answer on your Thank you page only when the customer has allowed analytics, and sends it with your own GA4 tag.
Each answered question sends one zenith_survey_response event with these parameters:
| Parameter | Example |
|---|---|
zenith_question_id | cmtrlorb50002unq4lfgc9tat |
zenith_question | How did you hear about us? |
zenith_answer | |
zenith_order_id | 7677568713013 |
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.
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.
G-. Find it in Google Analytics under Admin > Data streams.In your Shopify admin, go to Settings > Customer events.
Click Add custom pixel, name it Zenith to GA4, and click Add pixel.
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.
Replace everything in the code box with the snippet below, and change G-XXXXXXXXXX to your own Measurement ID.
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,
});
});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.
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.
zenith_survey_response.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.