And I think I almost had it, but then I got this error which I can't solve:
Error: Unmarshalling Error: cvc-elt.4.3: Type 'ns1:UploadConversion' is
not validly derived from the type definition, 'string', of element
'ns1:operator'.
Now I've checked a bit of the library code and the operator is the object per se. Its like its complaining because its not a string? I've already checked and have a stable connection with the API,
already did some calls to it with success. I've tried adding more fields to the upload conversion object, that also did not work. I tried mutateLabel which I saw somewhere, but its not a function
that exists in adwords services class. Any ideas what I'm doing wrong? Thanks in advance!
Code:
$this->adWordsServices = new AdWordsServices();
$this->oAuth2Credential = (new OAuth2TokenBuilder())->fromFile(getcwd() . '/adsapi_php.ini')->build();
$this->session = (new AdWordsSessionBuilder())->fromFile()->withOAuth2Credential($this->oAuth2Credential)->build();
$conversionTrackerService = $this->adWordsServices->get($this->session, ConversionTrackerService::class);
//LOAD CONVERSION TYPE DATA
$uploadConversion = new UploadConversion();
$uploadConversion->setName($nombreTipoDeConversion);
$uploadConversion->setCategory("DEFAULT");
$uploadConversion->setCtcLookbackWindow(90);
$uploadConversion->setViewthroughLookbackWindow(30);
//ORIGINAL CODE DID NOT INCLUDE THESE LINES IN HOPES OF SOLVING THE ERROR WITH NO AVAIL
$uploadConversion->setConversionTrackerType("AdWordsConversionTracker");
$uploadConversion->setCountingType("ONE_PER_CLICK");
$uploadConversion->setAttributionModelType("U_SHAPED");
$uploadConversion->setExcludeFromBidding(false);
$uploadConversion->setAlwaysUseDefaultRevenueValue(true);
$uploadConversion->setDefaultRevenueCurrencyCode("USD");
$uploadConversion->setDefaultRevenueValue(0.0);
$uploadConversion->setStatus("ENABLED");
//SEND CONVERSION
$operations = array(new ConversionTrackerOperation($uploadConversion, "ADD"));
$result = $conversionTrackerService->mutate($operations);