Hi,

thanks for the quick answer. Indeed, you are right, but unfortunately, we 
are still facing the same problem. However, as I understand, there is one 
thing we can change with Ads, and that is their Status. The problem is that 
our code, which looks like the following:

function UploadSettings(AdWordsServices $adWordsServices, AdWordsSession 
$session, $expAdTextAds) {
     try {
        $batchJobService = $adWordsServices->get($
session, BatchJobService::class);
        // Create a BatchJob.
        $addOp = new BatchJobOperation();
        $addOp->setOperator(Operator::SET);
        $addOp->setOperand(new BatchJob());
        $result = $batchJobService->mutate([$addOp]); //<== THIS IS WHERE 
THE CODE DIES
        $batchJob = $result->getValue()[0];
        // Get the upload URL from the new job.
        $uploadUrl = $batchJob->getUploadUrl()->getUrl();
        printf("Created BatchJob with ID %d, status '%s' and upload URL 
'%s'.<br>",
            $batchJob->getId(), $batchJob->getStatus(), $uploadUrl);
        // Use BatchJobs to upload all operations.
        $batchJobs = new BatchJobs($session);
        
        // Generate and upload the first set of operations.
        $adGroupCriterionOperations = updateTextAdsCriterionOperations(
$expAdTextAds); //<== THIS IS WHERE THE OPERATIONS WOULD BE ADDED. THE CODE 
NEVER EVEN MAKES IT TO THIS POINT.
        $batchJobUploadStatus = $batchJobs->
uploadIncrementalBatchJobOperations(
            $adGroupCriterionOperations,
            new BatchJobUploadStatus($uploadUrl, $session)
        );
        printf("Uploaded %d operations for batch job with ID %d.<br>",
            count($adGroupCriterionOperations), $batchJob->getId());
        
        $batchJobs->closeIncrementalUpload($batchJobUploadStatus);
        // Poll for completion of the batch job using an exponential back 
off. 
    }


dies at the $result line. Please see my post-line comments - the code never 
even gets to the point where it would receive the specific operations. Now, 
I know that the operation here is 'SET' and not 'REMOVE', but it would suit 
us a lot better if we did not remove the old Ad, just set it to paused, and 
create a new one to replace it.
Also and most importantly, we are facing the same issue not just with 
Expanded Text Ads, but also with Ad Groups - if we try to modify their 
status with BatchJobs, the code dies off this exact same way. Due to this, 
we are now forced to use simple mutate operations, but we really want to 
replace them with proper BatchJobs to save some on our call count.

So to sum things up, can you point us in the right direction as to why the 
code above is dying on us, even for Ad Group status updates, or Expanded 
Text Ad status updates as well?

Thanks,
Balazs


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e1192dd5-9e36-44f7-bf58-0ce7c5c8875a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • BatchJob... Prototype.co
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
      • ... Prototype.co
        • ... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
          • ... Prototype.co
            • ... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum

Reply via email to