DIV Ad Provider Implementation
11 min
overview a new ad provider called "div" has been added to the purple web platform this allows ökotest and other partners to display advertisements using a simple html div element approach while maintaining consistency with the existing ad system implementation details core functionality simple div container the div ad provider creates a basic html \<div> element on the webpage this div serves as a container where ad scripts can inject their content flexible attributes publishers can configure custom attributes for the div element through the admin interface these attributes (like id , class , data attributes) are automatically applied to the div when it renders on the page this flexibility allows ad providers like ökotest to use their existing scripts that expect specific div attributes consistent integration the div provider follows the same patterns as other ad providers (gpt, html, traffective, etc ) it uses the same configuration system and loads through the same ad component no special angular hydration is performed the div behaves like a standard html element benefits for publishers simplicity easy to set up without complex configuration compatibility works with existing third party ad scripts that expect basic div containers flexibility can set any html attributes needed by the ad provider consistency uses the same admin interface and processes as other ad types for developers maintains existing ad container patterns no additional complexity in the codebase follows established configuration models usage example configuration in the purple manager, publishers can configure a div ad unit with type div attributes custom key value pairs for html attributes example configuration { "type" "div", "attributes" { "id" "oeko ad slot", "class" "ad container", "data zone" "123", "data size" "300x250" } } rendered output use case ökotest integration for ökotest, this implementation enables configuration set up div ad units in purple manager attribute setup define required attributes like id="oeko ad slot" or data zone="123" script integration their custom javascript finds the div and injects ad content seamless display ads display within the purple web layout without conflicts technical implementation files modified ad component html added div case in switch statement ad component ts added div provider handling and initialization ad module ts imported dynamicattributesmodule ad config model ts added div provider enum and divadconfig interface dynamic attributes directive ts exported dynamicattributes type key features uses existing dynamicattributesmodule for attribute binding follows the same initialization pattern as other ad providers integrates seamlessly with the current ad loading system no additional dependencies or complex setup required