The word has a long history and can be traced back to English and then borrowed into irish (Gaeilge) and then back to English under the English spelling of the word meaning what's the news or what is happening or how are you, how have you been. "Whats the crack".
The oldest meaning seems to be that of, wise crack or joke which was the northern English meaning.
In most other countries around the world, "going for the crack would involve taking or seeking out hard
drugs (Cocaine) and you could get arrested for having the crack (in procession of hard drugs) , so it should not be confused with one another as it could be rather tricky with saying this in the most countries without getting strange looks from people especially police officers.
In Dublin which ever spelling you use you are sure to having a good time.
Many references have been made in songs and stories over the years from many famous Irish song writers from the Dubliners to Christy Moore and many Northern Irish writers including Brian Friel and Jennifer Johnson have written stories with the word in the title. An 1990's Australian movie has been made with the title The Craic, mand any Irish themed pubs have also adopted the name.
Of course as with everything the craic has been commercialised and has been exported alround the world in the form of themed pubs and bars offering live "irish Music"
Further references to the words can be
and more here