Yes. But cloud users should use the static snippet as we do not support dynamic snippet injection in the cloud due to the complexity involved.
On-premises customers can more easily add the snippet dynamically. The snippet can be added according to user interaction or 'session states'. Logic can be added either on the client or the server side to enable dynamic snippet injection. (Strategies will vary according to the specific installation and the intended goals.)