
Get the job done with a pro
From training to full-service marketing, our community of partners can help you make things happen.
Set Up the Mailchimp Site Tracking Pixel for Wix
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.
- This is an advanced feature and is recommended for users familiar with JavaScript and APIs. Contact your developer, or hire a Mailchimp Expert if you need help.
- To learn more about Mailchimp Site Tracking Pixel, check out our article here.
- You’ll need a connected Wix account on a Premium plan with a connected domain. To learn how to connect your account, check out Connect or Disconnect Mailchimp for Wix.
- Be sure you or your developer is familiar with Mailchimp Site Tracking Pixel Integration Guidance and the Wix’s Developer APIs.
Add the Mailchimp Site Tracking Pixel Snippet
To add the Mailchimp Site Tracking Pixel snippet to Wix, follow these steps.
- In Mailchimp, go to Integrations, then select Manage.
- Select your connected Wix store.
- Click Settings.
- In the Site tracking section, select Get code. Then, copy the tracking snippet.
- In your Wix dashboard, go to Settings, then select Custom Code.
- Click + Add Custom Code.
- Paste the site tracking snippet.
- Set it to load on All pages in the
</Head>section. - Click the Code Type tab, then select Marketing.
- 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
- Embedded Script: Add your custom listener code via Settings > Custom Code
- Event Registration: Use
window.wixDevelopersAnalytics.register()to subscribe to Wix's internal event bus - SDK Forwarding: When Wix broadcasts an event, your listener captures the metadata and calls the Mailchimp
track()method
Event mapping reference
| Wix Event Name | Pixel SDK Event | Description |
|---|---|---|
| viewContent | PRODUCT_VIEWED | Fires when a visitor views a product page |
| addToCart | PRODUCT_ADDED_TO_CART | Triggered when an item is added to the Wix cart |
| initiateCheckout | CHECKOUT_STARTED | Fires when the user enters the checkout flow |
| purchase | PURCHASED | Fired 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.
Technical Support
Have a question?
Paid users can log in to access email and chat support.