Closed eef closed 6 years ago
I'm happy to look into your issue. Can you tell me which version of the google-dfp-api gem you're using? I am using our latest gem (1.2.1), and I successfully updated a line item on our test account with the exact CustomCriteriaSet structure you're trying to make.
Also, if you could send me an expanded code snippet so that I can see how you're setting the custom_targeting and calling the API, I could further debug this for you. I assume you're setting the targeting like this: line_item[:targeting][:custom_targeting]
.
Hey - Thanks for the reply. I was able to get this working. I was dynamically generating a hash using Ruby and trying to send that. I hardcoded the targeting hash and sent that in the update instead it works. I am going to setup a test this weekend showing exactly what is happening. I had to use the hardcoded hash in the meantime due to project time limit. I will leave this open as I this problem also happens on other end points.
Glad to hear you got this working (though not in your preferred manner). From the library's perspective, it shouldn't matter how the hash is generated, as long as the structure is the same. Are you logging the generated hash that you're making? Can you send me that generated hash?
When I get access to my laptop this evening I will send across the original version that wouldnt work and then the code that I got working. I will provide a bit of context as well as example data being passed to the methods to generate the hash. The weirdest thing is...when took the generated hash and compared it to the hardcoded hash with generated_hash == hardcoded_hash
it would return true! I will update this issue tonight with the examples. I will also provide details of my environment just in case that makes a difference.
Hey, I was wondering if you were able to put together any more information on this issue. I made a request using the dynamically constructed hash from the target_custom_criteria.rb example, and it's working as expected. If we're going to keep this issue open, I'd like for it to be actionable on my end. Any help you can provide is much appreciated.
Hey. Apologies. I will close this just now. Once I get time I will update it with an example.
I am trying to recreate the following custom targeting setup via the API.
I have the following setup when creating my line items custom targeting:
When I assign this to the Line Item using the custom_targeting field I get the following error:
#<AdsCommon::Errors::UnexpectedParametersError: AdsCommon::Errors::UnexpectedParametersError: [:key_id, :value_ids, :operator]>
I tested a few things and discovered if I setup the targeting with only 1 CustomCriteriaSet, like so, it works:
Is it possible to create the custom targeting setup with multiple CustomCriteriaSets? Am I missing anything at all? I followed the examples from https://github.com/googleads/google-api-ads-ruby/blob/master/dfp_api/examples/v201802/line_item_service/target_custom_criteria.rb and also read through the reference https://developers.google.com/doubleclick-publishers/docs/reference/v201802/LineItemService.Targeting#customtargeting
Stumped!