Problems using Ad Hoc Report to download AdWords data

157 views
Skip to first unread message

Federico J. Sutin Citterio

unread,
Apr 5, 2013, 4:05:58 PM4/5/13
to adwor...@googlegroups.com, Martin Gómez, Emanuel Gomez, Carlos Toranzo, maribe...@globallogic.com, yair...@globallogic.com
Actually I am using ad hoc report to download all the AdWord's objects like  Campaign, Ad Groups, Advertises, and Keywords.
For example to download Campaigns object, iam using Campaign Performance Report. (https://developers.google.com/adwords/api/docs/appendix/reports)
I am only requesting for campaign's attributes, not metrics.

<reportDefinition><selector><fields>CampaignId</fields><fields>CampaignName</fields><fields>ExactMatchImpressionShare</fields><fields>BudgetLostImpressionShare</fields><fields>ImpressionShare</fields><fields>QualityLostImpressionShare</fields><fields>Date</fields><dateRange><min>{min.date}</min><max>{max.date}</max></dateRange></selector><reportName>Custom Campaign Report</reportName><reportType>CAMPAIGN_PERFORMANCE_REPORT</reportType><dateRangeType>CUSTOM_DATE</dateRangeType><downloadFormat>GZIPPED_XML</downloadFormat></reportDefinition>

Then I download the metrics using Ad Performance Report with all the adword's object id  (https://developers.google.com/adwords/api/docs/appendix/reports)
<reportDefinition><selector><fields>AdGroupId</fields><fields>CampaignId</fields><fields>Id</fields><fields>KeywordId</fields><fields>Clicks</fields><fields>Impressions</fields><fields>Cost</fields><fields>AverageCpc</fields><fields>AverageCpm</fields><fields>AveragePosition</fields><fields>Ctr</fields><fields>Conversions</fields><fields>CostPerConversion</fields><fields>ConversionRate</fields><dateRange><min>{min.date}</min><max>{max.date}</max></dateRange></selector><reportName>Custom Ads Stats Report</reportName><reportType>AD_PERFORMANCE_REPORT</reportType><dateRangeType>CUSTOM_DATE</dateRangeType><downloadFormat>GZIPPED_XML</downloadFormat></reportDefinition>

When I join both results and make a group by campaign id.I get the metrics for all the campaigns and this works great with Campaigns and AdGroups. But when I try this with Ads or Keywords it does not work. In  case of Advertises I get less Ads than the AdWord's Platform (adwords.google.com) and in case of Keywords, my keywords does not join with my stats. In addition I get one keyword named 'Content', which it does not appear in the platform. If my campaign have 60 keywords, i get 61 with that keyword and that have a lot of stats/metrics.
Why does it work with campaign, adgroup but doesn't with the rest of the reports? Is there any other way to get these reports ?

Thanks in advance
Regards

Ad Peformance Request: 
<reportDefinition><selector><fields>AdGroupId</fields><fields>CampaignId</fields><fields>KeywordId</fields><fields>Id</fields><fields>Cost</fields><fields>AdNetworkType1</fields><fields>Headline</fields><fields>Status</fields><fields>CreativeDestinationUrl</fields><fields>DisplayUrl</fields><fields>ImageAdUrl</fields><fields>Description1</fields><fields>Description2</fields><fields>ImageCreativeName</fields><fields>AdType</fields><fields>CreativeApprovalStatus</fields><dateRange><min>{min.date}</min><max>{max.date}</max></dateRange></selector><reportName>Custom AD Report</reportName><reportType>AD_PERFORMANCE_REPORT</reportType><dateRangeType>CUSTOM_DATE</dateRangeType><downloadFormat>GZIPPED_XML</downloadFormat><includeZeroImpressions>true</includeZeroImpressions></reportDefinition>

Query :
select ag.name as 'adgroupName',
     ad.head_line as 'head_line',
     ad.description_line1 as 'description_line1',
     ad.description_line2 as 'description_line2',
     ad.display_url as 'display_url', 
     ad.ad_approval_status as 'adApprovalStatus',
     ad.image_url as 'image_url',
     SUM(s.impressions) as 'impressions',
     SUM(clicks) as 'clicks',
     SUM(s.clicks)/SUM(s.impressions) as 'ctr',
     (SUM(s.avg_position * s.impressions)/SUM(s.impressions)) as 'position',
     SUM (s.cost) as 'cost'
 from adwords_advertises ad inner join adwords_stats s on s.ad_id = ad.ad_id and s.adgroup_id = ad.adgroup_id and s.campaign_id = ad.campaign_id and s.keyword_id = ad.keyword_id and s.date between @from and @to
          inner join adwords_adgroups ag on s.adgroup_id = ag.adgroup_id and s.campaign_id = ag.campaign_id
          inner join adwords_campaign_detail c on s.campaign_id = c.campaign_id AND c.fox_intelligence_id = @fox_id 
 group by ag.name, ad.ad_approval_status, ad.image_url,ad.head_line,ad.description_line1,ad.description_line2,ad.display_url

KeyWord Request:
<reportDefinition><selector><fields>Id</fields><fields>AdGroupId</fields><fields>CampaignId</fields><fields>KeywordText</fields><fields>Status</fields><fields>DestinationUrl</fields><dateRange><min>{min.date}</min><max>{max.date}</max></dateRange></selector><reportName>Custom Keywords Report</reportName><reportType>KEYWORDS_PERFORMANCE_REPORT</reportType><dateRangeType>CUSTOM_DATE</dateRangeType><downloadFormat>GZIPPED_XML</downloadFormat></reportDefinition>

Keyword Query:
select 
acd.fox_intelligence_id as 'fox_id',
ak.keyword as 'keyword',
acd.campaign_status as 'campaignStatus',
COALESCE(SUM(astats.impressions),0)  as 'impressions',
COALESCE(SUM(astats.clicks),0) as 'clicks',
COALESCE(SUM(astats.clicks)/SUM(astats.impressions) ,0) as 'ctr',
COALESCE(AVG(astats.avg_cpc),0) as 'cpc',
COALESCE(AVG(astats.avg_cpm),0) as 'cpm',
COALESCE(AVG(astats.conv1_per_click) ,0) as 'convertion',
COALESCE(SUM(astats.cost),0) as 'cost',
COALESCE(SUM(astats.avg_position * astats.impressions)/sum(astats.impressions) ,0) as 'position',
ak.keyword_state as 'keywordStatus',
ag.name as 'adgroupName',
ag.status as 'adgroupStatus'
from adwords_campaign_detail acd inner join adwords_adgroups ag on acd.campaign_id=ag.campaign_id
inner join adwords_keywords ak on ak.adgroup_id = ag.adgroup_id and ak.campaign_id = acd.campaign_id
left outer join adwords_stats astats on astats.campaign_id=acd.campaign_id and astats.keyword_id=ak.keyword_id and astats.adgroup_id=ag.adgroup_id and astats.date between @from and @to
where acd.fox_intelligence_id = @fox_id
group by acd.fox_intelligence_id,ak.keyword,acd.campaign_status,ak.keyword_state,ag.name,ag.status


Federico J. Sutin Citterio

unread,
Apr 5, 2013, 4:07:15 PM4/5/13
to adwor...@googlegroups.com, Martin Gómez, Emanuel Gomez, Carlos Toranzo, maribe...@globallogic.com, yair...@globallogic.com
I am currently using Api V201209.

Jason Stedman

unread,
Apr 6, 2013, 12:43:33 PM4/6/13
to adwor...@googlegroups.com, Martin Gómez, Emanuel Gomez, Carlos Toranzo, maribe...@globallogic.com, yair...@globallogic.com
Martin,

The Content keyword indicates that the stats are from clicks generated on the Google Content Network.

These clicks are not associated with any of your keywords because the ads were not shown as a direct result of a search.

You may have better luck if you instead retrieve a CriteriaPerformanceReport as it will include the ids of criteria that may not actually be keywords.

Hope this helps.

Jason

Tiana S.

unread,
Nov 5, 2015, 4:51:39 AM11/5/15
to AdWords API Forum, Martin...@fox.com, emanue...@globallogic.com, carlos....@globallogic.com, maribe...@globallogic.com, yair...@globallogic.com
Hi Jason,

You give an explanation on what it is, but could you tell me why it's returned?
It's a Keywords performance report and as you explained, "Content" is not actually a keyword...

Thanks,

Tiana

Umesh Dengale

unread,
Dec 8, 2015, 4:24:04 PM12/8/15
to AdWords API Forum, Martin...@fox.com, emanue...@globallogic.com, carlos....@globallogic.com, maribe...@globallogic.com, yair...@globallogic.com
Hi Tiana,

The current thread is more than two year old. Could you please create new thread for your question?

Thanks,
Umesh, AdWords API Team.

Tiana S.

unread,
Dec 11, 2015, 9:30:47 AM12/11/15
to AdWords API Forum, Martin...@fox.com, emanue...@globallogic.com, carlos....@globallogic.com, maribe...@globallogic.com, yair...@globallogic.com
Reply all
Reply to author
Forward
0 new messages