Open Austinb opened 5 years ago
Interesting. I haven't experienced this myself yet. How many prices are you creating when this happens? Curious if it's related to the total number or if it's just an occasional network issue.
Sorry for the delayed response. We usually run batches of 400 pricing targets as part of a larger insert of orders into a GAM account. This is $0.10 to $40.00 in $0.10 increments. Unfortunately I do not think there is a way to batch insert these into GAM via api as far as I can tell. It only happens once but this part is where the GAM api is having issues or throttling or something. I tried different wait times but it seems to be random and not affect by the speed of the requests all the time.
So I think this is more of an issue with changes to GAM's API side and them wanting you to batch insert as much as possible. The code currently does each item one at a time when sending them to the createCustomTargetingValues instead of batch inserting values. Changing this behavior would require a rewrite to the code since everything is done as it is iterated over. My suggestion is most things should be converted to batch inserts where possible. It is done currently in other places such as the line item associations.
Thanks for the info. Yeah, it would be better to pass an array of values to create_targeting_value
in create_custom_targeting.py
. This would require changes to the DFPValueIdGetter in add_new_prebid_partner.py
.
I have noticed since the new api came out more issues with random connection issues with the DFP API when creating all of the price targeting values. I added a
time.sleep()
setting line 255 of add_new_prebid_partner.py but the issue seems to still happen randomly regardless of the sleep value used. I usually get an error related to the connection not responding from the API's side. I set the sleep to 0.1 without issues then that has issues. I bumped it to 0.5 and sometimes that has issues. I did 1.0 and had issues.Has anyone else noticed any similar issues when creating the price targets? I have not seen any issues when creating the associations or any of the other calls. It seems like maybe the API has changed the requests per second or maybe the API is just having issues.
Usual error: