You can use Dynamic Tag Management automate the deployment of the Marketing Cloud ID Service. Depending on the element there are slightly different steps, please see this article for the most up to date info.
Important: The Marketing Cloud ID Service tool integrates only with Adobe Analytics. This service must be the first code that loads on a page. It must load synchronously, and it cannot be edited. Additionally, to avoid conflicts, use only one method of deploying the Marketing Cloud ID Service (either the dynamic tag management deployment, or manually using your own code).