A word to Turkey's Prime Minister Tayyip Recep Erdogan, who recently described Twitter as a "menace to society": You can learn a lot about the protests and the motives of those driving them from how they use the microblogging service.

Turkey's Gezi Park protests have been a Twitter revolt, as distinct from the Facebook revolutions of the Arab Spring. It turns out that Twitter is now a better tool for social unrest -- and provides better data about it.

Ebrandvalue, an Istanbul-based company that analyzes social-media data to measure branding power for companies, looked at the protests that have swept the country. It came up with a series of charts and graphs, using data from Twitter and Foursquare, the Twitter-based service that allows you to "check in" to locations.

The first accompanying chart tracks the frequency of check-ins on Taksim Square over a 12-day period. As Erdogan was preparing to return home from North Africa on Friday, in Istanbul the protests were gaining strength. Erdogan needed either to confront them or meet some of their demands. (In other big cities the protests had either plateaued or were fading.)

Tolga Akcura, a former marketing professor at Purdue University who now teaches at Istanbul's Ozyegin University, co-founded Ebrandvalue. He said the company used an algorithm software it developed to measure brand impact to look at who the protesters are. The result, in the second accompanying chart, shows that of the Twitter users posting unique content with hashtags related to the protests, a huge majority did not support Erdogan -- by a margin of 68,000 to 800. Also, only a small minority of the Twitter users had ever posted on political issues before.

The first of those findings helps explain why Erdogan dislikes Twitter so much. Even though he has his own Twitter account with more than 2.8 million followers, the Twitter-sphere is a medium for opposition that -- unlike conventional media -- he doesn't dominate and can't control. More importantly, given that most of those posting were not previously vocal about politics, Erdogan's accusation that the protests are a purely political effort by people who lost elections to win power by other means is probably wrong.

No doubt Turkey's opposition parties are trying to ride the protest wave, but if this turns into a purely political confrontation between the 50 percent of the country's population who voted for Erdogan in the 2011 parliamentary elections and the 50 percent who didn't, it will probably be his own doing.

Education Minister Nabi Avci, who has been a close adviser to Erdogan since early on in the prime minister's political career, put this succinctly, when he said, according to the Hurriyet Daily News: "We have succeeded in five days in doing something that the opposition wouldn't have been able to do in years. And we have made very different segments, groups and fractions meet each other under the dust, who would never have gotten together under normal conditions."

Finally, and perhaps most interesting, Akcura and his company mapped the regional usage of Twitter in the protests through the use of dedicated hashtags, in the third accompanying chart. This shows that the biggest use of hashtags for a protest was not in Istanbul, a city of between 12 million and 15 million people, but in Tunceli, a province of about 80,000 people in central-eastern Turkey, often called by its historical name, Dersim.

Dersim is known to every Turk primarily because of Mustafa Kemal Ataturk's brutal suppression of the 1930s Dersim rebellion against an assimilation law, which involved resettling ethnic minorities. Today Dersim is still mainly populated by ethnic Kurds who follow the Alevi religion.

The third biggest regional hashtag usage, after Istanbul, was in Hatay province, on the border with Syria. About half of Hatay's 1.5 million people are Arab Alawites, divided from their co-religionists in Syria only by a line on the map. Alevis and Alawites are close in religious terms, and both are upset with Erdogan over what they see as his pro-Sunni policies in Syria, where the country's Alawite minority support President Bashar Al-Assad's regime against the mainly Sunni uprising.

More recently, Alevis, who make up about 15 percent of Turkey's population, were upset by the government's decision to name a planned bridge over the Bosporus after Sultan Selim the Grim. Selim is remembered for defeating Persia and ordering the massacre of an estimated 40,000 Alevis in 1514. Alevis saw naming the bridge after the man who killed their ancestors as, at best, insensitive.

It helps that Turkey has excellent mobile phone coverage and very high social-media penetration. But for such relatively small cities to play a prominent role in the Gezi Park protests should be a warning. As Avci suggested, the protests are uniting widely differing aggrieved groups -- from Alawites to Istanbul hipsters -- against the government.

Still more worrying, given Erdogan's indication that he wants to call supporters out in a series of counter-demonstrations this week, is that in places like Hatay and Dersim, where there are large concentrations of religious minorities living alongside Sunnis, any confrontation between the prime minister's supporters and opponents may turn sectarian.

(Marc Champion is a member of Bloomberg View's editorial board. Follow him on Twitter.)