Skip to content

Commit

Permalink
Improve ordering of output columns (was quite random before)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-loetzsch committed Mar 27, 2018
1 parent 136f5fb commit c80afb3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 22 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Changelog

## 2.0
## 2.1.0
2018-03-27

- Improve ordering of output columns (was quite random before)

**required changes**

- Adapt ETL to new column order


## 2.0.0
2018-03-14

- Download both the keywords and the ad performance reports as two separate files (major version bump as the file name is different)

## 1.2.2
Expand Down
2 changes: 1 addition & 1 deletion bingads_downloader/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def retry_timeout_interval() -> int:

def output_file_version() -> str:
"""A suffix that is added to output files, denoting a version of the data format"""
return 'v2'
return 'v3'
48 changes: 29 additions & 19 deletions bingads_downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,31 +143,37 @@ def build_ad_performance_request_for_single_day(api_client: BingReportClient,

report_columns = api_client.factory.create('ArrayOfAdPerformanceReportColumn')
report_columns.AdPerformanceReportColumn.append([
"TimePeriod",
"DeviceType",

"AccountId",
"AccountName",
"AccountNumber",
"AccountId",
"TimePeriod",
"CampaignName",
"AccountStatus",


"CampaignId",
"CampaignName",
"CampaignStatus",

"AdGroupId",
"AdGroupName",
"AdGroupStatus",

"AdId",
"AdGroupId",
"AdTitle",
"AdDescription",
"AdType",
"AdLabels",

"Impressions",
"Clicks",
"Ctr",
"Spend",
"AveragePosition",
"Conversions",
"ConversionRate",
"CostPerConversion",
"DeviceType",
"AccountStatus",
"CampaignStatus",
"AdGroupStatus",
"AdLabels"
"CostPerConversion"
])
report_request.Columns = report_columns

Expand Down Expand Up @@ -207,17 +213,20 @@ def build_keyword_performance_request_for_single_day(api_client: BingReportClien
report_columns = api_client.factory.create('ArrayOfKeywordPerformanceReportColumn')
report_columns.KeywordPerformanceReportColumn.append([
"TimePeriod",
"Network",
"DeviceType",
"BidMatchType",

"AccountId",
"AccountName",
"CampaignId",
"CampaignName",
"AdGroupId",
"AdGroupName",
"AdId",
"Keyword",
"KeywordId",
"DeviceType",
"BidMatchType",
"Keyword",

"Clicks",
"Impressions",
"Ctr",
Expand All @@ -226,7 +235,6 @@ def build_keyword_performance_request_for_single_day(api_client: BingReportClien
"QualityScore",
"Conversions",
"Revenue",
"Network"
])
report_request.Columns = report_columns

Expand Down Expand Up @@ -270,13 +278,15 @@ def build_campaign_performance_request_for_single_day(api_client: BingReportClie

report_columns = api_client.factory.create('ArrayOfCampaignPerformanceReportColumn')
report_columns.CampaignPerformanceReportColumn.append([
"AccountName",
"AccountId",
"TimePeriod",
"CampaignName",

"AccountId",
"AccountName",
"CampaignId",
"Spend",
"CampaignLabels"
"CampaignName",
"CampaignLabels",

"Spend"
])
report_request.Columns = report_columns
return report_request
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name='bingads-performance-downloader',

version='2.0.0',
version='2.1.0',

description="Downloads data from the BingAds Api to local files for usage in a data warehouse",

Expand Down

0 comments on commit c80afb3

Please sign in to comment.