Python API - KeywordText is not downloaded exactly as it is

77 views
Skip to first unread message

Pippo

unread,
Sep 9, 2016, 4:17:11 AM9/9/16
to AdWords API Forum
Sorry in advance fot this probably-naive question but I haven't been able to find any discussion on internet about this issue (if it's an issue)...

I'm using the v201607 API for Python and I've noticed that KeywordText which on adwords web page appear as
[aaa bbb]
are downloaded by the API as
aaa bbb   .
 
I've even seen a keyword
+aaa +bbb
downloaded as
"+aaa +bbb"  .

I know that the KeywordMatchType returns the exact nature of KeywordText, but I'd like anyway to download the KeywordText exactly as it appears on adwords. Is it possible?
Another solution might be, after having downloaded KeywordMatchType, KeywordText, to modify KeywordText string according to KeywordMatchType and some rules, e.g. if KeywordMatchType is Exact, than add square brackets to KeywordText; in this caseI'd need a complete list of rules to properly modify the KeywordText.

Thanks!

Joyce Lava

unread,
Sep 9, 2016, 5:20:48 AM9/9/16
to AdWords API Forum
Hello,

Please feel free to ask your concerns about AdWords API and we're very much happy to assist you.

Regarding your question above, I am not totally sure on what report type you tried to download that for the keyword = [aaa bbb], it was downloaded as aaa bbb. I tried to download Keywords Performance Report with my test account using Java client library and the keyword that has square brackets [] were downloaded as it is. Could you please provide the report type where you see this behavior and I'll try that in Java client library to see if this is specific to Python client library?

Also, for keyword that begins with plus sign (+), they are returned in the CSV reports as double quoted to avoid treating them as formula. The same thing applies for text that begins with minus sign (-). 

Thanks,
Joyce, AdWords API Team
Message has been deleted

Pippo

unread,
Sep 9, 2016, 6:37:30 AM9/9/16
to AdWords API Forum
I use the Keywords Performance Report and the following code

        ... 
        report_downloader 
= self.adwords_client.GetReportDownloader(version='v201607')
        report 
= {
            
'reportName': 'KEYWORDS_PERFORMANCE_REPORT',
            
'dateRangeType': self.dateRangeType,  # set as today in my code
            
'reportType': 'KEYWORDS_PERFORMANCE_REPORT',
            
'downloadFormat': 'TSV',
            
'selector': {
                
'fields': ['Date', 'Id', 'Criteria', 'KeywordMatchType', 'AdGroupId', 'AdGroupName', 'CampaignId', 'CampaignName', 'AverageCpc', 'AveragePosition', 'Impressions', 'Clicks','Conversions', 'ConversionRate', 'Ctr', 'AverageTimeOnSite', 'BounceRate', 'Cost', 'CostPerConversion', 'QualityScore'],
            
}
        
}
        result 
= report_downloader.DownloadReportAsString(
            report
, skip_column_header=True, skip_report_header=True, skip_report_summary=True)
        
return result

and in the result list it returns aaa bbb when on adwords web page appears as [aaa bbb] .
Are there maybe some options which remove brackets from report download?

Thanks again!

Josh Radcliff (AdWords API Team)

unread,
Sep 9, 2016, 9:47:20 AM9/9/16
to AdWords API Forum
Hi,

Could you share the AdGroupId and (criterion) Id where you are seeing this issue? I'd like to try to reproduce your exact report output on my side.

Thanks,
Josh, AdWords API Team

Pippo

unread,
Sep 13, 2016, 5:39:28 AM9/13/16
to AdWords API Forum
Unfortunately I'm not allowed to publish neither the adgroupid nor the id in a public forum, I'm sorry... However I've even tried to use DownloadReportAsStream function, using different download formats, and the result is the same:
I can see keywords like:
"+aaa +bbb"   (and KeywordMatchType is 'Broad' in these cases)
aaa bbb   (and KeywordMatchType is 'Broad', 'Exact' or 'Phrase' in these cases)

but no trace of
[aaa bbb]
while I've checked it exists, and it's downloaded simpy as aaa bbb  .

This time I've connected to my account by simply using the download_criteria_report_as_stream.py file contained in Python API examples directory, therefore I'm pretty sure I've used your "default" settings.
Thanks again!

Josh Radcliff (AdWords API Team)

unread,
Sep 13, 2016, 9:11:56 AM9/13/16
to AdWords API Forum
Hi,

Could you send the IDs only to me by clicking Reply privately to author on this message?

Thanks,
Josh, AdWords API Team

Pippo

unread,
Sep 20, 2016, 7:55:11 AM9/20/16
to AdWords API Forum
Hello,
sorry again but I've some privacy issues in my company and really can't provide the ids (I know, it's a really weird thing but it's not my decision)... Just a question: are you able to download a KeywordText with square brackets with Python API v201607 ? The issue is not only for one AdGroup and one Keyword, but it always happens: I manage 100 campaigns, thousands of keywords and I've never seen a KeywordText with square brackets.
I've just read this topic https://groups.google.com/forum/#!topic/adwords-api/25LHtXiFjRk which is from 2009, and I wonder if the situation is still the same (i.e. you don't have this data stored) or, as Joyce Lava answered in this topic, with Java it's actually possible to download brackets.
Thanks again!

Best regards 

Josh Radcliff (AdWords API Team)

unread,
Sep 21, 2016, 4:36:33 PM9/21/16
to AdWords API Forum
Hi,

Rereading this, I noticed your earlier statement of:

I know that the KeywordMatchType returns the exact nature of KeywordText, but I'd like anyway to download the KeywordText exactly as it appears on adwords. Is it possible?

No, this is not possible, but your idea below is exactly what I'd recommend. :)
 
Another solution might be, after having downloaded KeywordMatchType, KeywordText, to modify KeywordText string according to KeywordMatchType and some rules, e.g. if KeywordMatchType is Exact, than add square brackets to KeywordText; in this caseI'd need a complete list of rules to properly modify the KeywordText.

The complete list of prefixes and suffixes for each match type are in this Help Center article. With that information, I think you'll be able to achieve what you want, but let me know if you have further questions or I missed something.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages