Shopify Integration
Integrate Toggly feature flags with your Shopify store to control storefront visibility and run experiments.
Overview
The Toggly Shopify app allows you to:
- Control storefront features without code deployments
- Run A/B tests on product pages and checkout flows
- Target features to specific customer segments
- Monitor feature usage and business metrics
Installation
- Visit the Shopify App Store
- Click Add app
- Authorize Toggly to access your store
- Complete the setup wizard
Configuration
API Keys
After installation, configure your Toggly API keys:
- Navigate to Toggly Settings in your Shopify admin
- Enter your Toggly App Key and API Key
- Select your environment (Development, Staging, Production)
- Save settings
Feature Flags in Liquid
Use feature flags in your Shopify theme:
{% if toggly.is_feature_enabled('new-product-page') %}
{% render 'product-page-new' %}
{% else %}
{% render 'product-page-legacy' %}
{% endif %}
Multi-Variant Flags
{% assign button_color = toggly.get_feature_variant('checkout-button-color') %}
<button class="btn btn-{{ button_color }}">
Checkout
</button>
Use Cases
Show/Hide Banners
{% if toggly.is_feature_enabled('holiday-banner') %}
<div class="holiday-banner">
Special holiday promotion!
</div>
{% endif %}
A/B Testing Product Pages
{% assign variant = toggly.get_feature_variant('product-page-layout') %}
{% if variant == 'new-layout' %}
{% render 'product-page-new' %}
{% else %}
{% render 'product-page-legacy' %}
{% endif %}
Customer Segmentation
{% if customer.tags contains 'premium' %}
{% if toggly.is_feature_enabled('premium-features') %}
{% render 'premium-features' %}
{% endif %}
{% endif %}
Best Practices
- Test in Development: Test feature flags in a development theme first
- Use Segments: Target features to specific customer groups
- Monitor Metrics: Track feature usage and conversion rates
- Gradual Rollouts: Start with small percentages and increase gradually
Next Steps
- Learn about WordPress Integration
- Explore Cloudflare Workers Integration
- Read the API Reference