For years, states have been arguing that they are losing millions of dollars in uncollected taxes from online sales. In response, a few of them have begun crafting their own rules to get some of that tax money back. Massachusetts is one of the latest — and the way it's doing this is unprecedented.

"I buy all my pet food and pet supplies online," says Michelle O'Brien, a 44-year-old Internet shopping fanatic. "I buy most of my laundry detergent, shampoos and almost everything really besides groceries."

O'Brien — like a lot of Americans — started shopping online more in the past couple of years. "You don't even have to be... on your laptop," she says. "You can be pretty much anywhere, and just open an app and order some things."

Thanks to people like O'Brien, online sales are growing by about 15 percent each year. But all this e-commerce isn't necessarily translating into tax dollars for states.

Amazon, the largest online retailer, started collecting sales tax nationwide this past April. Most online retailers still don't: Back in 1992, the Supreme Court ruled that retailers must have a physical presence in a state to collect taxes.

"It usually means when there's a warehouse, an office, an employee located in those states," says Richard Jones, a Boston tax attorney. "It doesn't have to be much, but it has to be something. Something real, something physical."

The cookie approach

Technically, when you shop online, you're still supposed to back-pay your state when you file your annual taxes. But in reality, most people don't. And there's nobody actively enforcing the rules.

That means there's a lot of potential money being left on the table for state governments. The National Conference of State Legislatures estimated that in 2015 states lost roughly $17 billion in uncollected taxes from electronic sales.

Massachusetts is one of the latest states to step up the fight for tax dollars, issuing a new directive for out-of-state online retailers to begin collecting the 6.25 percent state sales tax starting July 1.

As a trigger, the state is adopting a hyperliteral definition of physical presence — one that relies on any downloaded apps as well as "cookies," the little bits of data that websites store on users' computers or phones to track their visits. Massachusetts is now considering them a physical in-state operation for a company.

"Massachusetts is arguing that these vendors with no property and no people and no offices in this state, they still have physical presence because of Internet cookies," Jones says.

Essentially, it's an Internet answer to an Internet problem.

But Jones says it raises a lot of questions about how you define property.

"Who's the owner? There's a presumption that the Internet vendor retains ownership of that little tiny bit of advertising software tracking code," Jones says. "I'm not sure if that's right."

Brick-and-mortar versus e-commerce

But whether or not it's right doesn't matter to a lot of brick-and-mortar stores — they're happy something is finally being done as they say the current tax system hurts their businesses.

"You know, for years, retailers here and across the country have argued for a level playing field," says Bill Rennie, vice president of the Retailers Association of Massachusetts. "It's become much more important each year now with the growth of mobile commerce. Folks can shop and comparison shop and purchase anywhere they want from their smartphone."

And so to some folks, the Massachusetts tax theory seems like sheer genius, but to others, it's a shameless tax grab.

Steve DelBianco is on the shameless-tax-grab side. He leads NetChoice, a national trade association representing e-commerce sites. He says under this strange Massachusetts theory, "your business is subject to the taxation [and] regulation in any state where a user simply enters their website address. That can't hold up to legal scrutiny, because it certainly doesn't hold up to common sense."

DelBianco is not convinced a cookie on your computer is the same thing as a storefront in a strip mall. He is willing to take that argument to court and says his group is pursuing an injunction to block enforcement of the law before it goes into effect in July.

Asma Khalid leads WBUR's BostonomiX team, which covers the people, startups and companies driving the innovation economy. You can follow them @BostonomiX.