Mixed Inline and header defined ad units

I thought I would share my experience of trying to implement both the header definition style alongside the inline definition style, so that I could allow editorial staff to choose whether or not to place adverts in the body of an article.

My logic behind trying to use both styles was, I knew what adverts were placed around the website, background, leaderboard etc and could easily define these, but I couldn't control if editors wanted to place ads in the body copy, some longer article may include 2 or 3 ad slots, short article may include none, I wanted to give that option. So I created the wysiwyg filter to allow them to click a button and insert the ad code that I could filter later and replace with what was needed and thought that using the inline ad unit definition style would be perfect as it would mean I could define it as it was placed, no need to search the body of the article to see if ad definitions were needed as the header was being created.

It didn't work.

All the ads would load except for the inline ads, these would load after a page refresh, but not before. I think it may have been due to the enableSingleRequest() function in the header script, which would have triggered in the header using the definitions above it, but not picked up the inline ads that were defined later in the dom, either that or the fact that the inline defined ads were not in the original googletag.cmd.push() function and so not included in the single request.

On page refresh all ads on the page displayed which I suspect was the inline ads from the previous call added to the header defined ads of the refreshed page.

Switching off the single request was not possible as the guaranteed roadblock functionality is lost if the requests are not made all at once.

I thought about removing the googletag.enableServices(); function and placing it in the footer of the page, which may have meant the ad request would be made with all possible ad slots defined, but never really explored that option to test out the theory.

The solution I went for in the end, was introducing a rule for the editors of no more than one advert per article. I am defining an ad unit in the header for these inline ads regardless of whether they are utilised or not.

I don't think its an ideal solution, but using the 2 styles of ad definition is not an option either, any other solutions would be gratefully explored.

Comments

I was curious if you ever thought of changing the structure
of your site? Its very well written; I love what youve got to say.
But maybe you could a little more in the way of
content so people could connect with it better. Youve got
an awful lot of text for only having 1 or two pictures.
Maybe you could space it out better?

Add new comment