In this article based on Third-Party JavaScript, authors Ben Vinegar and Anton Kovalyov discuss some real-world use cases of third-party scripts: embedded widgets, analytics and metrics gathering, and client API wrappers.

Three Ways to Use Third-Party JavaScript (PDF)