If you want to count the instances in another column, then you can just add another COUNTIF, like this:
=COUNTIF(D:D,"text")+COUNTIF(G:G,"text")
If you only want to count a row once if the text appears in both columns, then try:
=COUNTIFS(D:D,"text",G:G,"text")
If the text can appear as part of the cell value, you can use "*text*" instead.