Combine admob with other ad networks

Started on the old forum in May 2011 · view the original in the archive · old links redirect here

23 replies · 1,680 views · started 15 years ago · 1 min read

TL;DR · summary of 23 replies
  • Khan clarified that combining AdMob with another ad network is not against their rules.
  • To replace AdMob ads with MobAds3, a new variable should be added and the last lines of code for AdMob replaced accordingly.
  • Changing AdMob's text link to include another ad network like MobAds3 may cause both ads to show due to parsing issues.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

8 participants
Petar Raznatovic Junior · 25 posts #1

Hello, can somebody tell me is allowed to combine admob with other ad networks, beause of its fillrate? Thanks.

kei_ki7 Senior · 431 posts #2

Do you mean Ad Rotator?

Did I help you? You can help me too Your donations will help me finance my studies.

Petar Raznatovic Junior · 25 posts #3

Combine admob with other ad networks

I thought something like this:

if (isset($admob_request)) echo $admob_request;
else $other_ad_request;
khan Lead · 681 posts #5

Petar Raznatovic wrote: Anybody ?

<?
#ADMOB USES MODIFIED FOR USING ANOTHER COMPANYS AD WHEN ADMOB AD ISNT SHOWING.#
function mobads()
{
$mob_mode = "live";
$admobcode = "UR ADMOB ID/CODE";
$mob_alternate_link = "<a class='' href='http://blog.hitnhot.com'>Evaan's Blog</a>";
$mob_ua = urlencode(getenv("HTTP_USER_AGENT"));
$mob_ip = urlencode($_SERVER['REMOTE_ADDR']);
if($mob_mode=='live')
$mob_m = "&m";
$mob_url = 'http://ads.admob.com/ad_source.php?s='.$admobcode.'&u='.$mob_ua.'&i='.$mob_ip.$mob_m;
@$mob_ad_serve = fopen($mob_url,'r');
if($mob_ad_serve)
{
	while(!feof($mob_ad_serve))
	$mob_contents .= fread($mob_ad_serve,1024);
	fclose($mob_ad_serve);
}
$mob_link = explode("><",$mob_contents);
$mob_ad_text = $mob_link[0];
$mob_ad_link = $mob_link[1];
if(isset($mob_ad_link)&& ($mob_ad_link !=''))
$ret = "<a class='' href='$mob_ad_link'>$mob_ad_text</a><br />";
else
$ret = $mob_alternate_link;
return $ret;
}
?>
slowy Senior · 357 posts #6

khan wrote:

<?
#ADMOB USES MODIFIED FOR USING ANOTHER COMPANYS AD WHEN ADMOB AD ISNT SHOWING.#
function mobads()
{
$mob_mode = "live";
$admobcode = "UR ADMOB ID/CODE";
$mob_alternate_link = "<a onclick="_gaq.push(['_trackEvent', 'Outgoing', 'blog.hitnhot.com', '']);" rel='nofollow' class='' href='http://blog.hitnhot.com'>Evaan's Blog</a>";
$mob_ua = urlencode(getenv("HTTP_USER_AGENT"));
$mob_ip = urlencode($_SERVER['REMOTE_ADDR']);
if($mob_mode=='live')
$mob_m = "&m";
$mob_url = 'http://ads.admob.com/ad_source.php?s='.$admobcode.'&u='.$mob_ua.'&i='.$mob_ip.$mob_m;
@$mob_ad_serve = fopen($mob_url,'r');
if($mob_ad_serve)
{
	while(!feof($mob_ad_serve))
	$mob_contents .= fread($mob_ad_serve,1024);
	fclose($mob_ad_serve);
}
$mob_link = explode("><",$mob_contents);
$mob_ad_text = $mob_link[0];
$mob_ad_link = $mob_link[1];
if(isset($mob_ad_link)&& ($mob_ad_link !=''))
$ret = "<a class='' href='$mob_ad_link'>$mob_ad_text</a><br />";
else
$ret = $mob_alternate_link;
return $ret;
}
?>

its showing blank page

khan Lead · 681 posts #9

then just change this line

 $mob_alternate_link = "<a class='' href='http://blog.hitnhot.com'>Evaan's Blog</a>";

to

$mob_alternate_link = mobads2();
Petar Raznatovic Junior · 25 posts #12

Combine admob with other ad networks

I think you didnt understand my question 🙂 I wanted to ask is it against their rules to use another ad network parallel to their 🙂 Thanks.

khan Lead · 681 posts #15

slowy wrote: code is working perfectly 😉 if i want to use another ad network like mobads3 then what should be the code?

add another variable for mobads3(); like

$mob_another_ads= mobads3();

then change the last couple lines to

else if
$ret = $mob_alternate_link;
else 
$ret = $mob_another_ads;
return $ret;
Nega Developer · 50 posts #16

Petar Raznatovic wrote: I think you didnt understand my question 🙂 I wanted to ask is it against their rules to use another ad network parallel to their 🙂 Thanks.

No, It is not against their rules. 🙂

Mobtron.com - build Free mobile site and earn from ads! WapEgo.com - Best mobile communities builder

khan Lead · 681 posts #18

slowy wrote: if i m changing admob's text link like this

$ret = "<a class='' href='$mob_ad_link'>FREE MOBILE DOWNLOADS</a><br />";

then both ads are showing admob's ads and alternative ad and admob's fill rate increased y is it so????

if they found you that u are changing link name, your a/c may be banned. jara sambhalke bro...

slowy Senior · 357 posts #20

if i m including a php in alternative link then why both ads r showing

<?
#ADMOB USES MODIFIED FOR USING ANOTHER COMPANYS AD WHEN ADMOB AD ISNT SHOWING.#
function mobads()
{
$mob_mode = "live";
$admobcode = "0000000000000000";
$mob_alternate_link = include("mobgold1.php");
$mob_ua = urlencode(getenv("HTTP_USER_AGENT"));
$mob_ip = urlencode($_SERVER['REMOTE_ADDR']);
if($mob_mode=='live')
$mob_m = "&m";
$mob_url = 'http://ads.admob.com/ad_source.php?s='.$admobcode.'&u='.$mob_ua.'&i='.$mob_ip.$mob_m;
@$mob_ad_serve = fopen($mob_url,'r');
if($mob_ad_serve)
{
    while(!feof($mob_ad_serve))
    $mob_contents .= fread($mob_ad_serve,1024);
    fclose($mob_ad_serve);
}
$mob_link = explode("><",$mob_contents);
$mob_ad_text = $mob_link[0];
$mob_ad_link = $mob_link[1];
if(isset($mob_ad_link)&& ($mob_ad_link !=''))
$ret = "<a class='' href='$mob_ad_link'>$mob_ad_text</a><br />";
else
$ret = $mob_alternate_link;
return $ret;
}
echo mobads();
?>

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close