I don't think you need to modify the dom for to include the tracking info. Could you set js variables within a <script> tag right before you include your async_metrics_loader?