How effective was WWII bombers self defense anti-air armament? Bigger WWII bombers like e.g. the B-17 Flying Fortress were equipped with lots of machine guns for self-defense against single-seat fighter aircraft.

Wikipedia says:


  Defensive armament increased from four 0.50 in (12.7 mm) machine guns
  and one 0.30 in (7.62 mm) nose machine gun in the B-17C, to thirteen
  0.50 in (12.7 mm) machine guns in the B-17G. But because the bombers could not maneuver when attacked by fighters, and needed to be flown
  straight and level during their final bomb run, individual aircraft
  struggled to fend off a direct attack.


The last sentence and the fact that fighter escort was developed and also personal impression from live footage etc. indicates that the self-defense armament wasn't very effective.
Is this true?

I can understand that bombers cannot do evasive maneuvers, but so does the attacking fighter plane when it is homing in on the bomber and aiming, isnt it?
In that moment the bomber actually should have the advantage of being able to point the (several) mobile guns, while the fighter must use the entire airframe to aim its guns and thus has a very predictable flight path.

And in case it really wasn't effective, why did they carry it then? Must have added a lot of additional weight.

Are there any figures to illustrate the effectiveness of bomber self defense?
The only figures I could find were the 60 bombers out of 300 lost by the USAAF in the Schweinfurt raid, most of those losses from German fighters. That convinced the generals that the onboard gunners weren't all that effective, and bombers couldn't defend themselves from a determined fighter attack. Major air attacks on Germany were postponed until the long range P51 could be deployed to protect the bombers better. 

Gunnery from a bomber is far more difficult than from a fighter, that fires straight ahead. In a bomber, the gunner might be firing to the side, which means they have to factor in the bomber's speed that will propel the bullets sideways, and actually aim slightly behind the approaching fighter. The closer to the nose or tail, the less one aimed behind... bomber gunnery is very complex. This wartime training film illustrates the problems of firing on fighters approaching from the side. Try to calculate those ever changing angles when you're being shot at... 

The same difficulties were experienced by ships being attacked by aircraft... very difficult to shoot down a small, fast moving aircraft approaching a ship. The Bismarck couldn't stop slow moving Swordfish biplanes from knocking it's rudders out. In the last major naval action of the war, eight Japanese warships (including the Yamato) were attacked by around 400 aircraft from US carriers. Seven of the eight ships were sunk, while only 14 aircraft were lost in the action, despite those ships having had quite a few extra AA guns added. 

So, why arm the bombers? That was a question asked by Curtis LeMay in 1945. He devised a plan to take most of the guns out of B29's and operate them at night, because the Japanese hadn't demonstrated much in the way of night interception. He reduced the attack altitude to 12k feet from 30k feet, because that put the planes above small arms, but below the effective range of large anti-aircraft cannon. And, he used the weight saved from armament removal to carry extra incendiary bombs, to ignite the largely wood buildings of major Japanese cities. 

The result was the fire raids, the most destructive bombing campaign of the war, even more destructive than the atomic bombs. 

Guns on bombers have been dwindling since then, with the B52 having only one tail gun, while the B1 and B2 have no guns. Still, during Linebacker II, two MIG21's were shot down by B52 tail gunners, so the guns weren't completely useless.