Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting not reset for GPT and custom divs #5131

Closed
FilipStamenkovic opened this issue Apr 16, 2020 · 2 comments
Closed

Targeting not reset for GPT and custom divs #5131

FilipStamenkovic opened this issue Apr 16, 2020 · 2 comments
Assignees

Comments

@FilipStamenkovic
Copy link
Contributor

Type of issue

bug

Description

To reset targeting for particular slot/adunit combination, following code is executed:

if (unit.code === slot.getAdUnitPath() ||
    unit.code === slot.getSlotElementId()) {
  slot.setTargeting(key, null);

AdUnit code is compared with slot path and div id. But, if user is using custom divs and customSlotMatching function for setTargetingForGPTAsync, that custom matching function would be ignored and slots on custom divs won't be reset. This is problematic in case where user is refreshing the same slot, in first refresh targeting would be set, but for second refresh if there is no HB bid, targeting won't be set nor reset. So, gampad request to DFP will contain 'old' targeting, which will cause 'old' HB ad to be rendered (in case if DFP doesn't win).

Steps to reproduce

  • create GPT slot in custom div, by custom div it is meant div with id that is not the same as gpt adUnitPath nor as adUnit code used in prebid.
  • request HB bids from prebid (in this step you need to make sure to have only 1 HB bid)
  • call setTargetingForGPTAsync with provided customSlotMatching function to match your custom div
  • make DFP request
  • request HB bids from prebid for same adunits (in this step you need to make sure there is no HB bid)
  • call setTargetingForGPTAsync with provided customSlotMatching function for the same div and adunit as in one of the previous steps
  • notice that the same ad, with same adId is rendered (if DFP doesn't decide to win)

Test page

https://github.com/rtk-io/Prebid.js/blob/pbjs_gpt_custom_div/integrationExamples/gpt/hello_world.html

This test page will initially hold HB auction and send request to DFP and it will render demo ad.
To actually reproduce the bug, open debug mode, select 'Slow 3G' network and call window.refreshAdUnits(). Because of the Slow 3G', requests to HB bidders will timeout, so there won't be any HB bid, but gampad` request to DFP will contain 'old' targeting.

Expected results

I was expecting that, manually executed window.refreshAdUnits(), won't render any ad, since there was no HB bid, or I was expecting DFP ad.

Actual results

Same ad with same adId was rendered for the second time.

Platform details

Used configuration:

  • latest version of prebid, built from master branch on this day (16.04.2020.)
  • browser: Chromium 81
  • OS: Arch Linux
  • node version: 8.9.4

Other information

@stale
Copy link

stale bot commented Apr 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@FilipStamenkovic
Copy link
Contributor Author

This one is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant