!DOCTYPE html> Bidswitch Support


Bidswitch Support

In this blog post we will show you how to set up Bidswitch support. It's really quite simple.

  1. First Step - Get Your Seat Id From Bidswitch.

    Bidswitch requires you to put your seat id in the bid request. So, find out what your account's seat-id is.

  2. Second Step - Plug your Bidswitch-id into into the Docker Compose startup.

    The Following is an example docker-compose.yml file of a bidder:

    
      bidder:
        image: "jacamars/rtb4free:v1"
        environment:
          GDPR_MODE: "false"
          BROKERLIST: "kafka:9092"
          PUBSUB: "zerospike"
          EXTERNAL: "http://localhost:8080"
          ACCOUNTING: "NONE"
          S3BUCKET: ""
          S3REGION: ""
          S3SECRETKEY: ""
          S3ACCESSKEY: ""
          GOOGLE_EKEY: ""
          GOOGLE_IKEY: ""
          OPENX_EKEY: ""
          OPENX_IKEY: ""
          ADX_EKEY:   ""
          ADX_IKEY:   ""
          BIDSWITCH_ID: "1234"
        ports:
          - "8080:8080"
          - "8155:8155"
          - "7379:7379"
          - "7000:7000"
        networks:
          - rtb_net
        depends_on:
          - kafka
          - zerospike
        command: bash -c "./wait-for-it.sh kafka:9092 --t=120 && ./wait-for-it.sh zerospike:6000 --t 120 && sleep 1; ./rtb4free"
    
    

    Notice BIDSWITCH_ID: "1234". Replace "1234" with your seat-id.

  3. Step 3 - Restart the bidder container.

    Relaunch your docker-compose file, or however you have it running. Now you are ready to bid...

Sending a Sample Request to Bidswitch With Curl

To demonstrate Bidswitch is pretty easy. We will do it from curl. There are sample Bidswitch requests in SampleBids/Bidswitch. We will use the request in the file ../SampleBids/Bidswitch/AppNoDomain.txt. For this example we will run using Docker compose in the root directory of the project source.

  1. First - Copy ./sampledb over database.json. We will be using a sample campaign in the "demo" stand alone database.json file rather using a campaign defined in the Campaign Manager.
  2. Second - Start the bidder using the docker-compose.yml you installed your Bidswitch user id.
  3. Third - Send the following Curl Command.
    $curl -X POST -d @SampleBids/Bidswitch/AppNoDomain.txt http://localhost:8080/rtb/bids/bidswitch --header "Content-Type:application/json"
    

Your sample output should look like:

{"ext":{"protocol":"5.3"},"seatbids":[{"seat":"1234","bids":[{"ext":{"advertiser_name":"Coca-Cola","agency_name":"CC-advertising"},"nurl":"http://localhost:8080/rtb/win/play.google.com/APP/bidswitch/${AUCTION_PRICE}/26.638/-80.237/bidswitch-test/appad/123","crid":"appad","adomain":["originator.com"],"price":4.0,"imageurl":"http://localhost:8080/images/320x50.jpg?adid=bidswitch-test&bidid=123","cat":["IAB1","IAB12"],"id":"1","adm":"http://localhost:8080/contact.html?130070665&adid=bidswitch-test&crid=appad","cid":"bidswitch-test"}]}],"id":"123"}

Sending a Sample Request to Bidswitch With Exchange Tester

Once you have the bidder running with the sample campaign, point your broswer here: http://localhost:8080/exchange.html.

In the ""Exchange Type" dropdown choose "bidswitch".

In the ""Sample Bid Request: Banner" editor field, delete the sample bid request and place it with this one:

{
  "id": "123",
  "app": {
    "bundle": "com.mobileposse.client",
    "cat": [
      "IAB1"
    ],
    "domain": "play.google.com",
    "id": "130070665",
    "paid": 0,
    "privacypolicy": 1,
    "name": "WMUR - Android - Core News App",
    "publisher": {
      "id": "1100015422",
      "name": "Mobile Posse, Inc."
    }
  },
  "wseat": [
    "165",
    "16"
  ],
  "source": {
    "fd": 0
  },
  "user": {
    "id": "5e29eb00-c30a-416e-9d2a-2e18901f0916",
    "ext": {
      "cookie_age": 64,
      "consent": "Y29uc2VudCBkYXRh"
    },
    "buyeruid": "CAESEHL-9O4oJOAiC1Y0O2EHTcE"
  },
  "device": {
    "pxratio": 0,
    "language": "en",
    "mccmnc": "310-005",
    "w": 1920,
    "geo": {
      "country": "US",
      "lon": -80.237,
      "city": "West Palm Beach",
      "lat": 26.638,
      "zip": "33414",
      "region": "FL",
      "type": 2
    },
    "os": "Windows",
    "devicetype": 2,
    "h": 1080,
    "ip": "73.139.39.18",
    "js": 1,
    "ua": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0",
    "dnt": 0
  },
  "tmax": 75,
  "cur": [
    "USD"
  ],
  "imp": [
    {
      "bidfloor": 3.213,
      "metric": [
        {
          "type": "viewability",
          "value": 0.85
        }
      ],
      "id": "1",
      "banner": {
        "pos": 1,
        "h": 600,
        "battr": [
          1,
          3,
          5,
          6,
          8,
          9,
          10,
          14,
          15,
          16
        ],
        "w": 160,
        "format": [
          {
            "h": 300,
            "w": 300
          },
          {
            "h": 350,
            "w": 300
          }
        ],
        "btype": [
          1
        ]
      },
      "exp": 300,
      "tagid": "gumgum_25108",
      "bidfloorcur": "USD",
      "ext": {},
      "secure": 0,
      "instl": 0
    }
  ],
  "bcat": [
    "IAB25-3",
    "BSW1",
    "BSW2",
    "BSW10",
    "BSW4",
    "IAB26"
  ],
  "regs": {
    "ext": {
      "gdpr": 1
    }
  },
  "ext": {
    "wt": 1,
    "clktrkrq": 0,
    "is_secure": 0,
    "ssp": "gumgum"
  },
  "at": 2
}

Push the "Send Bid Request" Button

Check the Bid and Response fields to make sure the bidder sent a bid.

Campaign Requirements for Bidswitch

The following JSON is the campaign for the test bidswitch, there are a couple of things to notice:

{
	"isAdx": false,
	"owner": "ben",
	"adId": "bidswitch-test",
	"adomain": "originator.com",
	"attributes": [{
		"value": "bidswitch",
		"op": "EQUALS",
		"notPresentOk": false,
		"bidRequestValues": ["exchange"]
	}],
	"creatives": [{
		"forwardurl": "http://localhost:8080/contact.html?{site_id}&adid={ad_id}&crid={creative_id}",
		"imageurl": "http://localhost:8080/images/320x50.jpg?adid={ad_id}&bidid={bid_id}",
		"impid": "appad",
		"w": 160,
		"h": 600,
		"currency": "",
		"cur": "USD",
		"price": 4.0,
		"adm_override": false,
		"status": "active",
		"extensions": {
        	"advertiser_name": "Coca-Cola",
        	"agency_name": "CC-advertising",
        	"categories": "IAB1, IAB2, IAB9"
         }, 
         "attributes": [{	
				"op": "EXISTS",
				"notPresentOk": false,
			"bidRequestValues": ["app"]
		}, {
				"value": 0,
				"op": "EQUALS",
				"notPresentOk": false,
				"bidRequestValues": ["app", "paid"]
			},
			{
				"value": 1,
				"op": "EQUALS",
				"notPresentOk": false,
				"bidRequestValues": ["app", "privacypolicy"]
			}]
	}

The creative require extension attributes that identify the IAB categories of the creative, the agency_name and the advertiser_name. Above it is:

"extensions": {
        	"advertiser_name": "Coca-Cola",
        	"agency_name": "CC-advertising",
        	"categories": "IAB1, IAB2, IAB9"
         }, 

When you use the Campaign Manager, if you select the Bidswitch exchange for use with your creative, you will be prompted to apply the categories, advertiser_name and the agency_name.