https://github.com/forward3d/bing-ads-reporting
Gem for pulling reports from bing ads
https://github.com/forward3d/bing-ads-reporting
Last synced: 2 months ago
JSON representation
Gem for pulling reports from bing ads
- Host: GitHub
- URL: https://github.com/forward3d/bing-ads-reporting
- Owner: forward3d
- License: mit
- Created: 2013-10-18T16:35:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T09:07:43.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T08:55:23.288Z (about 1 year ago)
- Language: Ruby
- Size: 104 KB
- Stars: 9
- Watchers: 23
- Forks: 14
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE
Awesome Lists containing this project
README
# Bing Ads Reports
## Installation
gem install bing-ads-reporting
## Usage
### Initializing service.
#### All Reporting Service - [Bing Ads Reference for Reporting Service](https://docs.microsoft.com/en-us/advertising/reporting-service/reporting-service-reference?view=bingads-12)
```ruby
service = BingAdsReporting::ReportingService.new({
developerToken: '',
applicationToken: '',
authenticationToken: '',
:accountId: '',
customerId: ''})
```#### Bulk Service - [Bing Ads API reference for Bulk Service](https://docs.microsoft.com/en-us/advertising/reporting-service/reporting-service-operations?view=bingads-12)
```ruby
service = BingAdsReporting::BulkService.new({
developerToken: '',
applicationToken: '',
authenticationToken: '',
:accountId: '',
customerId: ''
})
```## Create report and get it's ID
### Reporting Service
```ruby
period = Datebox::Period.new('2013-07-01', '2013-07-03')
id = service.generate_report({report_type: 'KeywordPerformance',
report_format: 'Tsv',
aggregation: 'Daily',
aggregation_period: 'ReportAggregation::Daily',
columns: %w[AccountId AccountName CampaignId CampaignName AdGroupId AdGroupName KeywordId Keyword DestinationUrl DeliveredMatchType AverageCpc CurrentMaxCpc AdDistribution CurrencyCode Impressions Clicks Ctr CostPerConversion Spend AveragePosition TimePeriod CampaignStatus AdGroupStatus DeviceType]},
{period: period})
```### Bulk Service
```ruby
id = service.generate_report({report_type: 'DownloadCampaignsByAccountIds'
report_format: 'Tsv',
data_scope: 'EntityData'
download_entities: ['Keywords']},
{})
```
### Get ReportGet report URL for download by report ID if it's ready
```ruby
service.report_url(id) if service.report_ready?(id)
```or get its content by ID (also once ready)
```ruby
service.report_body(id) if service.report_ready?(id)
```