The temple is actually dedicated to Lord Shiva. But became famous for the Ganesh shrine by the side of the main shrine of Lord Shiva.
Legend is related to the palazhi mathan (churning of the milky ocean) story og Bhagavatha purana. During the churning, both devas and asuras became tired. So, sage Narada advised them to worship Lord Ganesh before further churning the ocean so that it be completed without any problem.
Since no idol of Lord Ganesh was available immediately, Devas made a Ganesh idol using the froth from the ocean. There after they were able to complete the churning of the milky ocean without any problem.
After the churning is over, the legend tells us that sage Narada advised Lord Indra to install that idol made of froth at this place. Since, the idol is supposed to be made of froth, no abhishekam is performed on this idol even now.
Temple is on the banks of river Kaveri.
Temple is seven kilometers from Kumbakonam, very near to Swamimalai- the famous abode of Lord Muruga and one of the Aarupadai temples of Lord Muruga.