how to get campaigs, ads, keywords and theirs performances

621 views
Skip to first unread message

Alpine

unread,
Feb 7, 2017, 9:20:51 AM2/7/17
to AdWords API Forum

Hello!

I have just started to work with AdWords API. I need to get data from the API as a object. These are the things I need to get:

1. I want to retrieve campaigns with its performances like Clicks, Impressions, InteractionRate etc. 
2. For one specific campaign, I want to get all its ads, keywords.
3. To a specific ad or keyword, I need to get all its performances(Clicks, Impressions, CTR, etc)

I am confused about the way I have to get this, I know I can get basic info for a campaign, for example:

CampaignService campaignService =
                (CampaignService)user.GetService(AdWordsService.v201609.CampaignService);

 Selector selector = new Selector()
{
                fields = new string[] {
                    Campaign.Fields.Id
                    Campaign.Fields.Name
                    Campaign.Fields.Status,
             },
             paging = Paging.Default
};

Anyone could refer me where I can see examples how get these things? (1) how do I have to set the id, what views or tables do I need to use for this?
campaignService , CampaignCriterionService,CAMPAIGN_PERFORMANCE_REPORT, etc
The same to get the ads, keywords per campaign or its performances (2) (3)
I did not find examples of how to use the API, I saw examples in https://developers.google.com/adwords/api/docs/samples/dotnet/reporting but very general and I did not find the particular things I need.

I want to create my own objects to be loaded from the API, they will be shown in my HTML views.

Thank you

Shwetha Vastrad (AdWords API Team)

unread,
Feb 7, 2017, 1:36:01 PM2/7/17
to AdWords API Forum
Hi,

You can use the API services listed here to retrieve structure and content information of your account. You need to use AdWords API reports to retrieve performance data for your account. In your case, you can do the following:
  1. You can use Campaign Performance Report to retrieve performance data for your campaigns as this report aggregates statistics at the campaign level. 
  2. You need to use AdGroupAdService and AdGroupCriterionService to retrieve the Ads and keywords in your account. You can use Ad Performance Report and Keywords Performance Report for this purpose as well. The GetTextAds and the GetKeywords examples demonstrate how to use these services to retrieve your ads and keywords respectively. 
  3. The Ad Performance Report and the Keywords Performance Report will provide performance data aggregated at the Ad and Keyword level. The DownloadCriteriaReport example downloads a Criteria Performance Report. You need to change the report definition as needed to download the report of your choice. AdWords API reports can be downloaded in the formats listed here.
Each client library has example code for a few common use cases. You can use these as a reference while implementing your application. Example code in other examples is available here

Regards,
Shwetha, AdWords API Team.
Message has been deleted

Alpine

unread,
Feb 8, 2017, 4:56:34 AM2/8/17
to AdWords API Forum
I need to get all this data from the API as an object, I get a bit confused because the examples always download in a format. I need to get the data retrieved with these tables or views and populate as an object in C#, not download in a file. if there is no any view or table give me these values, how can I convert the stream retrieved from the performance report to an object?
when you use campaignService, you can get de fields like this after executing the query:
foreach (Campaign campaign in page.entries)
{
    myCAmpaignObject.id =  campaign.id;
    myCAmpaignObject.name =  campaign.name,
    ....
}

I was looking for something similar to get all performance
Thank you

Shwetha Vastrad (AdWords API Team)

unread,
Feb 8, 2017, 11:12:13 AM2/8/17
to AdWords API Forum
Hi,

The only formats supported while downloading report are the ones listed here. If you are looking for a response similar to CampaignService, I'm afraid it's not possible when downloading reports. You could download the report in XML format and use a parser to read the required data.
Reply all
Reply to author
Forward
0 new messages