How UTM triggers work
UTM triggers allow you to show specific post-purchase funnels based on UTM parameters in the URL. This is useful for:- Campaign-specific offers – Show different upsells based on the marketing campaign
- Direct-to-checkout links – Trigger funnels when customers skip the storefront
- Channel attribution – Personalize offers based on traffic source (email, social media, ads)
- A/B testing – Test different offers for different campaign variations
Quick start: Basic UTM trigger setup
For standard storefront visits (not direct-to-checkout), you can set up UTM triggers using the Aftersell app embed. To see how to quickly get started with UTM triggers, check out this video:Enable the UTM app embed
To track UTM parameters on storefront pages:- In your Shopify admin, go to Online Store > Themes
- Click Customize on your active theme
- In the theme editor, click the App embeds icon (puzzle piece) in the left sidebar
- Find Aftersell UTM Tracker and toggle it on
- Click Save
Configure UTM triggers in your funnel
After enabling the app embed:- Go to Post-purchase Funnels in the Aftersell admin
- Create or edit a funnel
- In the Triggers section, add a UTM Parameter trigger
- Configure the UTM parameter and value you want to match
- Save your funnel
Supported UTM parameters
Aftersell supports the following standard UTM parameters:utm_source– Identifies the traffic source (e.g., google, newsletter, facebook)utm_medium– Identifies the marketing medium (e.g., email, cpc, social)utm_campaign– Identifies the specific campaign (e.g., spring_sale, product_launch)utm_term– Identifies paid search keywords (e.g., running+shoes)utm_content– Differentiates similar content or links (e.g., banner_ad, text_link)utm_id– Identifies the campaign ID (e.g., campaign_123)
Partial field matching
When configuring UTM triggers, Aftersell supports partial matching for UTM parameter values. This means:- ✅ Trigger value:
spring→ Matches:spring_sale,spring_2026,early_spring - ✅ Trigger value:
email→ Matches:email_newsletter,promotional_email - ✅ Trigger value:
sale→ Matches:spring_sale,flash_sale,sale_2026
utm_campaign contains sale, it will match any campaign with “sale” in the name, such as spring_sale, summer_sale, or flash_sale_2026.
Direct-to-checkout UTM links
The basic setup shown in the video above does not support links that send customers directly to checkout. By default, Aftersell can only detect UTM parameters on storefront pages. This is because it relies on a theme app embed, which works only on storefront pages and not on the checkout or thank-you page.Enable UTM tracking on checkout pages
To track UTM parameters on the checkout page (for direct-to-checkout links), you need to add a Shopify Pixel to your store. ⚠️ Important limitations:- This setup requires the visitor to have a cart token when they arrive at checkout through a UTM link. Without a cart token, the UTM data will not be captured.
- Express checkout methods (Shop Pay, Apple Pay, Google Pay) are not supported because they bypass the cart and do not generate a cart token. Customers using express checkout will not trigger UTM-based funnels.
Setting up the Shopify pixel
Follow these step-by-step instructions to set up direct-to-checkout UTM tracking:- In your Shopify admin, go to Settings > Customer Events.
- Click Add Custom Pixel and give it any name you like.
- Under the Permission dropdown, select Analytics. This is the only permission required.
- For the Data Sale dropdown, you can choose Data collected does not qualify as data sale. Aftersell keeps all collected data private and never shares it with anyone other than you.
- In the code editor that appears, paste in the code provided below.
- Click Save, then Connect.
- Edit
MYSHOPIFY_DOMAIN: You must replace the empty string with your store’s myshopify.com domain (e.g.,'example-store.myshopify.com') - Enable debug mode (optional): Set
enableDebug = trueto see console logs for troubleshooting - Supported parameters: The pixel tracks all six standard UTM parameters listed in the
allowedUrlParamsarray
Testing your UTM trigger setup
After setting up UTM triggers, use this checklist to verify everything is working correctly:For storefront UTM tracking (app embed)
- ✅ App embed enabled: Verify the Aftersell UTM Tracker app embed is toggled on in your theme settings
- ✅ Test URL: Visit your store with a UTM parameter (e.g.,
yourstore.com?utm_campaign=test) - ✅ Complete purchase: Add a product to cart and complete checkout
- ✅ Check funnel: Verify the correct funnel appears on the thank-you page
- ✅ Order browser: Check the Aftersell Order Browser to confirm the UTM trigger was detected
For direct-to-checkout UTM tracking (Shopify pixel)
- ✅ Pixel installed: Verify the custom pixel is saved and connected in Settings > Customer Events
- ✅ Domain configured: Confirm
MYSHOPIFY_DOMAINis set correctly in the pixel code - ✅ Cart token present: Ensure the customer has items in cart before going to checkout (required for tracking)
- ✅ Test URL: Use a direct-to-checkout link with UTM parameters (e.g.,
yourstore.com/checkout?utm_campaign=test) - ✅ Complete purchase: Complete the checkout process
- ✅ Check funnel: Verify the correct funnel appears on the thank-you page
- ✅ Order browser: Check the Aftersell Order Browser to confirm the UTM trigger was detected
- ⚠️ Express checkout: Remember that Shop Pay, Apple Pay, and Google Pay will NOT work with UTM triggers
Troubleshooting tips
If UTM triggers are not working:- Enable debug mode: Set
enableDebug = truein the pixel code and check browser console for error messages - Verify cart token: Ensure customers have items in cart before reaching checkout (pixel requires cart token)
- Check trigger configuration: Verify the UTM parameter and value in your funnel trigger match the URL parameters
- Test partial matching: Remember that triggers use partial matching -
salewill matchspring_sale,flash_sale, etc. - Check funnel priority: If multiple funnels match, only the highest priority funnel will show
- Review Order Browser: Use the Aftersell Order Browser to see which triggers fired for each order
Best practices for UTM triggers
- Use consistent naming: Establish a naming convention for your UTM parameters (e.g.,
utm_campaign=email_spring_2026) - Leverage partial matching: Use broader trigger values to match multiple campaign variations
- Test before launching: Always test your UTM links and triggers before sending to customers
- Document your campaigns: Keep a record of which UTM parameters you’re using for each campaign
- Combine with other triggers: Use UTM triggers alongside product or order value triggers for more precise targeting
- Monitor performance: Regularly check the Order Browser to see which UTM campaigns are driving the most upsells