Giter VIP home page Giter VIP logo

bing-ads-api's Introduction

BingAdsApi

This project rocks and uses MIT-LICENSE.

Presentation

This is a very simple, straight use gem for integrating any Rails app with the Bing Ads SOAP Webservices.

Installation

Add to your Gemfile

gem 'bing-ads-api'

Examples

So far, I’ve just integrated some methods from CampaignManagement, CustomerManagement and Reporting services

Authentication

In all cases, you must initialize some service object with the authentication options Here’s an example with the CampaignMangement service object

options = {
	:environment => :sandbox,
	:username => "desarrollo_neonline",
	:password => "neonline2013",
	:developer_token => "BBD37VB98",
	:customer_id => "21021746",
	:account_id => "5978083"
}
service = BingAdsApi::CampaignManagement.new(options)
  • environment can be one of two values: :sandbox or :production

Campaign Management

Example of service object initialization:

options = {
	:environment => :sandbox,
	:username => "desarrollo_neonline",
	:password => "neonline2013",
	:developer_token => "BBD37VB98",
	:customer_id => "21021746",
	:account_id => "5978083"
}
service = BingAdsApi::CampaignManagement.new(options)

Adding Campaigns

account_id = 123456789
campaigns = [
BingAdsApi::Campaign.new(
	:budget_type => BingAdsApi::Campaign::DAILY_BUDGET_STANDARD, 
	:conversion_tracking_enabled => "false",
	:daily_budget => 2000,
	:daylight_saving => "false",
	:description => name + " first description",
	:monthly_budget => 5400,
	:name => name + " first name",
	:status => BingAdsApi::Campaign::PAUSED,
	:time_zone => BingAdsApi::Campaign::SANTIAGO),

BingAdsApi::Campaign.new(
	:budget_type => BingAdsApi::Campaign::DAILY_BUDGET_STANDARD, 
	:conversion_tracking_enabled => "false",
	:daily_budget => 2500,
	:daylight_saving => "false",
	:description => name + " second description",
	:monthly_budget => 7800,
	:name => name + " second name",
	:status => BingAdsApi::Campaign::PAUSED,
	:time_zone => BingAdsApi::Campaign::SANTIAGO) ]
response = service.add_campaigns(account_id, campaigns)

In some cases the methods will return a Hash with the ‘response’ tag according to the method invoked. Like the example above.

Find Campaigns

In other cases, like this next example, the method will return an object, like an array or a object representation of the hash

campaigns = service.get_campaigns_by_account_id(123456789)
# => campaigns is an array of BingAdsApi::Campaign

Customer Management

Example of service object initialization:

options = {
	:environment => :sandbox,
	:username => "desarrollo_neonline",
	:password => "neonline2013",
	:developer_token => "BBD37VB98",
	:customer_id => "21021746",
	:account_id => "5978083"
}
service = BingAdsApi::CustomerManagement.new(options)

Get accounts info

accounts = service.get_accounts_info
# => accounts is an array of BingAdsApi::AccountsInfo

For this method you can also specify a diferent customer id

accounts = service.get_accounts_info(12345)
# => accounts is an array of BingAdsApi::AccountsInfo

That would give you the customer’s 12345 accounts

Reporting

Submit generate report

Poll generate report

bing-ads-api's People

Contributors

jplopez avatar mobsterdude avatar twistedup90 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.