Looking everywhere for some docs on how to use googleapis with adsense and/or adsensehost (not sure what the difference is... where is this explained?)
Doing this:
const { google } = require('googleapis');
const adsense = google.adsensehost({
version: 'v2', // tried v3, v1... same effect
auth: 'api key here'
});
results in:
ERROR Unable to load endpoint adsensehost("v1"): ctr is not a constructor 16:14:54
Error: Unable to load endpoint adsensehost("v1"): ctr is not a constructor
at Object.getAPI (node_modules\googleapis-common\build\src\apiIndex.js:36:15)
at GoogleApis.adsensehost (node_modules\googleapis\build\src\apis\adsensehost\index.js:22:32)
at Object.<anonymous> (api\server.js:16:24)
at Generator.next (<anonymous>)
Unsure where to go from here.
@madc0w try version 4.1
, this appears to be the version of this API that we're shipping.
Oh! You meant the version of adsensehost, not the googleapis version. Great, so now this works fine:
const adsense = google.adsensehost({
version: 'v4.1',
auth: 'api key'
});
but... this still crashes in the same manner as before:
const adsense = google.adsense({
version: 'v4.1',
auth: 'api key'
});
Can you please tell me what is the proper version of adsense I should be using?
馃憢 I know it's clear as mud, but you can find the version for each API in the corresponding src/apis
directory:
https://github.com/googleapis/google-api-nodejs-client/tree/master/src/apis/adsense
Adsense in this case is v1.4
, I hope this gets you on your feet 馃憤
Most helpful comment
馃憢 I know it's clear as mud, but you can find the version for each API in the corresponding
src/apis
directory:https://github.com/googleapis/google-api-nodejs-client/tree/master/src/apis/adsense
Adsense in this case is
v1.4
, I hope this gets you on your feet 馃憤