“Mad Men’s” Don Draper (Jon Hamm) wasn’t the first McCann Erickson exec to get a smart idea for Coca-Cola. (courtesy of AMC)

AND JUST LIKE that, with TV product placement that was not only prime but also reportedly free, the series finale of AMC’s “Mad Men” Sunday night returned the work of century-old ad agency McCann Erickson to pop culture’s center spotlight. When [thar be spoilers] our reeling alpha-male Don Draper/Dick Whitman (Jon Hamm) is ditched at an Esalen-like California retreat, left to chant in his khakis as the bell of mindfulness gives way to a wide, satisfied smile, we are fairly led to believe that this fictional McCann ad-man has just hit upon the idea for what, back in the real world, became one of the most iconic TV spots, and culturally resonant sales-jingle-to-hit-single tunes, in advertising history.

The song, of course, was “I’d Like to Teach the World to Sing (in Perfect Harmony),” for the “I’d Like to Buy the World a Coke” ad dreamed up at a flight-delayed Irish airport by McCann’s Bill Backer, created in concert with top pop tunesmiths and soon sung by (in an era-appropriate name) the New Seekers. The “Hilltop” spot, featuring hundreds of young hires on a verdant Italian slope, spoke to a Vietnam era in search of something — love and peace, or wake-of-Woodstock community, perhaps even hopeful person-to-person connection — after a decade of turmoil and violence, of assassinations and persistent Cold War threats. And by capping his series with that one commercial, “Mad Men” creator Matthew Weiner evoked, aside from character narrative, the sense of transition as cultural transaction, as Madison Avenue caught up with the shifting mood of much of a nation.

For me, though, the ad also reflected just how much success Coca-Cola, as represented by McCann, had already had in the ’60s — as the business of peddling pop fluidly tapped into pop culture. And it prompted me to recall just how instrumental — about five years earlier — Coca-Cola was in the animated rise of Charlie Brown.

Thinking the same thing, after watching the “Mad Men” finale in California, was the “Peanuts” producer who first heard from Coke.

A listen in commercialization: “A Charlie Brown Christmas” (courtesy of Peanuts Worldwide/ABC/United Media)

Now, it’s worth noting that ever since its 1912 inception, McCann (which two decades later would merge with Erickson) had a particular appreciation of cartoon art. One of the agency’s five founders was Thomas Nast Jr., son of the legendary, Boss Tweed-era political cartoonist Thomas Nast (who also popularized the snowy-white popular image of Santa Claus — so commonly depicted on Coke products.). Nast Jr. was also a gifted illustrator, and at the firm’s launch, he designed the logo for what’s touted as the world’s first advertising trademark: “Truth Well Told.”

Thomas Nast Jr.'s original McCann logo illustration. Thomas Nast Jr.’s original McCann logo illustration.

For at least a decade, the agency also employed a young Theodor Seuss Geisel, who honed his distinctive character types and animal drawings for such clients as Ford and Flit, GE and NBC, Schaefer Beer and Standard Oil — before he fully embarked on his career as children’s author “Dr. Seuss,” as his fame grew by midcentury.

But to get a sense of McCann Erickson in the Don Draper era, we jump to the mid-’60s, and the memories of Lee Mendelson.

Mendelson, a lifelong San Franciscan, had won a Peabody Award for a documentary on his native city’s history, which led him to make a much-lauded early-’60s TV documentary about future Hall of Famer Willie Mays. Next, having made a film about “the world’s best baseball player,” Mendelson decided to make a movie about “the world’s worst baseball player”: Charlie Brown. Mendelson called “Peanuts” creator Charles Schulz — a fellow Northern California resident by this point; Schulz and his son Monty had seen and liked the Mays documentary, and Schulz and Mendelson decided to work together.

“McCann and Coca-Cola had seen the 1963 [Schulz] documentary — which never sold,” Mendelson picks up the narrative, speaking today to The Post’s Comic Riffs. “They called in June 1965, asking if Schulz, [animator Bill] Melendez and I had been thinking about doing a Christmas special.

“I immediately said, ‘Yes,’ assuming we could develop something in a few weeks or months.”

Turns out, McCann Erickson didn’t want to wait a few weeks, let alone months.

“It was a Wednesday, and they said they needed an outline by Monday, as they had to make a quick decision, as other animated specials were being offered,” Mendelson tells me. “I called Schulz and said, ‘I think I just sold a Charlie Brown Christmas show.’ He asked, ‘What is that?’ And I said, ‘It’s something you have to write tomorrow, when Bill and I come up.”

Mendelson and Melendez headed up to Santa Rosa, the three masterminds collaborated brilliantly — and the project was offered.

“Coca-Cola bought the outline, and the show went on [television] six months later,” says Mendelson, who also hired Bay Area composer Vince Guaraldi. “It did a 45-percent share of the [national] audience, and went on to win an Emmy and a Peabody.”

And that special, of course, remains a classic, attracting millions of viewers with each holiday airing. Mendelson’s dozens of animated specials with Schulz and Melendez have attracted generations of fans — ahead of the first “Peanuts” CGI-animated feature film (due out in November).

That wasn’t the last time Mendelson and his production company would work with the agency, whose creative director was Neil Reagan — brother of the future president.

“A year later, we called McCann and Coca-Cola again and said we had the rights to do John Steinbeck’s ‘Travels with Charley,’ starring Henry Fonda,” Mendelson remembers. “They sponsored that as well, and it got an Emmy nomination.

“Years later, we did the Willie Mays program, ‘Tips on Baseball,’ which Coca-Cola also sponsored.”

So as the world was buying Coke, the soft-drink firm was also buying in to the worlds of others — sponsoring creative content that helped define the culture.

Listen to Mendelson, and you realize Don Draper is not the only man who can smile at what was accomplished then.

Lee Mendelson (left), Charles Schulz and Bill Melendez accept the Emmy Award in 1966 for best children’s program for “A Charlie Brown Christmas.” (Photo courtesy of Peanuts Worldwide)