我正在深入创建一款即将发布的手机网页游戏。我有兴趣通过这个应用程序获利。我希望游戏感觉就像是一个常规应用程序,因此希望有 admob 广告(带有指向应用程序商店的深层链接)。我听说这些的每千次展示费用也比 Adsense Mobile 高得多。我的问题是:如果我使用node.js“移植”admob,点击和查看次数是否会被记录为服务器端(即来自一个地方)或移动设备(即来自用户)?
以下是我正在考虑使用的一些资源:
https://media.admob.com/api/v1/docs/
https://github.com/floatinghotpot/cordova-plugin-admob
有什么想法吗?
最佳答案
我是您提到的插件的作者:https://github.com/floatinghotpot/cordova-plugin-admob
基础版已弃用,推荐使用专业版:https://github.com/floatinghotpot/cordova-admob-pro
您可以考虑使用 Cordova 将您的 html5 游戏打包为混合 APP,然后发布到 Apple AppStore 或 Google Play Store,而不是将 AdMob 移植到移动网络。
使用 AdMob 插件在您的应用中展示广告,然后 Google 会向您付费。
只需几行 JavaScript 代码即可呈现广告,AdMob SDK 将负责广告呈现和用户点击。
查看示例代码:
function onLoad() {
if(( /(ipad|iphone|ipod|android|windows phone)/i.test(navigator.userAgent) )) {
document.addEventListener('deviceready', initApp, false);
} else {
initApp();
}
}
var admobid = {};
if( /(android)/i.test(navigator.userAgent) ) {
admobid = { // for Android
banner: 'ca-app-pub-6869992474017983/9375997553',
interstitial: 'ca-app-pub-6869992474017983/1657046752'
};
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
admobid = { // for iOS
banner: 'ca-app-pub-6869992474017983/4806197152',
interstitial: 'ca-app-pub-6869992474017983/7563979554'
};
} else {
admobid = { // for Windows Phone
banner: 'ca-app-pub-6869992474017983/8878394753',
interstitial: 'ca-app-pub-6869992474017983/1355127956'
};
}
// it will display smart banner at top center, using the default options
if(AdMob) AdMob.createBanner( {
adId: admobid.banner,
position: AdMob.AD_POSITION.TOP_CENTER,
autoShow: true } );
关于node.js - 将 Admob 移植到移动网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30547980/