googleads / google-publisher-tag-samples

Google Publisher Tag (GPT) code samples.
https://developers.google.com/publisher-tag/samples
Apache License 2.0
38 stars 22 forks source link

Attach an EventListener for when a GPT slot is defined (created) or destroyed #78

Closed BerendKemper closed 12 months ago

BerendKemper commented 12 months ago

Is your feature request related to a problem? Please describe. As a developer at Massarius, we monetize invenotry from publishers. Some publishers have desires to manage and maintain their own GPT slots. The result is that we create a fallback mechanism to fill in unsold inventory. Some publishers have peculiar procedures of defining GPT slots. Some are created lazy-loaded. Others are created with a single Google Ad Manager AdUnit and use key value targeting in order to specify which ad inventory is meant to serve. A key feature i am missing from googletag is an EventListener for when the publisher defines their GPT slots and when they destroy them. As we are monetizing their unsold GPT slos we are creating variables and store all kinds of information. Some publishers have infinite scroll article pages, some publishers have single page applications. An EventListsner to attach when the publisher had destoryed their GPT slot comes in very handly in order to clean up our own stored data. I'd like to prevent memory leaks as much as possible and clean up data.

Describe the solution you'd like Can you please create a feature in googletag to attach an EventListener to the pubads service that triggers when a slot is defined and destroyed. Something like the following (adjusted to your standards naming conventions):

Describe alternatives you've considered The alternative is to override googletag.defineSlot and make it act like an EventListener. Although i did try this out already and it caused major lagging issues, so it's not an alternative.

Additional context

jimper commented 12 months ago

Hi @BerendKemper, thanks for the feedback! Unfortunately this isn't the right support channel for product feature requests. While I will pass your request along to the team, I won't be able to provide any updates here.

If you have an Ad Manager support contact, I recommend reaching out to them about this as well. They will be best equipped to handle this sort of request and keep you updated as things progress.