A digital menu board is displayed in the drive-thru of a McDonald's Corp. restaurant in Peru, Illinois, U.S., on Wednesday, March 27, 2019.

Both deals are relatively small for the fast-food giant, which has a market value of $143.73 billion. The Dynamic Yield deal is valued at more than $300 million, according to people familiar with the matter, while McDonald's spent roughly $3.7 million on a 9.9 percent stake in Plexure.

The Chicago-based company announced on March 25 it is acquiring personalized data start-up Dynamic Yield, marking its largest acquisition in more than two decades and its first in a tech company. Just seven days later, it announced a second tech investment: a minority stake in mobile app vendor Plexure, which powers its mobile app in 48 countries outside of the U.S.

McDonald's took nearly 20 years to step back into mergers and acquisitions. But now it has returned to deal-making, as it looks to build on its tech-heavy strategy with calculated digital investments.

McDonald's dealmaking strategy follows a general trend across the broader retail and consumer industries. A recent report from A.T. Kearney predicts that smaller-scale, strategic deals will characterize most of the M&A activity across those industries this year.

"Broadly speaking, we see major restaurants and retailers focus on fortifying their portfolios with capabilities they are missing," A.T. Kearney partner Bahige El-Rayes, who co-authored the report, told CNBC. "Often those capabilities don't exist internally, and building them in-house will be expensive, timely and the outcome will be unknown."

But more than just following a trend, both investments — despite their lack of size — play an important role in McDonald's current strategy to use technology to bring back customers and get a leg up on the competition. The fast-food giant lost sales as its order accuracy and speed of service lagged behind the competition. It also fell behind other restaurant companies such as Subway and Starbucks when it came to launching an app and testing mobile ordering.

Now it's trying to make up for lost time.

For several years, the company has been renovating its U.S. stores with self-serve kiosks, digital menu boards and other tech-focused upgrades meant to improve convenience for the customer and speed up how fast their food gets made. This year, McDonald's is planning to spend nearly $1 billion to renovate 2,000 U.S. stores. It originally pursued an ambitious plan to remodel all U.S. locations by the end of 2020, but has since pushed the deadline back two years.

The company has also partnered with UberEats to deliver its food, but for now the bulk of the customer data belongs to the third-party delivery service, not McDonald's.

Both Dynamic Yield and Plexure present even more opportunities for the fast-food giant to build on those investments.

McDonald's is planning to implement Dynamic Yield's decision-making technology at the drive-thru, which accounts for roughly 70 percent of its transactions. That makes the company one of the few restaurants using machine learning to nudge its customers into spending more, according to Morningstar analyst R.J. Hottovy.

In addition to suggesting menu items that cost more, the drive-thru menus could also suggest food that does not take as long to make, speeding up drive-thru lines.

Dynamic Yield's personalization technology could also be a part of its self-serve kiosks or its mobile app — the more valuable long-term prospect in Hottovy's opinion.

McDonald's deal with Plexure not only gives it more access to the New Zealand-based company's technology to improve customer engagement with its mobile app but also restricts Plexure from working with others in the fast-food industry. That means that Yum Brands' Taco Bell and Restaurant Brands' Burger King will have to seek out other companies to keep up with the latest developments on McDonald's mobile app.

"Because everyone has seen them as the big giant, they think they can't move fast. But now they've shown that they can be nimble," Phil Kafarakis, industry veteran and president of the Specialty Food Industry, told CNBC.

— CNBC's Emma Newburger contributed to this report.