GAQL date automation

34 views
Skip to first unread message

Chitranshu Mishra

unread,
Jan 6, 2022, 12:41:50 PM1/6/22
to AdWords API and Google Ads API Forum
Hi,

I am trying to operationalize the Google Ads API data fetch mechanism.
Can we pass the date as parameters in the query object, so we don't have to change the date manually every time I run the API script?

GAQL sample
query = """
    SELECT
    {resource fieds}
    FROM {resource}
    WHERE segments.date BETWEEN '2021-08-18' AND '2021-08-24'
    """
I want to schedule a weekly operations and it would be helpful if we can do this by passing the sys date in the query.

Thanks

Google Ads API Forum Advisor

unread,
Jan 6, 2022, 3:50:33 PM1/6/22
to chitra...@gmail.com, adwor...@googlegroups.com
Hi Chitranshu,

This looks like a pre processing issue, one of our Client libraries can handle pre processing with general programming techniques so that when you send to the API they prepopulate the correct date.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UhGEC:ref

Raviraj Patil

unread,
Aug 3, 2022, 6:20:29 AM8/3/22
to Google Ads API and AdWords API Forum
Hiii,

May i knew what is purpose of GAQL.... 

i am digital marketer with 2 yearsd of exp.... 

Google Ads API Forum Advisor

unread,
Aug 3, 2022, 7:28:51 AM8/3/22
to raviraj...@gmail.com, adwor...@googlegroups.com

Hi Raviraj,

Thanks for reaching out to the Google Ads API Forum.

Reporting of performance data is an integral part of Google Ads API applications. With the API's flexible reporting options, you can obtain performance data for all resources. This includes everything from an entire campaign to a set of keywords that triggered your ad. The Google Ads Query Language can query the Google Ads API for Resources and their related attributes, segments, and metrics using GoogleAdsService Search or SearchStream. For more information, you may refer to this page.

The result from a GoogleAdsService query is a list of GoogleAdsRow instances, with each GoogleAdsRow representing a resource. If any attributes or metrics are requested, then the row also includes those fields. If any segments are requested, then the response also shows an additional row for each segment-resource tuple.

Also, note that the interactive Google Ads Query Language query builder is organized by the resource in the FROM clause of a query. You can also manually enter and validate queries using the Query Validator. Let us know if you’ve further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 

 

 



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