Jump to content

Mike1020

New Members
  • Posts

    5
  • Joined

  • Last visited

Mike1020's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you so much, I was completely stuck. You saved me hours or more... Finished code: $cHTML = curl_exec($ch); $response = json_decode($cHTML, true); echo "<br>CAMPAIGNS FOUND<hr><br>"; foreach($response[0]['results'] as $value){ echo $value['campaign']['name']; echo "<br />"; }
  2. A little more clarification. The JSON response is returned from CURL: $cHTML = curl_exec($ch); $response = json_decode($cHTML, true); // Incorrect code, not returning values, but this is what I have so far foreach($response as $value){ $campaignName = $value['results'][0]['campaign'][0]['name']; echo "Campaign Name: $campaignName<br />"; }
  3. Hi, I am getting JSON returned from a Google Ads API, and cannot seem to access the values. Trying to get the name of a campaign (Campaign #1-3). Tried using foreach loops mostly. Cannot figure this out. Any help would be greatly appreciated! This is a sample response. Array ( [0] => Array ( [results] => Array ( [0] => Array ( [campaign] => Array ( [resourceName] => customers/12345/campaigns/12345 [name] => Campaign #1 ) ) [1] => Array ( [campaign] => Array ( [resourceName] => customers/12345/campaigns/12345 [name] => Campaign #2 ) ) [2] => Array ( [campaign] => Array ( [resourceName] => customers/12345/campaigns/12345 [name] => Campaign #3 ) ) ) [fieldMask] => campaign.name [requestId] => er35tdgfjCWU-ddhaQ ) )
  4. Thank you for your help! Working result is: 'Time' => [ 'CustomDateRangeStart' => ['Day' => $startDay,'Month' => $startMonth,'Year' => $startYear], 'CustomDateRangeEnd' => ['Day' => $endDay,'Month' => $endMonth,'Year' => $endYear] ],
  5. Hi, I am attempting to download a report from Bing Ads, and am having issues with the level of nesting on the SOAP request for the date, (specifically 'Time' = >....) Definitely appreciate the help! SOAP elements can be found at https://docs.microsoft.com/en-us/advertising/reporting-service/date?view=bingads-13 for date and https://docs.microsoft.com/en-us/advertising/reporting-service/reporttime?view=bingads-13 using CustomDateRangeStart and CustomDateRangeEnd $request = [ 'ReportRequest' => new SoapVar( [ 'Format' => 'Csv', 'ReportName' => 'Bing Keyword Performance Report', 'ReturnOnlyCompleteData' => false, 'Aggregation' => 'Daily', 'Sort' => ['SortColumn' => 'Clicks'], 'Sort' => ['SortOrder' => 'Ascending'], 'Scope' => [['AccountIds' => [...]], ['CampaignId' => null], ['AdGroupId' => [...]]], 'Time' => ['CustomDateRangeStart' => ['Date' => ['Day' => $startDay],['Month' => $startMonth],['Year' => $startYear]]], 'Time' => ['CustomDateRangeEnd' => ['Date' => ['Day' => $endDay],['Month' => $endMonth],['Year' => $endYear]]], 'Filter' => ['BidMatchType' => [$mt]], 'Keywords' => array($criteriaValue), 'Columns' => [ "TimePeriod", "Spend", "Clicks", "CurrentMaxCpc", "Impressions", "AverageCpc", "TopVsOther", "QualityScore", "CampaignStatus", "AdGroupStatus", "BidMatchType", "AdGroupName" ] ], SOAP_ENC_OBJECT, 'KeywordPerformanceReportRequest', "https://bingads.microsoft.com/Reporting/v13" )];
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.