QuickBooks HelpQuickBooksHelpIntuit

Set Up the Mailchimp Site Tracking Pixel for Wix

by Intuit• Updated 4 days ago

Add the Mailchimp Site Tracking Pixel to Wix to understand your customers' behavior, which powers useful segmentation and marketing automation flows. Site tracking captures events like page views, product views, add-to-cart actions, and purchases. This data informs your marketing to send the right message at the right time.

In this article, you’ll learn how to add the Mailchimp Site Tracking Pixel to Wix and configure event tracking.

Before you start

Here are some things to know before you begin this process.

Add the Mailchimp Site Tracking Pixel Snippet

To add the Mailchimp Site Tracking Pixel snippet to Wix, follow these steps.

  1. In Mailchimp, go to Integrations, then select Manage.
  2. Select your connected Wix store.
  3. Click Settings.
  4. In the Site tracking section, select Get code. Then, copy the tracking snippet.
  5. In your Wix dashboard, go to Settings, then select Custom Code.
  6. Click + Add Custom Code.
  7. Paste the site tracking snippet.
  8. Set it to load on All pages in the </Head> section.
  9. Click the Code Type tab, then select Marketing.
  10. Click Apply.

Great! Next, you’ll configure the event tracking in Wix.

Configure event tracking

Wix requires manual event tagging using the Wix Developer Analytics API. Your implementation will act as a "translator" that listens for Wix events and triggers the corresponding Mailchimp Site Tracking Pixel SDK methods.

The Mechanism

  1. Embedded Script: Add your custom listener code via Settings > Custom Code
  2. Event Registration: Use window.wixDevelopersAnalytics.register() to subscribe to Wix's internal event bus
  3. SDK Forwarding: When Wix broadcasts an event, your listener captures the metadata and calls the Mailchimp track() method

Event mapping reference

Wix Event NamePixel SDK EventDescription
viewContentPRODUCT_VIEWEDFires when a visitor views a product page
addToCartPRODUCT_ADDED_TO_CARTTriggered when an item is added to the Wix cart
initiateCheckoutCHECKOUT_STARTEDFires when the user enters the checkout flow
purchasePURCHASEDFired upon successful completion of an order

Implementation pattern

// Wait for Wix Analytics to be ready
window.addEventListener('wixDevelopersAnalyticsReady', function() {
  // Register your event handler
  window.wixDevelopersAnalytics.register('custom-mc-tracking', function report(eventName, data) {
    // Map Wix events to Mailchimp Pixel events
    if (eventName === 'addToCart') {
      window.$mcSite.pixel.api.track('PRODUCT_ADDED_TO_CART', {
        cartId: data.cartId,
        product: {
          item: {
            id: data.id,
            productId: data.id,
            title: data.name,
            price: data.price,
            currency: data.currency
          },
          quantity: data.quantity,
          price: data.price * data.quantity,
          currency: data.currency
        }
      });
    }

    if (eventName === 'purchase') {
      window.$mcSite.pixel.api.track('PURCHASED', {
        order: {
          id: data.orderId,
          lineItems: data.contents,
          totalPrice: data.value,
          currency: data.currency
        }
      });
    }

    // Add additional mappings as needed
  });
});

Implementation considerations

  • Data Structure

    Wix's data object format is predefined. You may need to map specific Wix keys to match the expected Mailchimp metadata structure.

  • Consent

    Ensure your script respects Wix's built-in Consent Policy API to stay compliant with privacy regulations.

  • Reference

    See the Wix Developer Docs and our Mailchimp Site Tracking Pixel Integration Guidance for full implementation details.

Custom code support

Our Mailchimp Support team isn't trained for in-depth custom code troubleshooting. If you need a developer to help you set up the Mailchimp Site Tracking Pixel, check out our great Experts Directory. This lists third-party Mailchimp experts who can be hired to help out.

Mailchimp