In prebid.js, How do I set floor price for each bidder while sending request? - prebid.js

In DFP I'm able to set line item and key value pair to target bidders and price. In prebid.js how do I send floor price dynamically to each bidders while sending request?
I have searched in prebid site's and got one function pbjs.adserverTargeting() which returns following details during response:
{ "hb_bidder": "appnexus",
"hb_adid": "7a53a9d3",
"hb_pb: 1.0" }
Here hb_pb means floor price? If yes how can I sent those details during request?

pbjs.adserverTargeting() returns the ad server targeting constructed corresponding to the bids received from the exchanges.
According to the prebid docs only certain bidders allow for sending floor prices through their params, like for example rubicon(http://prebid.org/dev-docs/bidders.html#rubicon) which has an optional param "floor" where you can set the floor price.

hb_pb means Header Bidding Price Bucket which is different from Price Floor. A price floor is the lowest CPM price a bid will need to meet for each Prebid auction. It is a way of preventing low bids from winning your impressions. It also helps filter cheap ads that may be malicious in nature since bad actors don't spend too much on ads.
There are 2 ways o set a price floor.
From your ad server - If you use GAM as your ad server, you can do this by going into inventory/pricing rules/New unified price rules. The rest is self-explanatory. You can set a price floor for the device, placement, or bidder.
From the bidder's dashboard - Most bidders let you set a price floor from the dashboard. Those who don't can usually do it for you if you reach out to them.

As far as I know, it depends on the bidders you're working with. Because there are some bidders who don't allow the passing of floor price in the parameters.
If your bidder partners support floor price, then the bidder parameter consists of "bidFloor" i.e. that represents the floor value. Some of the bidders pass floor price via "floorPriceMap"
hb_pb is just a bidder-key that is used to target the line items in the Google Ad Manager. It doesn't mean floor price. If you've integrated Prebid without any header bidding service provider, you can get it from the bidder partners. In case, if you have a provider, then they provide this data which has to be used in the "Targeting section" under Line items settings in Google Ad Manager.
floors: {
currency: 'USD',
schema: {
fields: [ 'mediaType' ]
},
values: [
{key: 'banner', floor: 1.10},
{key: 'video', floor: 2.00}
]
},
If the ad slots are controlled by Google Publisher Tags, then you can take a hint from the following code:
pbjs.setConfig({
floors: {
data: {
currency: 'USD',
schema: {
fields: [ 'gptSlot', 'mediaType' ]
},
values: [
{key: '/1111/homepage/top-rect|banner', floor: 0.80},
{key: '/1111/homepage/top-rect|video', floor: 1.20},
{key: '/1111/homepage/left-nav|banner', floor: 0.90},
...
{key: '/1111/tech/left-nav|banner', floor: 1.50}
],
default: 0.75
}
}
});
Also, you can delay the auction for some time to receive optimal floor price for specific pages or ad units if you're working with a third-party floor provider:
pbjs.setConfig({
floors: {
auctionDelay: 100, // in milliseconds
endpoint: {
url: 'https://floorprovider.com/a1001-mysite.json',
method: 'GET'
},
data: { // default if endpoint doesn't return in time
currency: 'USD',
schema: {
fields: [ 'mediaType' ]
},
values: [
{key: 'banner', floor: 0.80},
{key: 'video', floor: 1.20}
]
}
}
});

Related

Query MongoDB Aggregation framework with Golang

I have in a collection stores , products and many prices (for store-products there are many prices) of the products in MongoDB
I have to find out min price from a product in a store in the last 30 days with the help of go
I have built the following aggregation pipeline
pipeline := []bson.M{
bson.D{
"$group", bson.D{
{
"_id", bson.D{
{
Key: "storeId",
Value: "$storeUd",
},
{
Key: "productId",
Value: "$productId",
},
},
},
minPrice : {
Key: "min",
Value: "$price",
},
},
} <---
}
But go compiler tell me in the line that I marked with an arrow (<---) there is a mistake
syntax error: unexpected newline in composite literal; possibly missing comma or }
I would like to calculate something like
select min(price)
from prices
group by storeId , productId
Please can you tell me what is wrong?
Thanks,
Aurel
I added }, but what I get you can see in the attached picture - the next declaration (var ... ) is in red ....

Get totals or sum source medium filter, Google Analytics API

Post request https://analyticsreporting.googleapis.com/v4/reports:batchGet
{
"reportRequests":[
{
"viewId":"XXXXXX",
"dateRanges":[
{
"startDate":"2021-07-01",
"endDate":"2021-07-31"
},
{
"startDate":"2020-07-01",
"endDate":"2020-07-31"
}],
"metrics":[
{
"expression":"ga:sessions"
}],
"dimensions": [
{
"name":"ga:sourceMedium"
}],
"dimensionFilterClauses": [
{"filters": [
{"dimensionName": "ga:sourceMedium",
"operator": "EXACT",
"expressions": ["google / cpc"]},
{"dimensionName": "ga:sourceMedium",
"operator": "EXACT",
"expressions": ["facebook / cpc"]},
]}
]
}]
}
Want response with total / finished summed values for ga:sourceMedium "google / cpc" and "facebook / cpc". With this body i get a response with values for each ga:sourceMedium separated. Possible?
The Google Analytics Reporting API returns that data that it has. so you are requesting ga:sourceMedium This returns Combined values of ga:source and ga:medium.
You are also requesting ga:sessions which will return The total number of sessions.
So the api will return the total sessions fore ach of the source and medium combination.
If you want to sum them you will need to do that locally the api is not going to do that for you.

How to create a refund on ShopifyAPI

I'm trying to create a refund using Shopify API with the details in the documentation here:
and this is the payload I'm sending:
{ currency: 'GBP',
notify: false,
refund_line_items:
[ { line_item_id: '<line-item-id>',
quantity: 1,
restock_type: 'no_restock' } ] }
But I get this error:
StatusCodeError: 422 - {"errors":{"refund_line_items.line_item":["can't be blank"]}}
But refund_line_items.line_item is not mentioned in the documentation. I have checked the and the line_item_id is correct (is the ID of the variation ID, not the product ID, but I have tried using SKU and product ID, same result)
Other response in SO infers that this is because the line_item_id is incorrect but that's not the case. Any suggestions would be much appreciated. Thanks!

Is it possible to create dummy bidders to test header bidding?

I am a developer curious about header bidding. I don't have demand partners. But I want to test the solution I build. Is it possible to create dummy bidders? Is there any open source code that can mimic a bidder?
You can use appnexus's dummy bidder used in their examples on prebid.org.
It's also available on jsfiddle
Here's the complete configuration:
var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250], [300,600]],
bids: [{
bidder: 'appnexus',
params: {
placementId: '10433394'
}
}]
},{
code: 'div-gpt-ad-1460505661639-0',
sizes: [[728, 90], [970, 90]],
bids: [{
bidder: 'appnexus',
params: {
placementId: '10433394'
}
}]
}];
Of course you could also take some else's live configuration, but the owners won't be happy to see your dummy bids

Amazon Product API not respecting ResponseGroups

I'm trying to get all products priced between 12.50 and 11.50. I'm using Node-APAC for my requests to the Amazon Product API. Here's my code for a request:
exports.search = function(req, res){
OperationHelper = require('apac').OperationHelper;
var opHelper = new OperationHelper({
awsId: process.env.AMZ_ACCESS_KEY_CODE,
awsSecret: process.env.AMZ_SECRET_ACCESS_KEY,
assocId: process.env.AMZ_ASSOCIATE_ID
});
opHelper.execute('ItemSearch', {
'SearchIndex': 'All',
'Keywords': ' ',
'MaximumPrice': 12.50,
'MinimumPrice': 11.50,
'ResponseGroup': 'Medium'
}, function(error, results) {
res.send(results);
});
};
The response does not limit the results to a Medium ResponseGroup. You can see some of the full response here (It's huge). Here's the structure:
{
ItemSearchResponse: {
$: {...},
OperationRequest: [...],
Items: [
{
Request: [...],
TotalResults: [...],
TotalPages: [...],
MoreSearchResultsUrl: [...],
Item: [
{
ASIN: [...],
DetailPageURL: [...],
ItemLinks: [...],
SmallImage: [...],
MediumImage: [...],
LargeImage: [...],
ImageSets: [...],
ItemAttributes: [...],
OfferSummary: [...]
},
{...},
{...},
{...},
{...}
]
}
]
}
}
It is not returning what the documentation says should be included in the Medium ResponseGroup. It's returning a bunch of other stuff which is unnecessary. Any help is appreciated!
Note: It's also returning products that don't fit the price range. These problems may be related. Any tips there would be helpful.
As per the Amazon Product Advertising doc for the ItemSearch operation, MinimumPrice (resp. MaximumPrice) "specifies the minimum (resp. maximum) price of the items to return. Prices are in terms of the lowest currency denomination, for example, pennies, for example, 3241 represents $32.41.".
So if you change the values for the following two parameters:
'MaximumPrice': 12.50,
'MinimumPrice': 11.50,
with
'MaximumPrice': 1250,
'MinimumPrice': 1150,
the price filtering should work. As for the ResponseGroup, I would suggest you to pass "Small,OfferSummary" (as per my answer to your question "How to specify what Amazon Product API returns").