This sequence would:
- Use a campaign that already exists with an ID of 12345678
- Add an ad group with temporary ID
-1for campaign 12345678
- Add an ad group ad for ad group
-1
- Add multiple ad group criteria (e.g., keywords) for ad group
-1
array (size=13)
0 =>
array (size=2)
0 =>
object(AdGroupOperation)[21]
public 'operand' =>
object(AdGroup)[11]
public 'id' => int -1
public 'campaignId' => int 12345678
public 'campaignName' => nullerrorType=BatchJobProcessingError, trigger=, errorString=BatchJobProcessingError.FILE_FORMAT_ERROR, fieldPath=, reason=FILE_FORMAT_ERROR
Hello Alan,In this line of your code, you're creating another layer of array, resulting in an array of array for ad group operations.Instead, it's supposed to be just one layer of all types of operations together, so you have to change:$operations = array($adGroupOperations);to$operations = array_merge(array(), $adGroupOperations);Or more simply, just $operations = $adGroupOperations;Hope this help.
Cheers,