Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to display AdMob ads (or other ad provider) in pure JavaScript

Is there any way to display AdMob ads using only pure JavaScript? Or in any other way, that I can use it directly in PhoneGap application built with PhoneGap Build?

I'm developing mobile apps using PhoneGap. I've seen many solutions and approaches to this problem (like this or this). But since I'm using PhoneGap Build only, I can't use any of it. I've seen AdMob Cordova Plugin, but since it is platform-oriented (currently only available for iOS and Android) and has a lot of Java and SDK in documentation, I'm pretty sure, that I can't use it in app compiled with PhoneGap Build.

If there is no way to get AdMob via JS, then maybe there is another ad provider, which API is reachable entirely from JavaScript?

I've heard that MillenialMedia can display ads using pure JavaScript and even allows external ads providers (like AdMob). So this would be a perfect solution for me. But their page is so poorly organised (a lot of self-marketing bla-bla and no actual links to some API, examples or docs, at least no, when you're not logged in), that I can't confirm that it supports both JavaScript and AdMob. Does someone have any experience with this system and can confirm this?

like image 497
trejder Avatar asked Feb 12 '13 21:02

trejder


People also ask

Is there a way to get AdMob via JavaScript?

If there is no way to get AdMob via JS, then maybe there is another ad provider, which API is reachable entirely from JavaScript? I've heard that MillenialMedia can display ads using pure JavaScript and even allows external ads providers (like AdMob). So this would be a perfect solution for me.

Why are my ads not showing up on AdMob?

Test your implementation code to check that ads can show. If your ad implementation code is not correct, ads won’t show. Have you reviewed your error codes? Learn more about the most common error codes for Android and iOS . Review the AdMob community post on error codes for more troubleshooting tips.

What happens if my account is not approved by AdMob?

You’ll be notified via email if your account is not approved by AdMob. Is your app or ad unit new? Wait up to one hour after you create an app or ad unit. In some cases, it can take a few days for ads to appear in new apps or ad units.

How do I test my AdMob mediation setup?

Verify your mediation setup with the Mediation Test Suite. It’ll test whether you’ve correctly configured your app and ad units to display ads from third-party networks via AdMob mediation. Each ad network has its own integration instructions ( Android, iOS, Unity ).


1 Answers

tl;dr Displaying mobile ads using pure Javascript:

  • AdMob: no,
  • mMedia: no,
  • AdSense: no (details),
  • MobFox: yes.

I've been through this for long while and your request (JavaScript code) unfortunately is not available neither with mMedia nor AdMob.

mMedia : They have the following source code types for a mobile web site ( not android app ): ASP, Perl, PHP, JSP5, ruby on rails, and vb.net. to get the source code you need a mobile web site and the mobile web site has to be approved by mMedia then you get live ads and I guess if you used the source code of website in your android app they will have the account suspended because in mMedia every project has to be approved first so they expect their ads are displayed on the project they approved on. And there is no JavaScript code as you requested anyway. mMedia will provide with sdk and instruction to download and install in your app off course live ads would be displayed after their approval and I guess that what you don't want.

AdMob: It is little bit confusing reading about them , because in the past they used to serve ads through JavaScript method intended for mobile web site but after google buying the company they removed this and AdMob doesn't serve mobile website any more and for mobile web site they advise you to use AdSense. what confusing about it that there is still instruction for installing AdMob JavaScript which doesn't exist any more. I saw your links and I guess you where trying to install AdMob for iOS app. I did it for Android app which was straight forward and it was easy using In-App-Advertisements, but the problem was what ever I try it shows on the bottom.

AdSense: they have the JavaScript way but they don't allow you to use it on mobile apps and if they find out they will have your account suspended (details).

for MobFox: they serve ads for mobile web site and the source code types for mobile web site are : JavaScript, PHP, cURL, PHP, fSocket, J2SE 1.4, CGI/Perl and ASP.NET. and for application you have to download the SDK. but there is nothing states in MobFox the you can't use their JavaScript for mobile app and they work like google once you are approved you get Publisher ID and do what ever you want without breaking their terms. Unlike mMedia they have to approve every thing first. And they have the Ad network mediation option for the following companies 4INFO, Aditic (Sofialys), Adfonic, AdMarvel, Admoda, BuzzCity, Hunt, Mobile Ads, InMobi, iVdopia, JumpTap, Komli Mobile (ZestAdz), Lumata Group(bMobile), m-perf, Madvertise, MdotM, MobGold, MobPartner, Mocean, Mojiva, Nexage Exchange, Smaato, TapIt!, Vserv, WapStart, YOC Performance (Mocean Platform), YOC Performance (Ubiyoo Platform)

As far as my research goes the only choice you have for JavaScript code would be with MobFox and you need a way to get the approval so you would have a publisher ID. I had a mobile web contains 4 pages with a little traffic like 20 per day and I got their approval.

like image 144
lotav Avatar answered Nov 15 '22 08:11

lotav