Need ability to inject js inside googletag.cmd.push function

Created on 4 May 2017, about 8 years ago
Updated 20 July 2025, 8 days ago

I need the ablility to inject some JS just before the first service tags inside of the googletag.cmd.push(function()
Just after line 689 in dfp.module.

I need this because I am trying to integrate BlueConic with DFP. They need the ability to set key|value targets on any DFP ad tags.

Here is the code I will need to inject

// BlueConic targeting parameters
  if (typeof Storage !== "undefined") {
    var targetingParamStr = localStorage.getItem("bcDFPTargetingParams");
    if (targetingParamStr) {
      var targetingParameters = JSON.parse(targetingParamStr);
      // set page-level targeting parameters
      jQuery.each(targetingParameters, function (index, param) {
        window.googletag.pubads().setTargeting(param.key, param.value);
      });
    }
  }
✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States gmaka

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