You are currently viewing Native Ad for DoubleClick for Publishers

Native Ad for DoubleClick for Publishers

One of our clients asked if we could create a Native Ad for DoubleClick for Publishers template for them.

Native Ads for Apps in DoubleClick
Picture from DFP

Now DFP (Double Click for Publishers) was working on a solution but the ETA was unknown. To give you and idea what it is, you can take a look at the DFP article.

We looked at our clients requirements and I started working on the creative. I had to create something that I could manipulate the dom once the ad tag has rendered on the page. I also had to make sure that this creative can be seen under user defined templates in the creative library and that the client will be able to make custom edits to each new ad.

I first had to detect a few things,  the width of the parent node in which this native ad will be rendering and while doing this I also needed to find the parent node class name so that I could apply additional styling to it, for example width and height which is being set in DFP. I pass all the DFP related values via DFP macros into my code.

You will also notice in my code that I am setting the height of the banner ad as the content resizes smaller, making sure that the content will still fit.

If you are not sure how DFP works and DFP tagging, please let me know, I will assist you with the setup.

You can download my code on github.

Eric de Kock

I’m Eric de Kock, I was born in South Africa and lived in 3 provinces, Free-State, Gauteng (Johannesburg) and Western Cape. I worked for Advertising agencies like (Red Cherry Advertising and Saatchi & Saatchi AtPlay), publisher ( and Marketing agency (Acceleration). I recently moved to Adelaide in South Australia. It’s a very beautiful and friendly city. It’s very similar to Cape Town I must say. I love to create websites, I love design, I have a passion for coding and I enjoy seeing the results from my creations.

Leave a Reply