How to Track Custom Option Performance in Shopify GA4
To track custom product option performance in Shopify with Google Analytics 4 (GA4), you need to implement enhanced eCommerce tracking combined with custom events or parameters that capture the specific options selected by customers. Here’s how to set it up:
1. Install GA4 Properly on Shopify
If you haven’t already:
- Use Google Tag Manager (GTM) to install GA4.
- Optionally use Stape.io or another server-side tagging platform for more accurate data collection, especially post-iOS 14.
2. Capture Custom Option Data Using Data Layer
You’ll need to push the selected product options into the dataLayer
when a user adds a product to cart or completes a purchase.
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "add_to_cart",
ecommerce: {
items: [{
item_name: "Custom Mug",
item_id: "custom-mug-123",
price: 19.99,
quantity: 1,
item_category: "Mugs",
item_variant: "Red",
custom_option_text: "Happy Birthday John",
custom_option_font: "Script",
custom_option_addon: "Gift Box"
}]
}
});
You can extract these values using Shopify’s line_item.properties
in the cart or checkout pages.
3. Map Data Layer to GA4 via GTM
- Create GTM Variables for each custom parameter (e.g.,
custom_option_font
). - Edit your GA4 event tags (like
add_to_cart
orpurchase
) and pass the variables as parameters.
Example GA4 Event Tag in GTM:
event: "add_to_cart",
parameters: {
item_name: {{Item Name}},
item_id: {{Item ID}},
custom_option_font: {{DL - Font}},
custom_option_text: {{DL - Text}},
custom_option_addon: {{DL - Addon}}
}
4. Register Custom Dimensions in GA4
To view these parameters in GA4 reports:
- Go to Admin → Custom Definitions → Create Custom Dimension
- Scope: Event
- Parameter name: Must exactly match the one in your GTM (e.g.,
custom_option_font
)
5. View & Analyze in GA4
Use Explore → Free Form in GA4 to build reports that show:
- Top-selling custom options
- Conversion rates per option
- Revenue generated from specific customizations
Bonus: Shopify Line Item Properties
If you’re using an app like SM Product Options, the customization data is stored in line_item.properties
.
You can inject those properties into the dataLayer
on the cart or thank-you page using Shopify Liquid and pass them into GTM.
Recommended Tools
- Shopify + GTM
- GA4 property setup
- Custom Options app (e.g., SM Product Options)
- GTM Debug Mode + GA4 DebugView
- Optional: Stape.io for server-side tagging
Need Help?
If you want help creating the GTM container, Liquid code, or debugging your setup, feel free to reach out. We can provide:
- GTM dataLayer snippets
- GA4 custom reports
- App-specific tracking examples
💡 Tip: You can also use this method to pass data to Facebook CAPI, TikTok, or Pinterest pixels for enhanced retargeting based on product options.