Testing Rules
How to verify your personalization rules work correctly on your published site.
After creating rules and publishing your site, you'll want to confirm visitors see the right variants. This guide walks you through testing each condition type.
Before you test
Make sure:
- Your rule is saved and set to Active in the plugin
- Your Framer site is published after saving
- You're testing on the published URL (not the Framer preview)
The runtime script is cached for 5 minutes. If you just saved a rule change, either republish your site or wait 5 minutes before testing.
Testing UTM conditions
UTM conditions are the easiest to test — just add query parameters to your published URL.
Example: If your variant has the condition utm_source = google, test with:
| URL | Expected |
|---|---|
yoursite.framer.app | Default variant |
yoursite.framer.app?utm_source=google | Your variant |
yoursite.framer.app?utm_source=facebook | Default variant |
This works the same for all UTM types — utm_medium, utm_campaign, utm_term, and utm_content. Just swap the parameter name.
Combining UTM parameters: You can add multiple parameters in one URL:
yoursite.framer.app?utm_source=google&utm_medium=cpc&utm_campaign=spring-launchTesting device conditions
To test device targeting, use Chrome DevTools:
- Open your published site in Chrome
- Press
Cmd + Shift + M(Mac) orCtrl + Shift + M(Windows) to toggle device emulation - Select a device from the toolbar (e.g., iPhone 14 for mobile, iPad for tablet)
- Reload the page
| Emulation | Detected as |
|---|---|
| No emulation (laptop/desktop browser) | desktop |
| iPhone, Android phone | mobile |
| iPad, Android tablet | tablet |
Make sure to reload the page after switching devices. The runtime detects the device on page load, not dynamically.
Testing visitor type conditions
Morph uses a cookie (morph_ret) to distinguish new and returning visitors. On the first visit, the cookie is set. On subsequent visits, the visitor is classified as "returning".
| Step | Action | Result |
|---|---|---|
| 1 | Open your site in an incognito window | New visitor (no cookie) → default variant |
| 2 | Reload the same page | Returning visitor (cookie set on step 1) → your variant |
| 3 | Open a new incognito window | New visitor again (fresh session) |
To reset manually: Open DevTools → Application → Cookies → delete the morph_ret cookie.
Testing multiple conditions (AND logic)
When a variant has more than one condition, all of them must match for the variant to show. This is AND logic.
Example: A variant with utm_source = google AND utm_medium = cpc:
| URL | Result | Why |
|---|---|---|
yoursite.framer.app?utm_source=google | Default | Only 1 of 2 conditions met |
yoursite.framer.app?utm_medium=cpc | Default | Only 1 of 2 conditions met |
yoursite.framer.app?utm_source=google&utm_medium=cpc | Your variant | Both conditions met |
Testing multiple variants
When a rule has multiple variants, the first match wins. Variants are evaluated top to bottom.
Example: A rule with three variants:
- Variant 2:
utm_source = google→ "From Google" - Variant 3:
utm_source = twitter→ "From Twitter" - Default → original content
| URL | Shows |
|---|---|
?utm_source=google | Variant 2 |
?utm_source=twitter | Variant 3 |
?utm_source=linkedin | Default |
| No parameters | Default |
Quick troubleshooting
If your variant isn't showing:
- Check the rule status — it must be Active, not Draft or Paused
- Check the cache — wait 5 minutes after saving, or republish and hard-refresh (
Cmd + Shift + R) - Check the URL — UTM parameters are case-insensitive (
Googlematchesgoogle), but make sure the parameter name is exact (utm_source, notutmsource) - Check variant visibility — all variant layers must be visible in Framer's layer panel. Hidden layers are excluded from published HTML. Use the Preview button in the Morph plugin to preview variants safely
- Check the snippet — go to Account tab in the plugin and verify the snippet status is green
For more details, see Rules Not Working.
Tips
- Use incognito windows for clean testing — no cached scripts, no cookies from previous visits
- Keep DevTools Network tab open — check that
/api/runtime/your-site-keyreturns a200response with JavaScript content - Empty condition values always return false (no match). Make sure every condition has a value filled in
- Delete or pause test rules when you're done so they don't affect real visitors