In this sentence, where credit(ed) is used as a verb, the idiom in English is to credit something with having had some effect. Both for and to can be used idiomatically when credit is a noun, as in "Picasso gave credit to African art for having had a strong influence on his work".