GithubHelp home page GithubHelp logo

Comments (4)

mcountis avatar mcountis commented on June 20, 2024 1

Simple answer, no.

Although, binding to "gpt-slot_rendered" you can gain access to the iframes that are rendered as a result.

googletag.cmd.push(function () {
  googletag.on("gpt-slot_rendered", function (e, level, message, service, slot, reference) {
    var $slot = $('#' + slot.getSlotId().getDomId());
    var $adFrame = $slot.find("iframe:not([id*=hidden])");
    var adDoc = $adFrame.get(0).contentDocument;

    var $image_ad = $("body", adDoc).find('#google_image_div');

    if($image_ad.length == 0)
      return;

    var image_ad_href = $image_ad.find('a').map(function () { return this.href.match(/adurl=([^&"]+)/i)[1] }).get(0);
    var image_ad_src = $image_ad.find('img').map(function () { return this.src }).get(0);
    /*
    process image_ad_href or image_ad_src as you will
    */
  });
});

Here I've dug up image creatives. While there is no reference to the name of the line-item or creative that's entered in DFP, the click-url and image are available. I imagine something similar could be done for flash ads.

from dfp-events.

treeform avatar treeform commented on June 20, 2024

Thank you for the quick response! Thats very helpful, I all but gave up. Having an image is not as good as creative line-item name but its some thing. While for flash creatives I only get generic wrapper:

<!-- Copyright 2008 DoubleClick, a division of Google Inc. All rights reserved. -->
<!-- Code auto-generated on Mon Jun 24 11:13:50 EDT 2013 -->
<script src="http://s0.2mdn.net/879366/flashwrite_1_2.js"></script>

Do you think there is some thing similar that can be done to flash ads?

from dfp-events.

treeform avatar treeform commented on June 20, 2024

Correction, looks like if i wait for a second after getting the gpt-slot_rendered, the flash ad slot fills up with all kinds of useful info including the creative name. Thanks! I think i can use this.

from dfp-events.

ptim avatar ptim commented on June 20, 2024

for future googlers: https://developers.google.com/doubleclick-gpt/reference#googletagservice

from dfp-events.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.