Here "The Beginning", Ganesha is said and there lives the God (Supreme Power) in the beginning. So he is adored. Whenever any prayer is performed the prayer of Maharaja Shiva, Shiva is the name of that Ganesha who is adored.
Read this post on mithsofhinduism.blogspot.com