4. Given that $AB$ is the diameter of $\odot O$, $C$ is a point on $\odot O$, and the tangent line through point $C$ intersects line $AB$ at point $D$. Let the radius of $\odot O$ be $r$. When $\triangle ACD$ is an isosceles triangle, its area is $\qquad$ .
4. $\frac{\sqrt{3}}{4} r^{2}$ or $\frac{3 \sqrt{3}}{4} r^{2}$.

As shown in Figure 4(a), when point $D$ is on the extension of $BA$, since $\angle CAB$ is an acute angle, we have $AD = AC$. Therefore, $\angle OCA = \angle OAC = 2 \angle D = 2 \angle ACD = 60^{\circ}$. It is easy to see that $S_{\triangle ACD} = \frac{\sqrt{3}}{4} r^{2}$.

As shown in Figure 4(b), when point $D$ is on the extension of $AB$, since $\angle ACD$ is an obtuse angle, we have $AC = CD$. Therefore, $\angle D = \angle CAD = \angle OAC = 30^{\circ}$. It is easy to see that $S_{\triangle ACD} = \frac{3 \sqrt{3}}{4} r^{2}$.
Figure 4