To learn how to upgrade your plan, refer to Upgrading your VWO Plan.
This article covers the following: |
Overview
This article explains how to integrate VWO with Shopify to automatically send campaign and variation data into Shopify's Web Pixel event stream. With this setup, you can easily use the campaign data in your Shopify Custom Pixels and pass it on to third-party analytics and marketing tools.
Key Benefits:
- Centralized Data Flow: Leverage Shopify's native Web Pixel infrastructure to handle VWO campaign data alongside other standard e-commerce events.
- Extended Analytics: Using a Shopify Custom Pixel as a channel, you can send VWO experiment data to platforms indirectly integrated with VWO (like Heap, GTM, etc.).
- Simplified Data Forwarding: Using the Shopify event subscription model, you can avoid complex manual tagging or direct API integrations for sending VWO data to specific tools.
- Unified Reporting: Correlate VWO campaign exposure with downstream actions tracked in other analytics tools connected via Shopify pixels.
Use Cases
- Analyze VWO Impact in Heap: Send VWO campaign/variation data to Heap via a custom pixel to segment Heap reports based on experiment exposure.
- Track VWO Experiments in GA4 via GTM: Push VWO data to the dataLayer using a GTM custom pixel for detailed analysis in Google Analytics 4.
- Correlate VWO Exposure with Other Pixel Data: Combine VWO campaign data with conversion events from other marketing pixels (e.g., Facebook, TikTok) within Shopify's event context or by forwarding both to a unified analytics platform via custom pixels.
- Build Custom Audiences: Use the VWO data pushed via custom pixels to build audiences in advertising platforms based on experiment participation.
Prerequisites
- An active VWO account.
- An active Shopify store.
- The VWO SmartCode must be correctly installed on your Shopify store (e.g., via theme modification or a VWO Shopify App).
- Familiarity with Shopify Custom Pixels and the Shopify analytics.subscribe API.
Enable the Shopify Integration for Your VWO Account
To enable the VWO-Shopify integration on your VWO account:
- Log in to your VWO account.
- From the left panel of your VWO dashboard, go to Configurations > Integrations
-
Select the Shopify integration and enable it. Once done, the Shopify integration screen appears:
-
You will be auto-navigated to the Config tab.
- Select the Enable Sending VWO Campaign Data to Shopify checkbox and click Save to start sending your VWO Test and Personalize campaign data to Shopify.
- After you enable the integration, you can send VWO experiment data to Shopify at the campaign level. The integration is enabled by default for the new VWO testing campaigns.
- If you want to enable the Shopify integration for your existing campaigns, select the campaign, go to Configuration > Integrations, and select Shopify.
Configure Shopify Pixel
When a visitor becomes part of a VWO campaign for which this integration is active, VWO's client-side code triggers an event push to Shopify's Web Pixel API.
Event Format
- Event Name: VWO
-
Event Properties (within event.customData in the subscriber callback):
- campaignName: (string) The name of the VWO campaign.
- campaignId: (number) The unique ID of the VWO campaign.
- variationName: (string) The name of the variation the visitor is assigned to.
- variationId: (number) The unique ID of the variation.
//Structure of event.customData received by analytics.subscribe
{
"campaignName": "Shopify A/B",
"campaignId": 123,
"variationName": "Variation-1",
"variationId": 2
}
How to Access VWO campaign data In Shopify Custom Pixels
The primary logic of this implementation is to add code to your Shopify Custom Pixels that listens for the VWO event and then handles or sends the data it receives.
Subscribing to the VWO Event
Use the standard Shopify analytics.subscribe method in your Custom Pixel code to listen for the event:
Example: Send VWO Data to GTM/GA4 via Custom Pixel
This example shows how to push VWO data into the dataLayer for use by Google Tag Manager, often configured to send data to GA4.
Verify the Integration
Once you complete the above steps, you can navigate to any running campaign where the integration is set up. After joining the campaign, you can check the network calls mentioned below.
Once the produce_batch call is available, you can check the integration data in the respective integration's network call (e.g., GA4).
Recommended Best Practices
- VWO SmartCode Placement: Ensure the VWO SmartCode is correctly installed and loads early on your Shopify pages.
- Custom Pixel Placement: Follow Shopify's guidelines for adding Custom Pixels. Place the analytics.subscribe code within the appropriate pixel context.
- Error Handling: Consider adding basic error handling (e.g., try...catch blocks) within your custom pixel code, especially if integrating with multiple tools.
- Consistent Naming: Use clear and consistent names for VWO campaigns and variations, as these names will be passed in the data.
- Test Thoroughly: Test the end-to-end flow: VWO campaign bucketing -> Shopify analytics.subscribe trigger -> Data appearing correctly in the target third-party tool (GA4, Heap, etc.).
Troubleshooting
Issue | Solution |
VWO data (event.customData) is undefined or empty in the analytics.subscribe callback. |
|
The analytics.subscribe callback is not firing. |
|
Data is received in the custom pixel but does not appear in the target tool (Heap, GTM/GA4). |
|
FAQs
Q: Do I need to install a separate VWO app from the Shopify App Store for this integration?
A: No. This feature works by enabling the integration directly in the VWO platform (under Configurations > Integrations). While VWO may offer a Shopify app for easier SmartCode setup, sending data to Shopify Web Pixels is handled within VWO itself, assuming the SmartCode is already installed on your store.
Q: What data exactly gets sent from VWO to the Shopify Web Pixel?
A: VWO sends the following details about the experiment a visitor is part of:
- Campaign ID
- Campaign Name
- Variation ID
- Variation Name
Q: Is this integration sending data in real-time?
A: Yes. When a visitor lands on your site and qualifies for a VWO campaign variation, VWO SmartCode triggers the push to the Shopify Web Pixel event stream in real-time (client-side).
Q: Can I use this integration to send VWO goal conversion data to Shopify?
A: No, this setup only sends information about which campaign and variation a user sees. You would need a different configuration to track goal conversions, possibly involving custom code or additional VWO integrations.
Q: Will this integration slow down my site?
A: The VWO integration adds minimal overhead (a client-side event push). The performance impact mainly depends on the complexity and efficiency of the code you add within your Shopify Custom Pixels to process and forward this data. Keep your custom pixel code lean and efficient.
Need more help?
For more information or further assistance, contact VWO Support.