You might need a whiteboard for this one.

So GSI Commerce sold to eBay for $2.4 billion. There were three companies within GSI that were spun out: Sporting goods vertical Fanatics, private sale site Rue La La and ShopRunner, a coalition of merchants to offer Amazon-Prime-like benefits across a myriad of online verticals.

eBay loaned Michael Rubin, the former CEO of GSI Commerce, the money to buy 70% of ShopRunner, keeping 30% for itself and investing $40 million in cash to grow the business.

Tomorrow, ShopRunner will announce that it’s hardly standing still post-transaction. The company is purchasing Valley-based Shopsanity, a seven-month-old company that was almost done raising a venture round when ShopRunner swooped in and convinced Shopsanity to sell instead.

The amount is undisclosed, but it was no doubt a financial win for the five-person founding team who had bootstrapped the company until then with about $500,000 of their own money. Shopsanity was started by John Rodkin and Leo Chang, two serial entrepreneurs who have built four companies together and sold three. In the last sixty days it had just started to hit exponential growth, so the sale may seem a bit premature to the outside world.

So why did ShopRunner buy this young company and — even more to the point– why did young Shopsanity suddenly decide to sell? It all points to one common goal: Building a huge company that would help all the retailers of the world beat back the threat of Amazon. To that end, the two companies are stronger together than apart.

ShopRunner started as a skunk-works project inside GSI back in 2008. The goal was to give the retail industry a way to compete with Amazon Prime by banding together and offering customers similarly compelling offer.

For a small annual fee, Amazon can give users free-two-day shipping, and with such a wide variety of goods for sale on Amazon, it’s a powerful incentive for online shoppers not to go anywhere else. ShopRunner does something similar for a wide variety of vertical-retailers including Sports Authority, Toys-R-Us and oddly enough Domino’s Pizza. (Don’t worry: In the case of the last one, it’s not two-day shipping, it’s free shipping.)

Retailers were hungry to offer an alternative, and consumers have responded well. ShopRunner is live across 60 sites, with another thirty in the process of implementation. On member sites, ShopRunner buttons are on each item page, better real estate than even PayPal gets. ShopRunner saw an impressive $100 million in gross merchandize sales through its network its first full year.

There are two challenges at this point: Adding as many consumers and high-quality retailers to the network as quickly as possible. The two fuel each other, and without one or the other, ShopRunner doesn’t have much value.

This is where the Shopsanity deal comes in. Shopsanity is like a Mint.com for online and offline shopping. It collects all your electronic receipts and confirmations and makes sense of them, making it easier to track packages, discover new products and learn about any recalls or rebates. The goal was building the online version of Catalina, a grocery and pharmacy data and loyalty company, or Abacus, an data and marketing alliance of catalogs Doubleclick bought for $1.7 billion back in 1999.

Shopsanity helps ShopRunner in a few ways. That down-to-the-SKU data layer helps add powerful analytics into the existing value proposition for merchants. And it gives Philadelphia-based ShopRunner a Valley-based technical team. Shopsanity’s two founders are staying on as chief product officer and chief technology officer of the entire company.

ShopRunner helps Shopsanity tremendously in its goal to build a modern day Catalina or Abacus too. For one thing, it already has a huge headstart with nearly 100 merchants live or in process of going live. And the free-two-day shipping value proposition is a lot clearer of a win-win for customers than a dashboard to manage packages, rebates and receipts.

But the biggest fit was cultural, according to Rodkin, the cofounder of Shopsanity. In a time when many startups are content to build something and flip it, both companies were in this to build something massive that could take on Amazon in a fragmented, communal way.

And ultimately, that goal has to make ShopRunner’s minority shareholder eBay pretty happy.