I created a type safe npm package for Google Publisher Tag!
jquery - How to determine the ad rendered by google publisher tags - Stack Overflow
next.js - How to pre-load google ads with google publisher tag? - Stack Overflow
Will AD Exchange (AdX) tags continue to work after MCM migration? Or will Google Publisher Tag become the norm?
Adx Tags are not at all recommended by Google, So its better to switch to GPT tags.
And If you are working with tag based integration, Structure of MCM tags which contain Parent network Id and Child Network Id in code itself, ParentNetwordCode/ChildNetworkCode/Adunitname... I don't think Adx Tags will work with MCM.
More on reddit.comVideos
Hello!
In my most recent job we used google ad manager and google publisher tag to display ads on our site. We had been using react-dfp which is a great library, but recently ran into GDPR issues around configuring privacy settings for ads. As the library seems to no longer be maintained, I decided to re-write it, with a focus on:
Functional approach (with hooks) 🪝
Type safety with typescript 🎉
Ease of use with a debug mode 🛠️
Support for most recent GPT implementations 🚀
Comprehensive documentation (with live examples) 📖
I have published goopubtag with documentation here. While it is still at an early stage overall I am happy with the implementation to date. I would love to get feedback/for people to use and report any issues to help improve and catch any existing errors. I also have a future improvements section in the docs so there is plenty more to come.
They finally exposed a method to get this information: getSlotElementId
As you are likely aware you can listen for the slotRenderEnded event like the following:
googletag.pubads().addEventListener('slotRenderEnded', slotRendered);
Digging through the return event definition, I found the following with get you the DOM element Id where the ad is rendered:
function slotRendered(event) {
if (!event.isEmpty) {
console.log(event.slot.b.d);
}
}