(Translated by https://www.hiragana.jp/)
Google Ads Developer Blog: gpt

Since 2020, we've asked the Google Publisher Tag (GPT) developer community to provide their valuable feedback through an annual survey. This feedback influences what we work on each year, and has directly inspired work on resources and tools like the official GPT type definitions, GPT sample builder, and more.

Since 2020, we've asked the Google Publisher Tag (GPT) developer community to provide their valuable feedback through an annual survey. This feedback influences what we work on each year, and has directly inspired work on resources and tools like the official GPT type definitions, GPT sample builder, and more.

As we look forward to another year, it's time once again to check in with our developer community to see what's working well and what can be improved. Starting today, we're kicking off the 2024 GPT developer survey.

Take the survey

The survey should take no more than 10 minutes to complete, and it will be open through the end of June 2024. Most questions are optional and your answers are anonymous.

Remember that the feedback you provide influences what we work on over the course of the next year, so please let us know what matters most to you. Thanks in advance for taking the time to help improve the GPT developer experience!

Today we're happy to announce the release of official TypeScript type definitions for Google Publisher Tags (GPT)!

Why TypeScript?

According to a recent State of JS developer survey, nearly 70% of developers regularly use TypeScript in some capacity, up from 60% the year before. As this segment of the community continues to grow, we are committed to providing the best experience possible for those working with TypeScript and GPT. We believe this is important not just because TypeScript is popular, but because it helps developers validate the correctness of their code and provides a number of quality of life improvements that make working with GPT more delightful.

How we got here

Until now, a number of community-led projects such as @types/doubleclick-gpt and @types/googletag have provided unofficial GPT type definitions. While these projects have done a great job of making our API more accessible to TypeScript developers, manually curated type definitions inevitably lag behind changes made to GPT, leading to those definitions sometimes being out of date. To address this, we've updated our release process to automatically generate type definitions from internal source code and sync changes to our own GitHub repository and the DefinitelyTyped project. This ensures that our official definitions are always up to date with the most recently released versions of GPT.

Try it and let us know what you think

For users new to TypeScript, we've published a TypeScript and Google Publisher Tags guide that covers the basics and provides a demo of the new type definitions in action. For those already familiar who want to try the new definitions right away, they can be installed via NPM by running:

npm install --save-dev @types/google-publisher-tag

If you'd like to make a suggestion, report a bug, or leave any other feedback about this new offering, feel free to open an issue on our GitHub issue tracker.

Since 2020, we've asked the Google Publisher Tag (GPT) developer community to provide their valuable feedback through an annual survey. This feedback influences what we work on each year, and has directly inspired improvements to our sample offerings, release notes, and much more.

Since 2020, we've asked the Google Publisher Tag (GPT) developer community to provide their valuable feedback through an annual survey. This feedback influences what we work on each year, and has directly inspired improvements to our sample offerings, release notes, and much more.

As we look forward to next year, it's time once again to check in with our developer community to see what's working well and what can be improved. Starting today, we're kicking off the 2022 GPT developer survey.

Take the survey

The survey should take no more than 10 minutes to complete, and it will be open through the end of October 2022. Most questions are optional and your answers are completely anonymous.

Remember that the feedback you provide influences what we work on over the course of the next year, so please let us know what matters most to you. Thanks in advance for taking the time to help improve the GPT developer experience!

In 2020, we launched the first ever Google Publisher Tag (GPT) developer survey to learn more about our community and understand how we can improve the developer experience. Feedback from users like you directly inspired improvements to our sample offerings, release notes, and much more over the course of the past year.
In 2020, we launched the first ever Google Publisher Tag (GPT) developer survey to learn more about our community and understand how we can improve the developer experience. Feedback from users like you directly inspired improvements to our sample offerings, release notes, and much more over the course of the past year.

As we look forward to a new year, it's time once again to check in with our developer community to see what's working well and what can be improved. Starting today, we're kicking off the 2021 GPT developer survey.



The survey should take no more than 10 minutes to complete, and it will be open through the end of October 2021. Most questions are optional and your answers are completely anonymous.

Remember that the feedback you provide influences what we work on over the course of the next year, so please let us know what matters most to you. Thanks in advance for taking the time to help improve the GPT developer experience!

The Google Publisher Tag (GPT) now supports integrating with a Content-Security-Policy (CSP). Using a CSP, you can precisely control which external sources are allowed to load on your site, on a page-by-page basis. In this way, CSPs help to detect and defend against common web vulnerabilities such as cross site scripting (XSS) attacks.

Although CSPs can be implemented in a number of ways, GPT only supports the strict CSP method, using nonces. For detailed instructions on setting this up, see our guide on Integrating with a Content Security Policy.

A note on existing CSPs

While GPT did not previously support CSPs, we're aware that some publishers worked around this by using CSPs based on an allowlist of domains. As previously mentioned, however, only nonce-based strict CSP implementations are supported. This is due to the fact that the set of domains GPT accesses is subject to change over time.

If you've been using GPT with an allowlist-based CSP, we strongly recommend that you supplement or replace it with a nonce-based strict CSP policy. This will reduce the risk that a future change to GPT may break ad serving on your page.

We’re constantly working to improve our offerings for Google Publisher Tag (GPT) developers. Whether it's writing guides, producing samples, or building tools like the Google Publisher Console and Publisher Ads Audits for Lighthouse, we strive to equip you with everything you need to succeed.
We’re constantly working to improve our offerings for Google Publisher Tag (GPT) developers. Whether it's writing guides, producing samples, or building tools like the Google Publisher Console and Publisher Ads Audits for Lighthouse, we strive to equip you with everything you need to succeed.

To better understand what's working and what needs improvement, we're asking our developer community for feedback. Starting today, we're launching the first Google Publisher Tag developer survey.

Take the survey


All questions in the survey are optional and your answers will be completely anonymous. We expect the survey to take about 10 minutes to complete, and it will be open through the end of September 2020.

The feedback you provide will directly impact what we work on over the course of the next year, so please let us know what matters most to you. Thanks in advance for taking the time to help improve the GPT developer experience.