how can i get which age range i am getting this response?

31 views
Skip to first unread message

Binu Mathew

unread,
Mar 27, 2023, 6:00:33 AM3/27/23
to Google Ads API and AdWords API Forum
How to get age range from
SELECT metrics.clicks,ad_group_criterion.age_range.type,metrics.conversions, metrics.cost_micros FROM age_range_view WHERE campaign.id = XXXXX

Now I am getting

{
"clicks": 0,
"cost": 0,
"conversions": 0,
"ageType": {}
},
{
"clicks": 0,
"cost": 0,
"conversions": 0,
"ageType": {}
},

Like to know how can i get which age range i am getting this response  in PHP?
Any.guide for that?

Here is my code

foreach ($stream->iterateAllElements() as $googleAdsRow) {
$newCompete = new \StdClass();
$newCompete->clicks = $googleAdsRow->getMetrics()->getClicks();
$newCompete->cost =$googleAdsRow->getMetrics()->getCostMicros() / 1000000;
$newCompete->conversions = $googleAdsRow->getMetrics()->getConversions();
$newCompete->ageType = $googleAdsRow->getAdGroupCriterion()->getAgeRange();
array_push($sample, $newCompete);
}

Google Ads API Forum Advisor

unread,
Mar 27, 2023, 9:35:51 AM3/27/23
to binumat...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for raising this concern to the Google Ads API support team.

Regarding your concern,, please note that Google Ads API mirrors the Google Ads UI. Meaning, whatever the Google Ads UI is showing, the Google Ads API should pull it. That said, can you provide the complete request and response logs with the request ID and request header generated on your end and uncropped Google Ads UI screenshot showing the data that you want to get via the Google Ads API so that our team can better investigate and provide the accurate recommendations to you?

Note that these logs can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. You may check here (PHP) and click your client library for the specific guideline to enable it.

You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2kBrmR:ref
Reply all
Reply to author
Forward
0 new messages