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

CustomTargetingError.KEY_NOT_FOUND @ name; trigger:'hb_bidder' #76

Closed
vegagame opened this issue Jul 10, 2019 · 6 comments
Closed

CustomTargetingError.KEY_NOT_FOUND @ name; trigger:'hb_bidder' #76

vegagame opened this issue Jul 10, 2019 · 6 comments

Comments

@vegagame
Copy link

File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 355, in
main()
File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 352, in main
setup_partner(user_email, advertiser_name, order_name, placements, ad_units, sizes, bidder_code, prices, num_creatives, currency_code)
File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 90, in setup_partner
HBPBValueGetter)
File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 185, in create_line_item_configs
hb_bidder_value_id = HBBidderValueGetter.get_value_id(bidder_code)
File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 146, in get_value_id
val_id = self._create_value_and_return_id(value_name)
File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 133, in _create_value_and_return_id
self.key_id)
File "dfp/create_custom_targeting.py", line 77, in create_targeting_value
values_config)
File "/home/vagrant/.local/lib/python2.7/site-packages/googleads/common.py", line 1396, in MakeSoapRequest
e.detail, errors=error_list, message=e.message)
googleads.errors.GoogleAdsServerFault: [CustomTargetingError.KEY_NOT_FOUND @ name; trigger:'hb_bidder']### ###

In my case I use "smartadserver" -> http://prebid.org/dev-docs/bidders.html#smartyads

My config

# A string describing the order
DFP_ORDER_NAME = 'prebid_smartadserver_test_3'

# The email of the DFP user who will be the trafficker for
# the created order
DFP_USER_EMAIL_ADDRESS = '[email protected]'

# The exact name of the DFP advertiser for the created order
DFP_ADVERTISER_NAME = 'Smart'

# Names of placements the line items should target.
DFP_TARGETED_PLACEMENT_NAMES = ['hb_placements']

# Names of ad units the line items should target.
DFP_TARGETED_AD_UNIT_NAMES = []

#########################################################################
# PREBID SETTINGS
#########################################################################

PREBID_BIDDER_CODE = 'smartadserver'
HB_PRICE_BUCKET = 'hb_pb_smartadserver'
HB_BIDDERCODE = 'hb_adid_smartadserve'

@kmjennison
Copy link
Owner

Looks like the hb_bidder custom targeting key doesn't exist for some reason. The script should create an hb_bidder key if one doesn't exist. Could you try running dfp.get_custom_targeting to see what it fetches for the hb_bidder key name?

@vegagame
Copy link
Author

These are all logs:

root@ubuntu-xenial:/var/www/html/vhosts/dfp-prebid-setup# python -m tasks.add_new_prebid_partner


    Going to create 2001 new line items.
      Order: prebid_smartadserver_test_3
      Advertiser: Smart

    Line items will have targeting:
      hb_pb = 0.00, 0.01, 0.02, ... 19.98, 19.99, 20.00
      hb_bidder = Smart
      placements = ['hb_placements']
      ad units = []


Is this correct? (y/n)
y
Found user with the given email address.
Found placement with name "hb_placements".
Using existing advertiser with name "Smart" and type "AD_NETWORK".
Found an order with name "prebid_smartadserver_test_3".
Using existing order with name "prebid_smartadserver_test_3".
Created creative with name "Smart: HB prebid_smartadserver_test_3, #1".
Key "hb_bidder" exists and has 1 existing values.
Key "hb_pb" exists and has 5 existing values.
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 355, in <module>
    main()
  File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 352, in main
    setup_partner(user_email, advertiser_name, order_name, placements, ad_units, sizes, bidder_code, prices, num_creatives, currency_code)
  File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 90, in setup_partner
    HBPBValueGetter)
  File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 185, in create_line_item_configs
    hb_bidder_value_id = HBBidderValueGetter.get_value_id(bidder_code)
  File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 146, in get_value_id
    val_id = self._create_value_and_return_id(value_name)
  File "/var/www/html/vhosts/dfp-prebid-setup/tasks/add_new_prebid_partner.py", line 133, in _create_value_and_return_id
    self.key_id)
  File "dfp/create_custom_targeting.py", line 77, in create_targeting_value
    values_config)
  File "/home/vagrant/.local/lib/python2.7/site-packages/googleads/common.py", line 1396, in MakeSoapRequest
    e.detail, errors=error_list, message=e.message)
googleads.errors.GoogleAdsServerFault: [CustomTargetingError.KEY_NOT_FOUND @ name; trigger:'hb_bidder']
root@ubuntu-xenial:/var/www/html/vhosts/dfp-prebid-setup#

dfp.get_custom_targeting return a emply line:

root@ubuntu-xenial:/var/www/html/vhosts/dfp-prebid-setup# python -m dfp.get_custom_targeting
root@ubuntu-xenial:/var/www/html/vhosts/dfp-prebid-setup#

@kmjennison
Copy link
Owner

Interesting. It finds one value for an existing hb_bidder before throwing the error when trying to create it. I'm wondering if the key exists but is in some unusable state (e.g. deleted or inactive), like in #31 .

In the GAM console, do you see the hb_bidder key listed under "Inventory > Key-values"?

@vegagame
Copy link
Author

vegagame commented Jul 12, 2019

No, you can see key -> values here: http://79.143.185.8/kw.png

@kmjennison
Copy link
Owner

OK. If you can, I recommend playing with the GAM CustomTargetingService to see if you can figure out why the hb_bidder key exists but isn't available to use. I unfortunately don't have time to help investigate this specific case, but if you can reproduce a bug, please let me know.

@kmjennison
Copy link
Owner

Closing until we have a clear way to reproduce. Feel free to comment with updates/questions on this.

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

2 participants