When President Barack Obama arrives at Facebook headquarters this week, he will be the first sitting head of state to visit the brick-and-mortar home of the social media powerhouse.

He will also be partaking in a unique pilgrimage to this area in Northern California that has become a cradle for social media, a trip that is all but obligatory for politicians like presidential hopefuls, celebrities like Lady Gaga and dignitaries from around the world like Russian president Dmitry Medvedev.

Such visits to the hottest tech companies in Northern California's Silicon Valley offer a traditional chance to connect face-to-face with new-media users, voters, fans and potential donors. But the A-listers of entertainment and government also gain important cachet that comes from fusing their personal images with the technology brands the world sees as the future.

For politicians especially, this moment in the history of technology must feel like it did for their counterparts a half-century ago, when leaders knew they had to get wise to this new thing called television.

And as the 1960 televised presidential debate between Richard Nixon and John F. Kennedy showed, some politicians turn out to be better than others at commanding a new mass medium.

Obama was the first president to take office after social media became commonplace. His campaign earned praise for its skill at using the Web to organize grass-roots fundraising and voting efforts.

Today, the president's official Facebook page has more than 19 million fans and his Twitter account nearly 7.5 million followers (still fewer than Lady Gaga, who has nearly 9.5 million followers). During his visit to Facebook, Obama's appearance will be broadcast live online as he takes questions from among the site's 500 million users worldwide.

Andrew Noyes, a public policy communications manager for Facebook, confirmed Tuesday that Obama's stop there would be the first time a sitting head of state takes questions at its headquarters.

These new versions of the traditional town hall give politicians the opportunity to appear as if they are interacting with the public in a more unfiltered way. But staffers are often behind the online profiles, composing Twitter and Facebook posts for their busy bosses.

As a result, the value of genuine face time still holds sway.

Obama's embrace of technology has coincided with his embrace of the tech industry, which in the liberal San Francisco Bay area tends to lean Democratic.

In February, the president came to Silicon Valley for dinner with the tech industry's biggest stars, raising a glass at venture capitalist John Doerr's Woodside home with Facebook founder Mark Zuckerberg, Apple's Steve Jobs, Google's then-chief executive Eric Schmidt and Twitter CEO Dick Costolo.

The event was closed to the press, but publicity photos handed out afterward showed the president mingling with the industry leaders whose faces have become nearly as famous as those of the celebrities whose attention they command.

Obama praised the tech industry at the time as an economic bright spot and a jobs engine for the country. Employment will also be the topic of the Facebook town hall, even as the president's own job and those of his Democratic colleagues will be on his mind when he lands in San Francisco.

Obama will host four fundraising events while in the Bay Area, including a private dinner for 60 at the home of Salesforce.com chief executive Marc Benioff, according to the San Francisco Chronicle. The event has sold out at $35,800 a seat, the newspaper reported.