Get All Running campaign

20 views
Skip to first unread message

Ananth Sakthivel

unread,
Feb 8, 2020, 2:55:19 AM2/8/20
to AdWords API and Google Ads API Forum
Hi Team,

I want to display all running campaigns based on the given account_id. can you guide me on how can I achieve this using google Ads API?


Google Ads API Forum Advisor Prod

unread,
Feb 10, 2020, 12:33:26 PM2/10/20
to anan...@gmail.com, adwor...@googlegroups.com

Hi Ananth,

Thanks for reaching out. Please refer to this code example for retrieving data on the campaign level. You could then replace the query in the code to generate the report for the campaigns. You could include the fields and metrics you are interested in in the fields() methods below. You would also need to specify the clientCustomerId in the ads.properties file.


// Create query.

ReportQuery query =

   new ReportQuery.Builder()

       .fields(

               "CampaignId",

               "CampaignName"

               "Cost",

               "Conversions",

               "ConversionValue",

               "Impressions",

               "Clicks"

       )

       .from(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT)

       .where("CampaignStatus").in("ENABLED")

       .during(ReportDefinitionDateRangeType.CUSTOM_DATE)

       .during(new LocalDate("2020-01-01"), new LocalDate("2019-02-10"))

       .build();

 

Please let me know if you have any further concerns.

Thanks and regards,
Xiaoming, Google Ads API Team



 

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