"No one helped Tracy to do her homework; She did it (all?) by herself (all)."
I have two options of where to put the word ALL, as I showed in the sentence. Where is the right place?
She did it all by herself.
There are two ways you could think about this:
She did it completely by herself, where completely/all modify "by herself".
She did all of it without any help, where all of it/it all is the object of "did".
In #1, there is a shortened version, which is a fragmentary sentence, quite common, "All by myself." In #2, there is a shortened version, also common, "She did it all" meaning "she did everything".
She did it by herself all.
She did it all by herself.
The first sentence is unidiomatic and incorrect grammatically, whereas the second one is OK.
(all) by hersekf is an idiomatic phrase. The adverb all, if used, with the adverbial phrase by oneself, it always comes before the phrase.