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

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.

Related

Google adsense : is there a slotrenderenderevent?

I dont find anything in Google Adsense's documentation : does Adsense has adslotrendered event, like the Google Publishers tag?
Thanks !
No, adsense has no features like this.
Only gpt support slotrendered event.
*** Update
Now AdSense add two tags to its ad units
Depending on whether or not an ad was returned, this parameter will update to one of the following:
data-ad-status="filled" An ad was returned to the ad unit and is now showing.
data-ad-status="unfilled" No ads were returned and the ad unit is empty.
You can check if the ad unit is empty or not by querying data-ad-status
More info: https://support.google.com/adsense/answer/10762946?hl=en

Google Calendar REST API does not return title and other event fields

Google calendar REST API GET method (https://developers.google.com/calendar/v3/reference/events/get) should return this structure (https://developers.google.com/calendar/v3/reference/events#resource), unless I'm missing something.
I need to get event title and description to use in my application. I 'm getting below response instead.
I've tried to change event visibility (public/private) and availability (free/busy). Actually, API does not show events with Free availability, for which I don't have solution either.
Here is event edit screen screenshot:
https://www.screencast.com/t/X8bRS8kJDT
{
"kind":"calendar#event",
"etag":"\"3145149995624000\"",
"id":"5fnlvcl2msab46p8roqbahhb6g",
"status":"confirmed",
"htmlLink":"https://www.google.com/calendar/event?eid=NWZubHZjbDJtc2FiNDZwOHJvcWJhaGhiNmcgZWQtYWRtaW4uY29tXzMwOHNycjdzdjdiM28xazRpdjZ2cm9mb3Y0QGc",
"updated":"2019-11-01T02:23:17.812Z",
"start":{
"dateTime":"2019-11-11T09:30:00+11:00"
},
"end":{
"dateTime":"2019-11-11T10:00:00+11:00"
},
"visibility":"private",
"iCalUID":"5fnlvcl2msab46p8roqbahhb6g#google.com"
}
Are there other methods to get calendar events details with REST API, including ones with free availability?
Thanks.
04/02/2020:
I actually made it work for "ordinary" Google account - add project, add API, add service account and allocate service account email to the calendar. But I still not sure how to change access level for G Suite account. It allows only to see Free/Busy status.
I've changed default access in Admin Console as this article suggests, but it does not help:
https://www.macworld.com/article/2980005/the-mystery-of-the-unsharable-google-apps-calendar.html
You could try specifying the fields you want to retrieve like the image below:
Or you could put a " * " as the image below to retrieve all values:
fields is a standard Query parameter, which specifies what values you want to include in your response. To learn more about it, you can check Here.

How do I know I am being called from a progresive web app?

I've been following the guidance on google to create a PWA, but I am interested if there are any conventions to communicate with your data server that you are being called by a PWA. Is the easiest thing to add a parameter to the request i.e.
var dataUrl = 'https://query.myapi.com/v1/get?source=pwa';
and then check the source parameter? Or should I add to the request header?
In your code
if (window.matchMedia('(display-mode: standalone)').matches) {
// do things here
// set a variable to be used when calling something
// e.g. call Google Analytics to track standalone use
}
** Assumption made that you are also setting up your app to be added to the users home screen as a shortcut
You have to pass in the traffic source to Google Analytics indicating its from PWA. Refer this answer on more details.

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

Google analytics email open tracking with measurement protocol

we tried to track email opens with google analytics and measurement protocol. We exactly followed instructions given in http://www.lunametrics.com/blog/2013/06/17/email-tracking-google-analytics/ and http://dyn.com/blog/tracking-email-opens-via-google-analytics/
The problem is that every email open is counted also as a session which is not correct. Can you give me any advice how we can track opens without recording sessions? Thank you
Every hit in GA always starts a session, so this is not possible. If you don't want it to appear in your normal profile, try setting a pageview with prefix so you can filter them out into a seperate View.
e.g.
/virtual/email-open
Then set up your filters.
Session begins with any interaction. Don't be sad, it is correct.
You can extend your data with some identifier like virtualpagname or whatever and than make segment or filter.
dp=mypage.com
dh=/emailing
dt=Email Gate
You can either use datasource parameter:
ds=email
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#dataSource