Passing A Field Value From Javascript In Tracking Tools & Analytics To Wix Text or Input Field

Hello, I am running a third party script within Tracking Tools & Analytics and need to capture the output from the a field into an on-page wix text input or text field. The script runs on page load across every page on my site and the field is a unique ID/key for each visitor.

How do I achieve this? I am aware document.getElementById does not work on page code, but I essentially need the same functionality.

Thanks,
Jack