Prebid.js individual sizes sent only to a specific bidder - prebid.js

I would like to set individual sizes in Prebid.js sent only to a specific bidder. I checked and the configuration below is incorrect
"Adunit_mobile1": {
"google": {
"slot": "/GAM_network_ID/GAM_path/GAM_Adunit_name",
"lazyLoad": true,
"hb": true,
"sizes": [[300, 600], [320, 50], [300, 250], [320, 100]],
"sizeMappings": [],
"mediaTypes": {
"banner": {
"sizes": [[300, 250], [300, 600], [320, 100], [320, 50]]
}
},
"bids": [
{
"bidder": "bidder_1",
"params": {
"siteId": "XYZ"
}
},
{
"bidder": "bidder_2",
"sizes": [1, 1],
"params": {
"uid": "XYZ"
}
},

You need to look for your bidder params here and see if a size entry is allowed. Different possibilities :
no size param available => look for the dedicated documentation
size param available => specific size ID from your bidder's API or array of sizes
Please also note : if your bidder allows you to define sizes, it would, most of the time, be declared within its "params" :
"bidder": "bidder",
"params": {
"param": "value",
"sizes" : [1,1]
}
Conclusion : it depends on your bidder's capabilities.

Related

Prebid - Index video outstream configuration with multiple playerSize in bidders

I would like to create an adUnit video outstream with multiple playserSizes for Index (documentation there
At first I thought to put the playerSize at the adUnit level, but because I want to define multiple playerSizes, I decided to move it at bidder level in params > video > playerSize. Nonetheless it does not work whereas in the documentation it is written
If you are using Index’s outstream player and have placed the video object at the bidder level, you must include the Index required parameters at the bidder level``` (link above)
Here is my prebid configuration
```javascript
{
"code": slotCode,
"sizes": [[1,1],[300,250],[160,600],[300,600],[640,360]],
"bids": [
{
"bidder": "criteo",
"params": {
"networkId": networkId,
"video": {
"playerSize": [640, 480],
"skip": 0,
"playbackmethod": 1,
"placement": 1,
"mimes": [
"video/mp4"
],
"maxduration": 30,
"api": [
1,
2
],
"protocols": [
2,
3
]
}
},
"userId": {...},
"userIdAsEids": [...],
"crumbs": {...}
},
{
"bidder": "index",
"params": {
"siteId": siteId,
"size": [
640,
360
],
"video": {
"playerSize": [640, 480],
"h": 640,
"w": 360,
"protocols": [
2,
3,
5,
6
],
"minduration": 5,
"maxduration": 30,
"mimes": [
"video/mp4",
"application/javascript"
],
"playerSize": [
640,
360
]
}
},
"userId": {... },
"userIdAsEids": [...],
"crumbs": {...}
}
],
"mediaTypes": {
"video": {
"context": "outstream"
}
},
"pubstack": {...}
}
If I use this configuration, I got this error
ERROR: IX Bid Adapter: bid size is not included in ad unit sizes or player size.
Even if my playerSize for index ([640, 360]) is in the adUnit sizes.
I wonder if it is possible for an adUnit to have multiple payerSizes?

Avro allow blank JSON/hash for nested attributes

Need to Create Avro schema for this ->
{"city":"XXXXXX", "brand":"YYYY", "discount": {} }
{"city":"XXXXXX", "brand":"YYYY", "discount": {"name": "Freedom", "value": 100} }
{"city":"XXXXXX", "brand":"YYYY", "discount": {"name": "Festive Sale", "value": 100} }
I tried with the below shemas, which do not work:
{ "type":"record", "name":"simple_avro",
"fields":[ { "name":"city", "type":"string" },
{ "name":"brand", "type":"string" },
{ "name":"discount",
"type":{ "type":"record", "name":"discount", "default":"",
"fields":[ { "name":"discount_name", "type":"string", "default":"null" },
{ "name":"discount_value", "type":"float", "default":0 }
] }}
] }
For discount field, I have tried default to as "[]", "{}", "", but none of these work.
I don't think an empty {} object is allowed in any case, but if you want to allow no object at all, then it needs to be a union type, as designated by an array for the type, the the default value goes on the outer field rather than inside the record body
{ "name":"discount",
"type" : [
"null",
{ "type":"record", "name":"discount", "fields": [...] }
],
"default" : "null"
In general, I find that easier to express in IDL format
Then, a valid message could be {"city":"XXXXXX", "brand":"YYYY"}

How to validate properties in loopback remote method?

Recently I have started learning Loopback. I have tried to add required, min and max.
Here is my remote method in json file with parameters :
{
"name": "registration",
"methods": {
"registrationIn": {
"accepts": [
{
"arg": "firstname",
"type": "string",
"min": 1,
"max": 25, // same for here
"required": true,
"description": "Firstname of the person.",
"http": {
"source": "form"
}
}
{
"arg": "mobile",
"type": "number",
"min": 1, // since required it correct but not checking i removed required
"max": 10, // not working
"required": true, // working
"description": "",
"http": {
"source": "form"
}
}
],
"returns": [],
"description": "This method used to registration.",
"http": [{
"path": "/registrationIn",
"verb": "post"
}]
}
}
required property is working fine but min and max is not working.
Can anyone guide me to where i am doing wrong ?
Thanks
Please refer this link validation
You can add validation on model.
module.exports = function(user) {
user.validatesLengthOf('password', {min: 5, message: {min: 'Password is too short'}});
}

Max Response Limitation im OTA_AirLowFareSearchRQ

I'm working with Sabre REST API. I have a issue with the OTA_AirLowFareSearchRQ, I try limit the response number using the MaxResponses in the json structure but seems that I make something wrong because the response give to me 95 answers in the cert environment (https://api.cert.sabre.com/).
The json request that I use is:
{
"OTA_AirLowFareSearchRQ": {
"Target": "Production",
"PrimaryLangID": "ES",
"MaxResponses": "15",
"POS": {
"Source": [{
"RequestorID": {
"Type": "1",
"ID": "1",
"CompanyName": {}
}
}]
},
"OriginDestinationInformation": [{
"RPH": "1",
"DepartureDateTime": "2016-04-01T11:00:00",
"OriginLocation": {
"LocationCode": "BOG"
},
"DestinationLocation": {
"LocationCode": "CTG"
},
"TPA_Extensions": {
"SegmentType": {
"Code": "O"
}
}
}],
"TravelPreferences": {
"ValidInterlineTicket": true,
"CabinPref": [{
"Cabin": "Y",
"PreferLevel": "Preferred"
}],
"TPA_Extensions": {
"TripType": {
"Value": "Return"
},
"LongConnectTime": {
"Min": 780,
"Max": 1200,
"Enable": true
},
"ExcludeCallDirectCarriers": {
"Enabled": true
}
}
},
"TravelerInfoSummary": {
"SeatsRequested": [1],
"AirTravelerAvail": [{
"PassengerTypeQuantity": [{
"Code": "ADT",
"Quantity": 1
}]
}]
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "10ITINS"
}
}
}
}
}
MaxResponses could be something for internal development which is part of the schema but does not affect the response.
What you can modify is in the IntelliSellTransaction. You used 10ITINS, but the values that will work should be 50ITINS, 100ITINS and 200ITINS.
EDIT2 (as Panagiotis Kanavos said):
RequestType values depend on the business agreement between your company and Sabre. You can't use 100 or 200 without modifying the agreement.
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "50ITINS"
}
}
}
EDIT1:
I have searched a bit more and found:
OTA_AirLowFareSearchRQ.TravelPreferences.TPA_Extensions.NumTrips
Required: false
Type: object
Description: This element allows a user to specify the number of itineraries returned.

Configure DataTables to handle array of arrays

Is it possible to configure DataTables to hanlde array of objects instead of default array of arrays for aaData propery?
Here is my JSON:
{
"sEcho": 1,
"iTotalRecords": "57",
"iTotalDisplayRecords": "57",
"aaData": [
{
"userid": "tM4Ga0zX",
"password": "ZKwMEiIa",
"vpn_password": "K3lS2yn9",
"status_id": 0,
"expire_account": "0000-01-01 00:00:00",
"created": "2014-02-11 09:29:02"
},
{
"userid": "tM4Ga0zX",
"password": "ZKwMEiIa",
"vpn_password": "K3lS2yn9",
"status_id": 0,
"expire_account": "0000-01-01 00:00:00",
"created": "2014-02-11 09:29:02"
},
{
"userid": "tM4Ga0zX",
"password": "ZKwMEiIa",
"vpn_password": "K3lS2yn9",
"status_id": 0,
"expire_account": "0000-01-01 00:00:00",
"created": "2014-02-11 09:29:02"
}
]
}
Yes, add an aoColumns-definition your initialization :
..
"aoColumns": [
{ "mDataProp": "userid" },
{ "mDataProp": "password" },
{ "mDataProp": "vpn_password" },
{ "mDataProp": "status_id" },
{ "mDataProp": "expire_account" },
{ "mDataProp": "created" }
]
..
fiddle with your data as above -> http://jsfiddle.net/6tK7K/
Important : If you use dataTables v 1.9.2 or above, use the property name "mData" instead. As the docs says :
Note that prior to DataTables 1.9.2 mData was called mDataProp. The
name change reflects the flexibility of this property and is
consistent with the naming of mRender. If 'mDataProp' is given, then
it will still be used by DataTables, as it automatically maps the old
name to the new if required.