Skip to content

Commit

Permalink
fix issue #337 - enable requesting to DFP even if prebid.js isn't loa…
Browse files Browse the repository at this point in the history
…ded yet.
  • Loading branch information
mkendall07 committed Apr 28, 2016
1 parent a85404f commit 1c409a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integrationExamples/gpt/pbjs_example_gpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
googletag.pubads().refresh();
});
pbjs.initAdserverSet = true;
}
Expand Down

1 comment on commit 1c409a3

@BartVB
Copy link
Contributor

@BartVB BartVB commented on 1c409a3 May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running setTargetingForGPTAsync() only makes sense if it's available right at this moment. Because of that I'm currently using:

    googletag.cmd.push(function() {
        console.log(timePassed() + ' Requesting DFP ads');
        if (typeof pbjs.setTargetingForGPTAsync === "function") {
            pbjs.setTargetingForGPTAsync();
        }
        googletag.pubads().refresh();
    });

Please sign in to comment.