Tanzania is an easy country to be a visitor in. People are patient with foreigners and nobody expects you to get everything right. These are the things that are worth getting right anyway.
Greet people, properly
The single most useful thing in this article. Greet before you ask, every time, including with the person who brings your coffee and the person at the park gate. Rushing to the question reads as rude in a way it doesn't at home. The words are in the Swahili article, and shikamoo to anyone noticeably older than you is the one that lands hardest.
Handshakes are common, frequent and often long, and hands are sometimes held through a whole conversation between friends. It means nothing more than friendliness.
The right hand
Give, receive and eat with the right hand. The left is considered unclean, and this matters particularly on the coast and in Zanzibar. Taking something with both hands, or with the right while the left touches your forearm, is a mark of respect.
Dress
More conservative than most visitors expect, and more so in Zanzibar, which is predominantly Muslim, and in towns generally. Shoulders and knees covered is the safe default away from a beach or a lodge. Beachwear belongs on the beach, not in Stone Town. Nobody will say anything if you get it wrong, which is exactly why it's worth getting right.
Photographing people
Ask first. Always, and especially with Maasai, who are photographed constantly and often without being asked. Some will say no, some will ask for a small payment, and both are fair. Don't photograph government buildings, airports, police or military. In a village arranged through your guide, ask the guide what's appropriate before you start.
Bargaining
Expected in markets and with street vendors, not in shops, restaurants or lodges. It's a conversation rather than a confrontation: smile, take your time, be willing to walk away, and keep in mind that the amount you're arguing over is probably small to you. Prices in curio shops are fixed unless they're obviously not.
A few quieter things
Public displays of affection are uncommon and best kept low-key. Time is relaxed; a schedule is a suggestion in town and exact in a national park, where gate hours are strict. Pointing with a finger is a little rude, and a nod of the head does the job. Tipping has its own article, and getting it right matters more than most etiquette.
And one about giving things to children
Please don't hand out sweets or pens from a vehicle, however well meant. It teaches children to approach traffic and to beg from strangers. If you want to help, ask your operator about the school or clinic they actually work with and give there.