Skip to content
Limited timeStarter is now $9 a month instead of $20.See plans
charmotion

How to Use an Animated Mascot in Cart Abandonment & Upsell Modals

By the Charmotion team · Updated · How we write guides

Cover illustration for the guide: How to Use an Animated Mascot in Cart Abandonment & Upsell Modals, with Charmotion demo characters

To add an animated mascot to a cart abandonment or upsell popup, give it one job per moment and drive its mood from your cart events. Use attention when the popup opens, happy when an upsell is added, sad on a failed payment and idle otherwise. Keep the file small so the popup's button stays the focus.

Key takeaways

  • Give the mascot one job per popup moment, not one animation for the whole session.
  • Map opens, upsells, checks, failures and closes to mood numbers 9, 1, 5, 4 and 0.
  • Characters have no one-shot triggers, so your code resets the mood after each timed reaction.
  • Use a .riv file when the mascot must react live, and keep transparent video as a fallback.
  • Load the mascot only when the popup opens, and keep it clear of the price and the buy button.

Already have a character or logo? See examples in real app screens: splash, onboarding, loading and empty-state screens, with the animation that plays in each.

Which mascot mood fits each popup moment?

The moods below use one fixed number per state, so your code and your design notes can share one table. Use these as a starting point and check the animation lengths against your timers.

Popup momentMoodNumberHold
Popup opensattention91.4 s, then idle
Upsell or bundle addedhappy11.6 s, then idle
Shipping or discount being checkedloading5until the result returns
Coupon or payment failssad43.0 s, then idle
Popup closed or restingidle0none

Two rules keep this simple. Characters have no one-shot triggers, so there is no built-in success or error event: show a success with happy and an error with sad. And because a mood keeps playing until something changes it, your code sets the mood back to idle after each reaction.

Should the popup use a Rive file or a video?

It depends on whether the mascot has to respond to the cart. A .riv file bundles the artboards, animations, state machines and data binding settings in one file, and a website or app loads it directly. The mood is a number the page can change at any time, so the mascot reacts as soon as the value changes.

A video is the fallback for sites that cannot run a runtime, such as some no-code builders. It can only play clips that already exist, so a video popup needs one clip per reaction. Transparent WebM and transparent MOV versions cover browsers that cannot run the runtime. Apple documents HEVC video with an alpha channel for Safari, which is why a MOV is the usual Safari companion to a WebM.

Rive's free plan exports play a Rive splash screen, and a paid plan is needed to ship a .riv without it. Plan details are in Is Rive Free? Pricing and Commercial Use in 2026.

How do you connect cart events to the mascot?

Rive Data Binding lets app code read and write live values on a ViewModelInstance at runtime. On the Web runtime, the viewModelInstance getter returns the bound instance and viewModel(path) returns one by path. Number is one of Rive's view model property types. The character file from the final section includes a CharacterViewModelMachine with a number property called mood, and a CharacterStateMachine with a number input of the same name. Either can carry the value. Use one, not both.

The pattern below keeps all cart logic in one place. The getMoodInput placeholder returns the mood number from your Rive instance. The web code that ships with the character is the place to copy the exact call.

const MOOD = { idle: 0, happy: 1, wave: 2, thinking: 3, sad: 4, loading: 5, listening: 6, talking: 7, sleeping: 8, attention: 9 };
const moodInput = getMoodInput(); // returns the mood number from your Rive instance
let resetTimer = null;

function setMood(mood, holdMs) {
  clearTimeout(resetTimer);
  moodInput.value = mood;
  if (holdMs) {
    resetTimer = setTimeout(function () {
      moodInput.value = MOOD.idle;
    }, holdMs);
  }
}

function onPopupOpen() { setMood(MOOD.attention, 1400); }
function onUpsellAdded() { setMood(MOOD.happy, 1600); }
function onShippingCheck() { setMood(MOOD.loading); }
function onShippingDone() { setMood(MOOD.idle); }
function onPaymentFailed() { setMood(MOOD.sad, 3000); }
function onPopupClosed() { setMood(MOOD.idle); }

The hold times match the animation lengths: attention runs 1.4 s, happy 1.6 s and sad 3.0 s. A new event clears the pending reset, so a second failed payment does not leave the mascot stuck in an old reaction. For a fuller state pattern, see how to drive Rive character mood states from app state.

Where does the popup code go on Shopify, Webflow or a custom site?

On Shopify, the usual route is a theme app extension. Theme app extensions let an app add blocks and embeds to a store's theme through the theme editor, so a merchant can place the mascot and its popup script without editing theme code. That keeps the cart drawer or cart page change reversible for the store owner.

On Webflow, custom HTML, CSS and JavaScript go in Embed elements or the page and site code fields, which is enough for a single popup script. How to add animation to Webflow covers placement step by step.

On a custom site, give the mascot a fixed width and height in the markup. A popup that inserts a canvas of unknown size shifts the layout, which hurts Core Web Vitals. Keeping LCP, CLS and INP green covers the details.

How do you keep the popup fast and accessible?

Load the mascot only when a popup is about to open, not on every cart page. A file that loads with the rest of the checkout page adds weight to a page where speed matters, and a mascot that a shopper never sees costs bandwidth for nothing. Animation file sizes compared shows how .riv, GIF and video files differ.

  • Show the popup once per session unless the shopper asks for it again.
  • Respect prefers-reduced-motion: show the idle pose or a still poster instead of the moods.
  • Mark the mascot as decorative for screen readers, and put the offer and the buttons in text.
  • Keep the close button and the primary action reachable by keyboard, in a sensible focus order.
  • Keep the mascot out of the price and the buy button, and test on a small phone.

For site-wide rules, read Accessible Animation: Reduced Motion and WCAG. Transparent video exports can be checked for alpha with the transparent video checker.

How do you get a character for the popup?

If you do not have a character yet, start with one clear image. Charmotion needs one finished, coloured character facing the viewer with visible eyes and mouth. Sketches, photos, groups and busy scenes are refused, and nothing is charged for a refused image. An image that would animate better redrawn can be converted to the Charmotion style first for 1 credit.

Then pick the animations the popup needs. Idle is always included for free. Attention, happy, loading and sad cover the moments in the table, and each costs 1 credit. The output is one .riv file with the CharacterViewModelMachine and CharacterStateMachine described above, paste-ready web, React and SwiftUI code, a README, and a transparent poster for each animation.

Plan the states on paper with the mascot state planner, then compare plans on the pricing page. Charmotion takes one image and returns the .riv, web code and transparent videos that this setup needs.

How to add an animated mascot to a cart abandonment or upsell popup

  1. List the popup moments. Write down each moment the popup appears: open, upsell added, shipping or discount check, failed payment and close. Give each one a mood from the table.
  2. Create the character. Upload one finished character image or design one with AI, then choose attention, happy, loading and sad. Idle is included free.
  3. Export the Rive file. Download the .riv with the CharacterViewModelMachine and its mood number, plus the web code and a transparent poster.
  4. Place it beside the action. Give the mascot a fixed size in the popup, keep it clear of the price and the buy button, and set accents to false if sparkles clutter the layout.
  5. Wire the cart events. Call setMood on open, upsell, shipping check, failure and close, and reset to idle after each timed reaction.
  6. Test and measure. Check reduced motion, keyboard focus and a small phone, then compare completed orders with and without the mascot.

Frequently asked questions

Will an animated mascot raise checkout conversion?

This guide cannot promise that, so test it. Show the popup with the mascot to one group of shoppers and without it to the rest, then compare completed orders, not clicks on the popup. Keep the version that wins on orders, and watch returns and support messages for signs that the mascot distracts.

Should every cart popup have a mascot?

No. Use the mascot where a reaction helps the shopper, such as a discount being applied or a payment that failed. Routine notices are often clearer as plain text, and fewer moving parts leave less to cover the buy button on small screens.

Do I need a paid Rive plan to ship this?

Yes, if you want to ship the .riv without Rive's splash screen, because exports on the free plan play the splash. Plan details and commercial use are explained in the guide on whether Rive is free, which links to Rive's current pricing page.

Can the mascot read the offer out loud?

Not with the talking mood. Talking plays a mouth animation (mood 7), and it does not generate speech. Put the offer in text inside the popup and use the mascot for emphasis. Spoken output needs a separate audio tool.

Sources

Related guides