Shopify Web Pixel events
Send survey activity from Shopify checkout and customer account pages to a Shopify custom pixel. A pixel is code that listens for events, such as a question being shown or an answer being saved.
Choose what your block shares
Open the block in Shopify’s checkout and accounts editor. Under Shopify pixel event detail, choose Question IDs to measure progress, Include saved answers to give connected pixels access to answer values, or Off to disable events for this block. Save the configuration. The default is Question IDs.
Shopoll checks Shopify’s analytics permission before sending each event. An editor preview produces no analytics. Granting permission during a survey starts measurement with the visible question. It does not send earlier answers again as new events.
Subscribe to events
In Shopify Settings → Customer events, add a custom pixel. In Shopoll, Installation → Shopify Web Pixels has a sample you can copy. For example, this subscription prints the survey and question identifiers when a save succeeds.
analytics.subscribe('shopoll:answer_submitted', ({ customData }) => {
console.log(customData.pollId, customData.surface, customData.key);
});
| Subscribe to | When it happens |
|---|---|
shopoll:poll_rendered |
The block renders a selected survey. |
shopoll:poll_opened |
A question becomes visible after opening or reopening the survey. |
shopoll:slide_viewed |
The visible question changes. |
shopoll:answer_submitted |
A changed answer on the current branch has been saved. An edit can produce another submission. |
shopoll:poll_completed |
A response reaches completion. Reopening or editing that completed response does not count a second completion. |
shopoll:poll_closed |
A buyer dismisses an open survey. |
shopoll:poll_hidden |
The block hides following dismissal or completion when its hide setting is enabled. |
Use the two Hide block settings in the block editor to choose what buyers see. Hiding after completion also hides the completion message, rewards and edit controls on that visit. Required checkout questions do not offer dismissal.
Read an event
Each named event includes the survey ID (pollId), its title and handle, the page type, shop domain and time. The page type, called surface, is one of shopify_checkout, shopify_thank_you, shopify_order_status, shopify_customer_profile or shopify_customer_orders. Question events include slideId and the question handle or ID in key. The completion event includes an answers list for the questions the person answered on their route through the survey. A skipped question has no saved answer to count.
With Include saved answers, answer rows can include value and arrayValue. Ratings are numeric. Multi-select and ranked responses preserve their individual values. Uploaded files use their displayed names. Identified surveys can also include the order or customer ID when Shopify supplies it.
For one subscription covering all seven events, listen to shopoll-event. Its customData.action contains the event name without the prefix, alongside pollId, surface and the applicable slideId. Count either this channel or the named events to avoid duplicates.
Test a subscription
Save the custom pixel and use Shopify Pixel Helper to test on a development store. Allow analytics, open the survey outside the editor and save a response. Match the completion’s survey ID with the survey in Shopoll. For forwarding these events to Google, follow the GA4 Shopify pixel guide.