Overview
This extension dynamically generates a unique Shopify discount code for each user session and ensures it’s reused across multi-step forms by storing it in localStorage. It integrates with a Digioh Pipeline and uses metadata to configure API access and output mapping.
Step 1: Add a Shopify Connection
Before generating any coupons, connect your Shopify store to Digioh:
- Go to your Shopify store: Format: https://your-store-name.myshopify.com
- Log in and copy your Shopify Store Name (the subdomain).
- In Digioh, navigate to the New Integrations page.
- From the dropdown, select Shopify and click Add New Connection.
- Enter your Store Name and Admin Access Token.
👉 Need help with the access token? View Help Doc
Step 2: Create a Digioh Pipeline
- In Digioh, go to Pipelines and click Create New Blank Pipeline.
- Add a New Task and select Shopify.
- Configure the task:
- Select your Shopify connection.
- Enter your Price Rule ID.
- (Optional) Add a Coupon Prefix.
- Set the Coupon Code Length (default: 12).
- Choose Alphanumeric or Numeric format.
- Click Save Task and Publish the Pipeline.
Step 3: Configure Required Metadata
To activate the extension, configure these metadata keys:
Widget or Account Metadata
Key | Description | Required |
shopify_integration_id | Your Digioh pipeline’s integration ID | ✅ |
shopify_discount_key | Data layer field (e.g., custom_20) to store the coupon | ✅ |
Widget-Only Metadata
Key | Description | Required |
shopify_coupon_generate | Set to “true” to enable coupon generation on a Specific Pop-up | ✅ |
💡 All three keys must be configured correctly for the extension to function.
Extension Purpose
This extension dynamically generates a unique Shopify discount code via API and caches it in localStorage. It ensures only one code is generated per session, mapping the code to a data layer field for integration with platforms like Klaviyo, Iterable, or Braze.
Key Features
- Metadata-Driven: Uses configurable metadata keys for setup.
- Session-Based: Generates one coupon per session to prevent abuse.
- Data Layer Mapping: Passes the coupon into a specified custom field.
- Multi-Step Safe: Ensures consistent code across all steps of a form.