BOSTON Despite a continually sluggish economy, this year’s Fourth of July celebration managed to bring hundreds of thousands of visitors to Boston this week.

And if you’re in the tourism business, that’s music to your ears.

Preliminary numbers indicate that the city saw a nine percent increase in the number of visitors from last year, due in part to improving economic conditions, consumer confidence, and the fact that this year’s festivities coincided with a handful of events — including Navy Week, Harborfest, and perhaps most importantly, the bicentennial of the War of 1812.

The increase is double the national estimate according to Pat Moscaritolo, the president and CEO of the Greater Boston Convention and Visitors Bureau.

“The bottom line here,” Moscaritolo said, “is if you give people a reason to travel or a reason to come, they will.”

Despite what he considered successful marketing campaign, Moscaritolo and his colleagues were worried because the holiday fell in the middle of the week, “it would almost be as if there was no holiday.”

But the opportunity to come to Boston to participate in the numerous events — and celebrate the Fourth of July along with the bicentennial — seems to have been enough to mitigate the negatives of a Wednesday holiday, especially with with New England travelers.

“I think that the majority of overseas arrivals and Canadian visitors were people who were planning to come anyway,” Moscaritolo said. “So the real boost, the real incremental boost, was from people who drove in that live in and around the Boston area or live in one of the other New England states.”

Moscaritolo described the Greater Boston Convention and Visitors Bureau’s estimate on visitor growth going into the summer season as “bullish,” but believed that the past week’s successes help give credence to their estimate.

“Now that we have been through one of the major measuring posts here, with the July Fourth holiday, we’re still going to stick with [our initial estimates].”