Of course it counts, and should count. Foreign money enters an economy if that economy is producing something the foreigner wants.
A simple bank transfer into the country does not count as domestic Product.