The City of Nanaimo has launched an online ad campaign targetting some major Hollywood stars and featuring the sweet treat named in the Harbour City's honour.

"Hey Seth Rogen and Dan Levy, come to beautiful Vancouver Island and try the real Nanaimo bar," says a woman in the 38-second commercial.

Rogen, a Vancouver-born actor and comedian, recently commented publicly on a New York Times recipe for the "tremendously sweet, no-bake layered cookie from Canada," as the Times headline put it.

Rogen seemingly corrected the headline on Twitter, writing, "It's actually from Nanaimo, which is a town on Vancouver Island," before adding "these things are f--king delicious."

Levy, who is also a Canadian-born actor and comedic writer, tweeted the same Times article, saying: "So glad the Nanaimo Bar hired a better publicist. She deserves this moment."

Discussing the new ad campaign on Wednesday, Nanaimo Mayor Leonard Krog told CTV News he thinks the campaign speaks to the character of Nanaimo.

"It's an exciting place," said Krog, who is shown in the ad riding a zipline while snacking on a Nanaimo bar.

"If you're a mountain biker, you're off in the hills. You want to go ziplining? It's here. It's just a pretty fun place to be a tourist and to come visit. And in the longer haul, many people who have come here to visit over time have discovered it's a great place to live and invest and raise a family."