The fifteen year old male was the target demographic of the Trek producers.
"Of course, the young male demographic has always been the target demographic for Star Trek, the men ageing fifteen to about twenty-five or thirty, a very tough market to appeal to." - Kate Mulgrew
Except in 1966, when I was a fifteen year old male.
And yep you are right, TOS was hitting all the "right" demographics and was canceled because at that time the networks were only looking at total numbers. When they finally switched over to "demographics" they discovered that they had canceled the wrong show. This was about the same time that CBS discovered all their widely watched shows were appealing to older people and they canceled really popular TV shows because the "demographic" that advertisers wanted were young people not the older ones that watched CBS.
In 1966, when you were fifteen and I was nineteen, the viewers of TOS were the "perfect" demographic and the networks didn't know it.