|
||||||
|
||||||
Hi Support,
Noticed that there I google ads query builders, how can I extract my ads data by using the SQL query?
For example, I would like to extract the campaign column and cost column from my ads account. For the UI interface, when I select two dates, it will combine the cost together.
Thanks.
Regards,
Jeffrey
Hi,
I know how to query actually, just not sure where can I query, can you give me the link to query and extract data?
Thanks.
From: Google Ads API Forum Advisor
Sent: Friday, 23 September, 2022 5:20 PM
To: jeffre...@carsome.com
Cc: adwor...@googlegroups.com
Hi Jeffrey,
Thank you for the reply.
Suppose you have GAQL, and looking to get the data for said GAQL. To issue this request, pass the GAQL to the GoogleAdsService.SearchStream interface.
If you are using REST, then you may use below cURL to get the data
Here is a complete example of the report definition above, enclosed in an HTTP POST request.
POST /v11/customers/{customer_id}/googleAds:searchStream HTTP/1.1
Host: googleads.googleapis.com
User-Agent: curl
Content-Type: application/json
Accept: application/json
Authorization: Bearer [Enter OAuth 2.0 access token here]
developer-token: [Enter developerToken here]
Parameters:
{
"query" : "SELECT campaign.name, campaign.status, segments.device,
metrics.impressions, metrics.clicks, metrics.ctr,
metrics.average_cpc, metrics.cost_micros
FROM campaign
WHERE segments.date DURING LAST_30_DAYS"
}
If you're looking to run the reports using the client library, then you may use your GAQL with this code example.
Let us know if this helps.
Best regards,
|
||||||