All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The water used in Ghusl for Janabah (state of major impurity due to intimate relations, wet dreams, losing consciousness, ...) has to be pure and purifying. It is pure water which has no change in any of its three descriptions: color, smell or taste. When it is changed by something pure, it is no longer considered purifying and it is ineligible to remove either the major impurity (what requires Ghusl) or the minor impurity (what requires Wudhoo’). This is the opinion of Ash-Shaafi‘i, Maalik, and Ahmad in one of two relevant narrations, and it is the opinion adopted by the Hanbali scholars .
Some scholars, however, hold the view that it is permissible to make Ghusl with water that has been changed by something pure, as long as it has not changed into something other than water. This is the opinion of Abu Haneefah and Ahmad in another narration, and it is the opinion chosen by Shaykhul-Islaam Ibn Taymiyyah .
There is no doubt that the first opinion is more cautious and more likely to absolve one of liability.
Consequently, when water used for Ghusl in the bathtub is mixed with soap, shampoo, and so on, it is not eligible to remove the state of Janabah. That is because it is no longer considered purifying. When one wants to wash himself with soap or shampoo, and so on, one has to do so before or after making Ghusl for Janabah.
Allaah Knows best.