Created on 3 February 2015, over 10 years ago
Updated 20 July 2025, 8 days ago

Hey folks, I've hacked together some code, a js plugin actually, that allows you to inject an ad from the client-side.

For example, if you have a page with infinite scroll and you periodically want to inject an ad you have to somehow duplicate the configuration of an existing ad on the page or preload a bazillion individual ads so that you can display them at will.

With my nifty code, in order to insert an ad all you have to do is

$('.ad-bar').adinjector('homepage_leaderboard');

the argument is the unique id for the add settings in the dfp module configurations page.

The ajax returns the code which is normally injected into the head, evaluates the code and voila, your ad appears.

Is anyone interested in making this a part of the DFP module api? Helping me to get this built in the standard Drupal way? Reviewing my code?

Thanks,

Phil

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States philpro

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024