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

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

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

How to create a Facebook ad based on a post?

After many tries, I'm not getting how we can use the Facebook API to create a simple Ad based on a Post (and it's creative) like it is possible in the Business Manager.
For example, my last attempt failed due to a problem with Instagram:
Facebook API: Instagram Account Is Missing
If there is anybody that has been able to create a basic Ad (within a given or new AdSet) based on a Post, please help me. I've seen many questons like this (especially regarding the Instagram problem) and now I'd like to have a working solution.
What exact requests have to be done or isn't it possible at all?
THe Instagram placement is added by default in the targeting, so if you want to skip it you need to specify in the targeting field when creating the adSet in the publisher field:
{
"geo_locations":{"countries":["US"]},
publisher_platforms: ['facebook'],
facebook_positions: ['feed', 'right_hand_column'],
device_platforms: ['mobile', 'desktop']
}
If you want to publish on Instagram also you should also provide an instagram actor ID: The AdsCreative should contain an extra field named instagram_actor_id also remember to add Instagram in the related targeting:
{
"geo_locations":{"countries":["US"]},
publisher_platforms: ['facebook','instagram'],
facebook_positions: ['feed', 'right_hand_column'],
instagram_positions: ['stream', 'story'],
device_platforms: ['mobile', 'desktop']
}
Reference:
https://developers.facebook.com/docs/marketing-api/guides/instagramads
https://developers.facebook.com/docs/marketing-api/guides/instagramads/ads_management/
https://developers.facebook.com/docs/marketing-api/targeting-specs/#placement
Let me know if you need more info or an answer or your other question about Instragam

where is the “Recently Used”,“In Active Adverts”, "Action Needed", "Shared" filtering based from facebook custom audience data?

If you go to business manager of facebook, then go to the "All Audiences", then under the "Audiences" tab, you will see a "Filters" button right beside the "Create Audience" button. Now my question is, which part the json data being provided by the facebook apis should I based the data that I should pull out based from these filters ?
- Recently Used
- In Active Adverts
- Action Needed
- Shared
Because unlike the "ready" and "not ready" status, those four filters that I mentioned are not straight forward where I can just look for the numbers from the returned json data. so how ?
Most likely, not all of this information is available through the API.
However, if you take a look at the following doc, you can see some reelvant fields that may help:
https://developers.facebook.com/docs/marketing-api/reference/custom-audience
Most likely you can use the field operation_status to look at whether an audience needs action.
For whether it's shared, take a look ad the edge adaccounts which will let you see the ad accounts this audience has been shared with.
For recently used, you'll probably have to look at the edge ads and review the status of the ads.
To save having to make multiple requests, you can take a look at field expansion in the Graph API, which will let you query for fields of objects in results using a single request:
https://developers.facebook.com/docs/graph-api/using-graph-api#fieldexpansion

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.

Load Facebook adinterests list in a single API call

Is there a way to load multiple adinterests by IDs in a single API call?
Here's situation:
We have multiple adinterests for ads targeting campaign. For example, we are targeting users that are interested in:
music (ID=111)
arts (ID=222)
museums (ID=333)
We are listing all interests to a user, but in the database we store only IDs.
Currently we can only load single interest per request, e.g.:
https://graph.facebook.com/v2.3/111?access_token=___
https://graph.facebook.com/v2.3/222?access_token=___
https://graph.facebook.com/v2.3/333?access_token=___
or
https://graph.facebook.com/v2.3/?access_token=___&type=adinterest&id=111
This works. However, I would like to load all interests in a single call to speed up page load, for example:
https://graph.facebook.com/v2.3/?type=adinterest&id[0]=111&id[1]=222&id[2]=333&access_token=___
This, unfortunatelly, does not work.
So, is there any way to load ad interests list by list of supplied IDs?
You can use the Batch request framework to make a single HTTP request to multiple endpoints. See
https://developers.facebook.com/docs/marketing-api/batch-requests