D.C. United applied advanced analytics when signing midfielder Junior Moreno, left, this offseason. (Federico Parra/Agence France-Presse/Getty Images)

Bret Myers’s fascination with soccer analytics took hold some 15 years ago through a frustrating first-hand experience: He was a benchwarmer.

Stuck on the sideline watching his Richmond Kickers instead of playing for the second-tier pro team, Myers let his curiosity run wild with hypotheses on substitution patterns.

“All that time on the bench, wondering when I was going to go in,” laughed Myers, an analytics consultant for the past four years for MLS Cup champion Toronto FC. “It led me to think, ‘What is going through [the coach’s] head when he is trying to decide? Is it a reactive strategy to see how the game unfolds? Or does he have a plan going in?’ ”

From that experience, Myers entered into data-driven analysis of one of the least quantified team sports. Soccer is not a game of numbers; it’s low-scoring, features few individual statistics and lacks the figures that many sports fans crave. But in the past five years, the number of MLS teams employing analytical experts has blossomed.

The practice has also risen overseas, where the sport is often slow to embrace innovation. The German federation, which oversees the World Cup champion men’s national team, employs a head of match analysis.

“You need to collect it, organize it and then look at it,” Toronto General Manager Tim Bezbatchenko told the Globe and Mail, “and try to figure out patterns and new ways of looking at the game.”

Most MLS organizations employ someone with “analyst” or “analysis” in their job title. Some work exclusively in video review, some in the sports science field. Others take a more sophisticated approach, evaluating, for instance, the number of times a player passes the ball forward from a certain location on the field, or how many players are necessary in the penalty area to properly defend a corner kick against a specific opponent.

“We go from almost no teams using it,” said Jeff Agoos, MLS’s vice president of competition, “to every team using it now.”

Since Myers’s regular work is in education — he’s an assistant professor at Villanova and lectures on analytics in global sports at Columbia — Toronto three years ago hired a full-time expert: Devin Pleuler, a former data scientist and statistician.

Two years ago, D.C. United recruited Stewart Mairs from Prozone, a global sports-analytics firm with an MLS partnership. His experience included technical and tactical support for the U.S. women’s national team at the 2012 Olympics and 2015 Women’s World Cup.

The numbers are used to not only evaluate a team’s own players but those around the league as part of game preparation and trade considerations. Soccer’s global marketplace also encourages teams to compile vast sums of data on players targeted for acquisition.

“We won’t sign a guy on data alone,” Mairs said, “but because we look at every play and filter it, we’ll have a report in terms of strengths and weaknesses.”

For budget-conscious MLS teams like United, Mairs said, analytics help mitigate risk. “Most teams only have one or two bullets to make a real effective signing,” he said.

United hired Mairs in part to become more efficient in the marketplace and identify undervalued talent.

“D.C. had a history of taking experienced guys from around MLS and squeezing every last ounce out, and they did it really well,” he said. “But now I think the league passes you by a little bit” if a team does not apply analytics to players abroad.

This winter, United applied analytics in signing midfielders Junior Moreno (Venezuela) and Ulises Segura (Costa Rica). Mairs had also prepared data when the club pursued — and acquired — several players from inside MLS this winter.

Early forms of soccer analytics produced statistics such as passing percentage and shooting efficiency. Now, there is a deeper assessment of individual and team behavior. Analysts use raw information, such as what happens away from the ball, to build algorithms.

Soccer is difficult to quantify, Mairs said, “because it’s a fluid game and open to subjectivity. Raw numbers won’t do it justice.”

Myers was inspired to explore soccer after reading “Moneyball,” Michael Lewis’s 2003 bestseller about baseball analytics. “I wanted to look into soccer — what kind of cool, quantitative studies you could do,” he said.

His first subject: substitutions. After evaluating hundreds of matches all over the world, he published a study concluding the best times for a trailing team to make changes are before the 58th, 73rd and 79th minutes. Later, he applied playing styles in the Premier League into the equation.

In late 2012, Myers addressed a small group of MLS officials in New York about the general use of analytics. A month later, he gave a presentation to coaches and general managers at the scouting combine.

“What we really wanted to do,” Agoos said, “was expose the group to what data could do for them.”

Philadelphia hired Myers. A year later, he moved to Toronto FC and reunited with Bezbatchenko, his former University of Richmond teammate.

“We think there’s a lot to be gained from the analysis in improving the quality of the game,” Agoos said. MLS launched a data and sports science subcommittee, with representatives from every team. Pleuler is the new chair, succeeding Seattle’s David Tenney, who was hired last fall by the NBA’s Orlando Magic.

Not everyone finds value in numbers.

Bruce Arena, the former U.S. national team coach who won five NCAA titles and five MLS Cups, said two years ago that “analytics in soccer doesn’t mean a whole lot. Analytics and statistics are used for people who don’t know how to analyze the game. This isn’t baseball or football or basketball. We have a very important analytic, and that’s the score. That distorts all the other statistics.”

Myers understands the skepticism.

“You don’t want to get too crazy with what the numbers say because what the eyes are telling you is also important,” he said. “It’s the marriage of the database with your eyes. When all signs are pointing in the same direction, you are that much more confident.”

Read more analytics coverage from The Post:

The NBA is a copycat league, but good luck imitating the analytics-obsessed Rockets

Thomas Boswell: Collusion or common sense? Either way, baseball may be headed toward labor war.

Billy Beane is witnessing Moneyball’s endgame: ‘We’re all valuing the same things’

Timberwolves are winning with a stunningly efficient inefficient game plan