GA4 Shopify Pixel
Connect GA4 with your Shopify Checkout Extension to track Zigpoll events
Connect your GA4 account to your Shopify Checkout Extension to collect Zigpoll survey data in your GA4 analytics dashboard.
Step #1: Create a Custom Pixel in Shopify
Go to your Shopify Dashboard → Settings → Customer Events.
Click Add custom pixel.
Paste the following JavaScript code into the code block.
Replace G-XXXX with your GA4 Measurement ID. You can find your GA4 ID in GA4 by going to: Property settings → Data collection and modification → Data Streams → Click applicable stream → copy "Measurement ID".
/* Zigpoll GA Integration Pixel */
var f = document.getElementsByTagName('script')[0];
var j = document.createElement('script');
j.async = true;
j.src='https://www.googletagmanager.com/gtag/js?id=G-XXXX';
f.parentNode.insertBefore(j, f);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXX');
analytics.subscribe("zigpoll-event", (event) => {
const { customData } = event;
gtag("event", customData.action, {
event_category: customData.category,
event_label: customData.label,
order_id: customData.order_id,
zigpoll_response: customData.response,
zigpoll_question: customData.question
});
});Step #2: Set Up Custom Dimensions in GA4
Go to your GA4 Dashboard.
Click Admin → Custom Definitions.
Click Add custom dimension and enter the following:
Zigpoll Response
zigpoll_response
Zigpoll Question
zigpoll_question
Once both dimensions are created, Zigpoll survey response data will begin appearing in your GA4 reports.
Last updated

