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.

circle-info

This guide is specific to the Shopify Checkout Extension. For the general Google Analytics integration, see Google Analytics.

Step #1: Create a Custom Pixel in Shopify

  1. Go to your Shopify Dashboard → Settings → Customer Events.

  2. Click Add custom pixel.

  3. Paste the following JavaScript code into the code block.

circle-exclamation
/* 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
  });
});
circle-info

Shopify only allows web pixels on the Thank You page as of now. We hope they will allow web pixels on the Order Status page in the future and will update this page accordingly.

Step #2: Set Up Custom Dimensions in GA4

  1. Go to your GA4 Dashboard.

  2. Click Admin → Custom Definitions.

  3. Click Add custom dimension and enter the following:

Dimension Name
Event Parameter

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