Google Publisher Tag samples
Stay organized with collections
Save and categorize content based on your preferences.
This section contains a collection of examples and related resources for the
Google Publisher Tag (GPT) library.
Much of the content in this section can also be found in our
GitHub repository. Sample code and associated documentation is
released as open source under the Apache License 2.0.
Beginner
Advanced
JavaScript
TypeScript
Events
Multiple ads
Offerwall
Performance
Privacy
Privacy & Messaging
Shadow DOM
Targeting
Web Components
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],[],[],["The provided content details resources for the Google Publisher Tag (GPT) library, offering examples and sample code. This code, along with documentation, is available open-source under the Apache License 2.0 in a GitHub repository. Users can also build custom samples using the GPT sample builder (beta). Resources cover diverse topics, including JavaScript, TypeScript, events, multiple ads, performance, privacy, targeting, shadow DOM, and web components.\n"]]