- Help Center
- Shopify
-
Getting Started
-
Configuration
- Targeting
- Split URL
- Product Testing
- Full Stack
- Experiment Management
- CSP Configuration
- Experiment Execution
- Reports
- Exit Popups
- GTM Integration
- Troubleshooting
- Performance Optimization
- Event-Triggered Changes
- Holdout Groups
- Split URL Pages
- URL Parameters
- DataLayer
- Menu Configurations
- Traffic Exclusion
- Experiment Scheduling
- Dynamic Element Changes
- Price Targeting
- Experience Scheduling
- Privacy
- Hash Changes
- Async Tracking
- Selective Installation
- CSS Selectors
- Vue.js Integration
- Page Content
- Multipage Split URL
- Organic Traffic
- Visual Editor
- Server-Side Testing
- Traffic Bucketing
- GDPR Warnings
- Statistical Confidence
- Browser Privacy
- Query Parameters
- Embedded Videos
- Tracking Code Execution
- Simultaneous Experiments
- Tags
- Deployments
- Disable Testing
- Locations
- Programmatic Bucketting
- Query Parameter Handling
- Convert Library
- Variation Previews
- Experiment Editing
- Opt-Out Script
- Data Reset
- Body Hiding
- Visit-Specific Variations
- Variation Styling
- Preview Issues
- Variation Editing
- Full-Site Testing
- Blinking Variations
- Cross-Domain Cookies
- Regex Support
- Conversion Tracking
- SPA Testing
- Project Setup
- Cross-Domain Tracking
- Geo-Targeting
- Analytics Tools
- Campaign Tags
- Previewing
- IDs
- Query String Targeting
- Bounce Rate Goals
- Bot Filtering
- Query String Variables
- Custom Audiences
- Redirects
- Baseline
- Tracking Code Location
- Secure Cookies
- AngularJS
- Cloudflare
- Code Installation
-
Track Goals
- Form Tracking
- Cookie Management
- iFrame Click Tracking
- Performance Optimization
- Revenue Tracking
- Interaction Goals
- Form Submissions
- Advanced Goals
- Lazy Loading
- Multi-Conversions
- URL Parameters
- Bounce Rate Goals
- DataLayer Integration
- Scroll Depth
- Social Interactions
- Page Views
- Marketo Forms
- Feature Analysis
- AJAX Forms
- Revenue Tracking via GTM
- Order Outliers
- Cumulative Revenue
- Goal Templates
- Adding Revenue Goals
- JS-Based Goals
- Goal Basics
- Google Analytics Goals
- Social Sharing
- Dynamic Goals
- Typeform Integration
-
Target Visitors
- Geolocation
- Interaction Goals
- Goal-Based Targeting
- Weather Targeting
- Cookie-Based Targeting
- Page Visits
- Audience Management
- Audience Segmentation
- Experiment Targeting
- Advanced Audience Creation
- Audience Templates
- Audience Creation
- Data Layer Integration
- Manual Activation
- JavaScript Conditions
- Device Targeting
- Language Targeting
- IP-Based Exclusion
- Visitor Management
- Page Tagging
- Cookies
-
Troubleshooting
- Google Warnings
- Visual Editor
- HTTPS Content
- Logs
- Support Options
- Bootstrap
- Cookie Blocking
- Change History
- Mobile Debugging
- AdWords
- Bot Exclusion
- Domain Issues
- Cloudflare Issues
- Monitoring
- Cloaking Penalties
- Goal Editor Issues
- Variations
- Snippet Performance
- Changes Not Saved
- Blocked Visual Editor
- Goal Testing
- Visual Editor Browsing
- Experiment Issues
- Installation Verification
- Data Leak Prevention
- Usage Limits
- Experiment Previews
- GA4 Revenue
- Chrome Debugger Logs
- SPA Errors
- Checkout JSON Error
-
Analyze Results
-
Integrations
- Google Analytics
- Cookie Consent Platforms
- Microsoft Clarity
- Plausible
- Marketo
- HubSpot
- Tealium
- Smartlook
- Klaviyo
- Salesforce CRM
- FullStory
- Snowplow Analytics
- Webflow
- GA4 Roles
- Amplitude
- Segment
- React
- BigCommerce
- WooCommerce
- Active Campaign
- Google Tag Manager
- Mixpanel
- Zapier
- Inspectlet
- Crazy Egg
- LanderApp
- Unbounce
- Instapage
- Drupal
- PrestaShop
- Magento
- Roistat
- Piano Analytics
- Heap Analytics
- Kissmetrics
- Mouseflow
- Adobe Analytics
- Clicky
-
Account Management
-
Developers
-
What's New
-
Common Questions
-
Shopify
How to filter Shopify transactions being tracked?
In this article, we will explain the Shopify Purchase Filtering functionality, its configuration, and common use cases: filtering by SKU, filtering by subscription status, and filtering by product type.
Shopify Purchase Filtering: A Comprehensive Guide
Shopify Purchase Filtering enables the advanced filtering of events based on specified properties and values. This functionality ensures precise targeting and processing of events, such as purchases or conversions, based on predefined conditions.
Configuring Shopify Purchase Filtering
You need to implement the Convert Shopify Manual Integration and then edit the Customer Event Pixel code to configure the filtering.
The Shopify Purchase Filtering functionality is highly configurable, enabling you to specify the properties and values to be checked in incoming events. The configuration is defined in the filterCriteria
object as follows:
const filterCriteria = {
enabled: true, // Enable or disable criteria checking
checkExistence: ['property1', 'property2'], // List of properties that must exist
matchValue: {
'property1': 'value1', // Exact string values to match
'property2': 'value2'
},
checkValue: true // Enable or disable value matching
};
Configuration Options
- enabled: A Boolean flag to enable or disable Shopify Purchase Filtering.
- checkExistence: An array of property names that must exist in the event for it to pass the criteria check.
- matchValue: An object defining specific property-value pairs for exact matching. Only tested if
checkValue
is set to true. - checkValue: A Boolean flag to enable or disable value matching.
Helper Functions
To aid in Shopify Purchase Filtering, the following helper functions are used:
- isValidJSON(): Checks whether a given data string is valid JSON.
- debugLog(): Logs debug messages when the DEBUG flag is true.
- findProperty(): Recursively searches for a property name within an object.
- checkCriteria(): Checks whether an event meets the criteria specified in the
filterCriteria
configuration.
Use Cases
Filtering by SKU
Filtering by SKU ensures that only events for specific products are processed. This is useful for targeting specific product campaigns or experiments.
const filterCriteria = {
enabled: true,
checkExistence: ['sku'], // Only need to mention the property name
matchValue: {
'sku': '23026961-pink-united-states-l-diameter-7-5cm'
},
checkValue: true // Enable exact value matching for specific SKU
};
Filtering by Subscription
Filtering by subscription ensures that subscription-based transactions are processed differently from non-subscription transactions.
const filterCriteria = {
enabled: true,
checkExistence: ['selling_plan_allocation'], // Only need to mention the property name
checkValue: false // Disable value matching, only check existence
};
You can find an example of Subscription tracking here.
Filtering by Product Type
Filtering by product type allows you to process events based on the type of product involved. This is useful for product-type-specific promotions or analytics.
const filterCriteria = {
enabled: true,
checkExistence: ['product_type'], // Only need to mention the property name
matchValue: {
'product_type': 'Apparel'
},
checkValue: true // Enable exact value matching for specific product type
};