Prebid.js DFP How they work together - google-dfp

I'm kinda a newbie at header bidding and prebid but I am trying to understand how prebid and DFP work together. Does prebid do its auction when the page loads and then after that it goes to DFP to see if it has any better ads to serve? Then whatever ad is suppose to be rendered it will ultimately be rendered by prebid onto the page?
Thanks for the help.

Prebid.js works by updating targeting(key/values) before the page requests ads from GPT.
Here is how the flow might go:
Initialize GPT, making sure to disable initial load.
Setup each Ad slot for GPT with information about the ad, like the allowable size
Setup each Ad slot for Prebid creating AdUnits for them.
Make call to Prebid to start the auction
Wait for Prebid to notify you of the end of auction, some of the bids comeback might timeout
Update slot targeting with parameters with the results of the header bidding auction (using pbjs.setTargetingForGPTAsync()).
Call GPT to refresh the ads slots affected by the auction
DFP will use the information in the targeting for potentially displaying header bidding ads that have a higher priority than the ads that would have been displayed
Prebid.js has bid adapters for a number of SSPs these are used to abstract bid logic because each adapter requires different setup information.
You must setup relationships which each of this SSPs, they will tell what parameters to send them and how to setup line items in DFP.
Here is example of the data prebid returns Prebid.js
{
"/9968336/header-bid-tag-0": {
"hb_bidder": "rubicon",
"hb_adid": "13f44b0d3c",
"hb_pb": "1.50"
},
"/9968336/header-bid-tag-1": {
"hb_bidder": "openx",
"hb_adid": "147ac541a",
"hb_pb": "1.00"
},
"/9968336/header-bid-tag-2": {
"hb_bidder": "appnexus",
"hb_adid": "147ac541a",
"hb_pb": "2.50",
"hb_deal_appnexus": "ABC_123"
}
}
In this case we know rubicon was the highest bidder for slot /9968336/header-bid-tag-0 with a bid of $1.50

Related

Google ad manager ad slot sizes default behavior

Official implementation of gpt defineSlot function, states that ad unit sizes can be defined via array, like this:
googletag.defineSlot('/1234567/sports', [728, 90], 'div-1');
What is the default implementation for this beehavior? Can we define all possible sizes in advance, to be requested from the frontend on each request, but let our admanager team to define sizes on the backend?
The goal is to avoid constant code changes, as our ad unit team works and tests different sizes.
Example. If we put following line in code
googletag.defineSlot('/1234567/sports', [[728, 90],[300,250]], 'div-1');
And our adManager team defines sets for ad unit /sports/ to deliver only 300x250.
Will this be valid behavior for google, and will deliver only 300x250 demand, ignoring other requested unit sizes?
The Google Publisher Tag API allows you to define multiple ad sizes for a unique ad placement.
Regarding your defined slot sample :
googletag.defineSlot('/1234567/sports', [[728, 90],[300,250]], 'div-1');
the behavior would be the following :
Google Ad Manager will create a slot where 728x90 and 300x250 are accepted
When the slot is requested, Google Ad Manager will select any activated line item with these sizes
when rendered, the ad placement will display only 728x90 or 300x250 creatives

Facebook pixel events call from server

I have absolutelly the same question as dan here - Facebook conversion pixel with "server to server" option . There was written, that there was no way, but it was 2013, so I hope something changed.
So, is there any way to call facebook pixel events (e.g. CompleteRegistration) from server side now?
I can describe situation in more details. Imagine, that user visits our site, where fb pixel tracks 'PageView' of course. When user passes form and sends his phone number, we call 'Lead' event. But then we need to track one more event, when our manager successfully confirmes this user! Of course, it happens on other computer and so on, so there is no idea, how to "connect" to base user.
I've seen a lot of documentation departments like this, but I can't fully understand even if it's possible or not.
Logically, we need to generate specific id for user (or it can be phone number really), when 'Lead' event is called. Then, we should use this id to 'CompleteRegistration' for that user. But I can't understand, how to do it technically.
It would be gratefull, if somebody could explain it.
P.S. As I understand, it is fully available in API for mobile apps. Is it ok idea to use it for our situation, if there is no other solution?
Use Offline Conversions to record events that happen after a user has left your website. Logging these conversions, technically, is very easy. Setting everything up takes a little effort
tldr; check the code below
Follow setup steps in the FB docs (Setup steps 1-5) which are:
Setup facebook Business Manager account
Add a new app to Business Manager account
Create an Ad account, if you don't already have one
Create a System User for the ad account
After the setup, follow Upload Event Data steps on the same page, steps 1-3 to create an offline event set and associate it with your ad. These can be carried out in the Graph API Explorer by following the links in the examples. These can be done programmatically, but is out of the scope of making the event calls from the server for one campaign.
Once you have created the event set, then you can upload your CompleteRegistration events!
You will need to make a multipart form data request to FB, the data key will be an array of your conversion events. As #Cbroe mentioned, you must hash your match keys (the data you have available about your user to match them with a FB user) before sending to FB. The more match keys you are able to provide, the better chance at matching your user. So if you can get their email and phone at the same time, you're much more likely to match your user.
Here's an example of the call to FB using node.js:
var request = require('request')
// The access token you generated for your system user
var access_token = 'your_access_token'
// The ID of the conversion set you created
var conversionId = 'your_conversion_set_id'
var options = {
url: 'https://graph.facebook.com/v2.12/' + conversionId + '/events',
formData: {
access_token: access_token,
upload_tag: 'registrations', //optional
data: [{
match_keys: {
"phone": ["<HASH>", "<HASH>"]
},
currency: "USD",
event_name: "CompleteRegistration",
event_time: 1456870902,
custom_data: { // optional
event_source: "manager approved"
},
}]
}
}
request(options, function(err, result) {
// error handle and check for success
})
Offline Conversion Docs
Facebook has now a Server-Side API: https://developers.facebook.com/docs/marketing-api/server-side-api/get-started
Implementing this is similar to implementing the offline events outlined in the accepted answer.
Keep in mind that it will always be cumbersome to track and connect events from the browser and from your server. You need to share a unique user id between the browser and server, so that Facebook (or any other analytics provider) will know that the event belongs to the same user.
Tools like mixpanel.com and amplitude.com may be more tailored to your needs, but will get very expensive once you move out of the free tier (100+ EUR at mixpanel, 1000+ EUR at Amplitude, monthly). Those tools are tailored towards company success, whereas Facebook is tailored towards selling and measuring Facebook ads.

Is there a Google DFP api to check whether an ad units is active or not?

Is there a Google DFP api to check whether an ad unit is active or not ?
Any suggestions are appreciated! Thanks
The google publisher console can help check for active ad units, https://support.google.com/dfp_sb/answer/2462712?hl=en.
It depends on what you mean by "whether an ad unit is active or not". In general it's best to be as descriptive as posible in questions and to include what you've already tried, it saves time in the answers. I'll do my best.
If you're trying to debug whether it was properly loaded on the site, then I'd suggest you debug using the DoubleClick Publisher Console, which you can activate by adding ?googfc to the end of the URL. In there you can check which ad units are called and their status, and you can also follow the execution on the History tab inside the console.
You could also use the Google Publisher Toolbar chrome extension, which has some more information on the ad being rendered, the line item, etc.
Moreover, you could set up an event listener and render information to the developer console.
googletag.pubads().addEventListener('slotRenderEnded', function(event) {
console.info(event);
}
});
This code should be included inside the googlgoogletag.cmd.push(function() {}) and below the slot definitions (e.g.: the method defineSlot()).
However, if you want to do is programatically check if an ad unit is active prior to calling it or defining it, then I think you should rephrase the question to be a bit more specific.

Checking which Google DoubleClick For Publishers (DFP) ad was served

I'm finding that some advertisers are over-aggressively reneging on ad impressions that have low viewability. As a result, I'd like to do my own audit of viewability per ad, rendering only just as the ad scrolls into view. I'll be tracking this with MixPanel, but was wondering if there is any way to insert a callback in the GPT API to determine which creative and line item was served after the fact.
Just listing this here for future searches:
googletag.events.SlotRenderEndedEvent seems be the best way to go about this as it provides access to several parameters including creativeId and the LineItemId.
Full reference here --> https://developers.google.com/doubleclick-gpt/reference#googletageventsslotrenderendedevent

How can I use automatic bid pricing on the Facebook Ads API?

I'm using the Facebook Ads API to create Page Post Engagement ads. The API is in general a breeze to use but I can't seem to find a way to set automatic bid pricing or, in other words, achieve this:
rather than this, which is what I'm getting:
My ad set is being created with bid_type: "ABSOLUTE_OCPM" and bid_info: "{'ACTIONS':500}". bid_info is a required parameter so I can't leave it out. Setting it to 0 doesn't work either.
Any ideas?
bid_info is required only if you set is_autobid to false, which you need to set to true when you create your set.
With bid_type: "ABSOLUTE_OCPM" and bid_info: "{'ACTIONS':500}" you are saying that you'd like to bid 500 units of account's currency on action, which are expressed in cents. And as you are requesting Optimized CPM, you say how much the fulfillment of a particular goal is worth to you, therefore the $5.00 USD always show up there. As per FB Optimized CPM documentation these values are not bids.
There is no official way to set automatic bid via API. Moreover, usually you can just use oCPM and bid the same amount used by Facebook when you create a campaign using the automatic bid. Then PowerEditor will show you that you're using automatic bid.
=== NEW FROM v2.3 ===
From version 2.3 there is the is_autobid field. By setting it to true Facebook will set the bid value automatically. You can read more here: https://developers.facebook.com/docs/marketing-api/adset/v2.3#create