Insideall / dfp-prebid-lineitems

A PHP script to setup and update your Prebid Line Items in DFP
19 stars 11 forks source link

Duplicate Key Values #1

Closed chratcliff closed 6 years ago

chratcliff commented 6 years ago

If you already have key values on existing line items but need to set this up with the same SSP, there's evidently no choice but to make an entirely new set of keys or rename the SSP.

I'd like to get one set of key values for my entire account then reference those in future implementations. My current provider uses hb_pb only as opposed to hb_pb_ssp - so i already have that portion, just need them attached to new line items for various sites. I did figure out how to remove the _SSP portion myself.

I have fumbled around a lot, but can't get it to just accept the existing keys though it appears to check for their existence. If there was some line I could comment out to stop it from throwing this error, that'd help a lot.

When the error hits you get a couple thousand lines of XML that reference all the key values, based on the granularity you chose, which ends with this:

PHP Fatal error: Uncaught Google\AdsApi\Dfp\v201802\ApiException: [CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.01', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.02', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.03', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.04', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.10', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.25', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.50', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'0.75', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'1.10', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'1.21', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'1.32', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'1.43', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'1.55', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; trigger:'1.66', CustomTargetingError.VALUE_NAME_DUPLICATE @ name; in D:\Website\dfp-prebid-lineitems-master\dfp-prebid-lineitems-master\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\Util\Reflection.php on line 43

gchicoye commented 6 years ago

Hi,

It's indeed really strange as the script checks wether Key and Values already exist before creating / updating them. I've commited a new version including support for line Items creation without SSP. Please have a lot on it and revert to me if you still have issues.