If Phil Dunphy’s insistence that he’s a Realtor and not a real estate agent on “Modern Family” this week seemed a little odd, be aware that ABC was paid to make that distinction.

The plot twist was part of a new advertising campaign by the National Association of Realtors. At a time of fear among advertisers that their messages are getting lost, it represents a tactic beyond the casual product placement of a soda can or car in the background of a television scene.

In the episode that aired Wednesday, the Dunphy character twice makes the point that he’s a Realtor. Dunphy wins a battle with another character’s nemesis by confronting her with insider knowledge gleaned from his profession: that there’s been illegal construction on the woman’s property, and her grandson is attending an out-of-district school.

At the show’s end, Dunphy straightens an “R’’ insignia pinned to his suit jacket.

advertisement | advertise on newsday

The Realtors are touting their services over licensed agents who are not members of their association, and trying to counter a trend where more consumers are doing their own real estate research to avoid paying fees, said Elizabeth Mendenhall, incoming president of the association.

With Dunphy, portrayed by actor Ty Burrell, the group sensed an opportunity: a main character on one of television’s most popular comedies who sells real estate.

“He’s now one of America’s best-loved Realtors,” Mendenhall said.

Neither Mendenhall nor ABC would say how much the association paid ABC for the placement. The campaign also includes more traditional ads featuring Burrell’s character that premiered during two other ABC sitcoms Wednesday.

Burrell said there’s always some nervousness when advertising intrudes on the creative process. But he said he trusted the “Modern Family” executive producers, who signed off on the use and wrote the scenes. “Their sense of caretaking for the show is very high,” he said.