Jul 20, 2008

Smart Php Code -- Firefox Product Referrals - Unit to display either Google Referral Ads / Google AdSense for conten

Free Web Hosting, No Ads > CONTRIBUTE > The Internet > Google Services > Google Adsense / Adwords

free web hosting

Smart Php Code -- Firefox Product Referrals - Unit to display either Google Referral Ads / Google AdSense for conten

Brian Gillingham
If you are like me, you have a Google AdSense account. You would like to get more product referrals for Firefox, wouldn't you?

I wrote some PHP script that will either displays the Google - Firefox Referral" banner to non-Firefox users or your "Google AdSense for content" banner.

If you didn't know, I believe that you only get product referrals for Firefox when a non-Firefox user downloads and installs the program - the target audience is non-Firefox users. This smart script never displays the Firefox referral to Firefox users, but shows the Google AdSense for content ads.

Important: you must configure the parts in the code below to match your google <script> HTML block that you get when you access your Google AdSense account. Also, be notified that all double-quotes have been changed to single-quotes in the separate "echo" blocks.

CODE

<?php

  // SET THESE VALUES!!
  $yourpub = "pub-################";
  $colborder = "2F5F91";
  $collink= "4040DD";
  $col_bg = "F0F2F7";
  $coltext = "3F3F3F";
  $colurl = "008000";


  $browserinfo = $_SERVER['HTTP_USER_AGENT'];

  if ( strpos($browserinfo, 'Gecko') )
  {
    if ( strpos($browserinfo, 'Netscape') )
      $nonfirefox = 'YES';
    else if ( strpos($browserinfo, 'Firefox') )
      $nonfirefox = 'Mozilla Firefox (Gecko/Firefox)';
    else
      $nonfirefox = 'YES';
  }
  else if ( strpos($browserinfo, 'MSIE') )
  {
    if ( strpos($browserinfo, 'Opera') )
      $nonfirefox = 'YES';
    else
      $nonfirefox = 'YES';
  }

  $showit = 1;  // initialize to show the Google Ad
  if ( $nonfirefox == 'YES' ) {
    // change the second parameter below if you want to display the Firefox  
    // product referral less frequently... shouldn't really exceed 10 or so...
    // change random calculation and any comparisons as needed
    $showit = rand(0, 3);
    if ($showit == 3) {
      // display the Firefox Product referral Ad, but give the user a small testimonial
      echo "
      <center>
        <small><font color='green'>I believe they do it better... and they are ahead of the curve.</font>  
        <b>Download the latest version</b>.</small><br>
      </center>
      <script type='text/javascript'><!--
      google_ad_client = '$yourpub';
      google_ad_width = 468;
      google_ad_height = 60;
      google_ad_format = '468x60_as_rimg';
      google_cpa_choice = 'CAAQtYiYhAIaCPydp1XAd3jZKOm293M';";
    }
  }
  if ($showit < 3) {
    // display the Google Ad
    echo "
    <script type='text/javascript'><!--
    google_ad_client = '$yourpub';
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = '468x60_as';
    google_ad_type = 'text_image';
    google_ad_channel ='';
    google_color_border = '$colborder';
    google_color_link = '$collink';
    google_color_bg = '$col_bg';
    google_color_text = '$coltext';
    google_color_url = '$colurl';";
  }
  // common ending for both blocks of Google Ad code
  echo "  
    //--></script>
    <center>
      <script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
      </script>    
    </center>
    <br>";
?>


Of course, you should save this code as a separate unit - "googleads.php" and include it anywhere you want by using an include statement.

CODE
  <?php include "googleads.php" ?>

 

 

 


Reply

Paul
Wow, this a very useful script. This is a great idea. I think that Google should do this by default, show the Firefox referral to browsers other than Firefox!

Thanks.

Reply

Trair
Wow! That's a great idea! I might use it... biggrin.gif Thanks!

Reply

Dooga
Sometimes I just stick with the old javascript that redirects the user to getfirefox.com when they use IE smile.gif

Reply

GrayFox
Aren't they only promotioning the toolbar? or the firefox download too?

Reply

Brian Gillingham
QUOTE(GrayFox @ Aug 14 2006, 05:29 PM) *

Aren't they only promotioning the toolbar? or the firefox download too?


I use a couple blocks of code now - so I have multiple google Adsense promotions handled in that code block. It randomly decides which promo to display. PM me if interested in a new sample of my code.

Reply

delivi
wow thats great code. Yhanx due. I was in need of it.

Reply

Lyon2
Very interesting, original and usefull.

I will try this out, thanks for sharing with us this " "genius" php code"

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : smart php code firefox referrals display google referral ads google adsense conten

  1. Google Premium Publisher - How to become one (3)
    How do I become a premium publisher at google. Yes, I know of the requirements;
    http://www.google.com/services/premium_adsense_overview.html But where do I sign up? Have they
    closed for signups?...
  2. Google Adsense And Getting Banned.... - (39)
    Ok about 5 months ago I got banned from google adsense for invalid clicks. I still deny that but
    could you re-apply. Has anyone ever re-applyed and successful got their account back. They never
    responded to my e-mails. Also anyone know a site like google adsense. Thanks!!...
  3. Google Adsense Exchange Engine - easy way to much earnings (34)
    Hello, GUYZ! What do you think about my newest super idea? I want to create Google Adsense
    exchange engine for all!!! How it will be works? Well.... For example: YOU register in
    it's engine and this engine makes special page for YOU where YOU must input some sentenses with
    populated keywords and YOUR Google adsense CODE for any banner. Then other people register in this
    portal... Then YOU enter to YOUR account at this my engine. Click on special button and will be
    opened new window . Window opened randomly... It's window consist of some sente...
  4. Maximum Adsense Per Day! - The max. cash you've made in a day? (45)
    I'm only a few months old in the Adsense family. I'd really like to know the maximum amount
    you've made from adsense in one day. Just on the lookout for the pros in this joint. Well as for
    me (this is embarrassing!) I have made $3.71 in a single day from three clicks and
    that's a miracle considering my average daily earnings which of couse tends to zero! So
    guys.. tell me about your adventures with Adsense....
  5. How Much Do You Earn With Adsense, - How Long Did It Take And How Many Visitors Do You Get? (9)
    The topic title is pretty self explanitory, How much do you earn with adsense, how long did it take
    and how many visitors do you get? I know there is some sort of regulation where you can't post
    specific information, but please share with me what you can, Thank you. ;-) Edit to shorten Topic
    title, it was messing up the board. ...
  6. How To Make Money With Google Adsense - (14)
    How to Make Money with Google Adsense ? Here are The best Google Adsense Tips and Tricks for making
    more money (profit) from Google adsense program. a. Strictly follow the rules mentioned in Adsense
    policies. You will always earn more revenue from Adsense by playing it clean. b. Never modify the
    Google Adsense HTML code. c. Don't ask your friends or visitors to click on your Google ads. Do
    not include incentives of any kind for users to Don't label the Google ads with text other
    than "sponsored links" or "advertisements.". d. Don't click on your own...
  7. What Is Google Cash Machine? - (7)
    I have heard and got so many advertisements about this thing and I decided as there are so many of
    you using using google adsense you must be knowing what all the fuss is about. so before asking I
    did a lilttle google search and got a vague idea of what this is because all I get is advertisments
    linking me to eBooks telling me how to use the system without telling what it is really about. So
    from what I recall this has got to do something with affiliate programming and that is it. so what I
    am thinking is are you going to advertise your link on google sponsered links an...
  8. Success With Google Adsense - Has anyone had success with making money with google adsense ? (8)
    I would just like to hear from anyone who has used google adsense if they have made any good money
    while using G.A. And if you did have luck what sort of website content do you have on your website
    ?? i'm interested to sart a site and sign up for google adsense but i not tooo sure what type of
    site to build so i just wanted to get a better idea before i go to work on this !

    ...
  9. Google Adsense Search Option Not Working - (0)
  10. Tips On Making Good Money From Adsense - *100%* Working (29)
    Hi guyes.. i came across this site while surfing.. this site has some really good tips about how to
    make your own site & how you can make big profit from you site. I followed documentations in this
    site & now i'm successfully making around 300 - 400$ per month by spending only 15 - 30
    mins online every day! thats why i would like to share it with all you people Site : CODE
    www.satantips.bravehost.com Any quesions regading this are welcome in this topic. I'll glad
    to answer you. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" ...
  11. A Question About Google Adsense - (7)
    I don't usually ads, but when I did it didn't open up a new window or tab for that
    person's website. So my question is.... Is there anyway for me to modify the adsense code that
    allows the ad to open up a new window or tab when being clicked on? Doing this would allow me to
    keep visitors (although not many at all) at my site and won't go wandering off to other ads. ...
  12. Success On Adsense - 5 Quick Tips (6)
    QUOTE As you use Google's AdSense for more and more time you begin to learn from the
    mistakes of the past, and you slowly begin to realize which of your actions kept your site from
    reaching its full potential. But an important part to making a mistake is telling people about it
    and teaching them how to avoid making the same mistake. So this is a list of the top five mistakes
    people using AdSense make. You should read them well, and see if any of them is applicable to your
    contents. If it is, you must stop and attempt to fix such errors as quickly as possible. ...
  13. Adsense Content - (1)
    Does anybody know how or where I can get mass content for my website. Everyone that uses google
    adsense knows that content is a big deal. I'm looking for unique content so I don't get a
    duplicate content penalty. I know I have to write some content. I'm not lazy or anything,
    I'm just looking for any ANY tips, software, or sites that might make it easier to get or write
    content....
  14. Google Adsense Is Good - Google Adsense (64)
    Why not use that u put their ads on your site and every time someone clicks the ads you get money
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Hope it helped,
    /rolleyes.gif' border='0' style='vertical-align:middle' alt='rolleyes.gif' /> RECOMMENDED LINK :
    http://www.astahost.com/google-adsense-suc...ense-t2867.html - OpaQue...
  15. Adsense And Adwords Related - More of a theory than actual facts (2)
    Hi people, Well, I've had an average income on adsense of about X / day for the last few
    months. I have a very very low CTR , so I mainly get this income from the about a million pageviews
    / day Anyways, 7 days ago I started using adwords, and here are some funny observations; Day 1:
    Adwords budget of X usd/day ==> Adsense income: Y$ Day 2 - 6: Adwords budget: X+20 usd /day ==>
    Adsense income (each day) ~ 30% increase Day 7-8: Adwords budget: X+40 usd/day ==> Adsense income:
    60% increase Does anyone know if this is coincidence? Or how this work? I have a ...
  16. Adsense Earning Is Just Made Easy - (2)
    Many people have been thinking that just registering with adsense and place the ads on your website
    you will earn money.I know many people thinking them will earn lots of money by just having there
    ads on.I will give you some advice about adsense. You get your adsense approved them when you put
    your ads on your website it is the best the use the 336 x 280 rectangle between your text.Many
    people say its the best adsense format to earn money.Don't forget to melt to ads with your
    template of your blog or website.Its best.Then after that you make some directory promotion...
  17. Against Google Tos? - just an idea (9)
    Is it against Google TOS if i create site with nothing on it, only Google pay for search bar and
    tell my friends to use it instead of Google.com example: i create www.musiconly.com and have only
    search bar on it. instead of google.com as their homepage my friends or other people use my site as
    search....
  18. Google Adsense,bidvertiser,clicksor More - how do you rate these site? (7)
    I have searched around a I see a lot of site about adsertising here.Some of them are google adsense
    ,bidvertiser,adbrite,clicksor ,Adhearus( at this point I can't go to this site because it down
    or not avalible) and a lot more However I just wonder that google adsense at number one on the net
    in this field.How about the second one,third one.If anyone have experience about this please tell me
    about it. If you can please make a rate for those....
  19. Q About Adsense - I had my account suspended because of my own stupidity and now.. (11)
    Well, I **accidentally** clicked once on my ads and my account was suspended (I had about 200$
    in it, not really much but whatever /smile.gif" style="vertical-align:middle" emoid=":)"
    border="0" alt="smile.gif" /> )...I`ve sent them an email to explain them that it was an
    accidental click, but they wouldn`t listen /smile.gif" style="vertical-align:middle" emoid=":)"
    border="0" alt="smile.gif" />..so that account is lost 4ever.. Now about my problem: I`ll soon
    finish building another site (new content-nothing to do with the previous)..and I want to p...
  20. Should I Get Adsense? - Will it even pay off? (17)
    I was thinking about getting it, but i don't know of anyone that makes any money what so ever on
    there. Youd have to be like Myspace to make decent money. Another question is it worth all the work
    to sign up? My last question is just should i get it. I would put it on my 2 sites
    http://ojproductions.net and http://carpetboarding.2hell.com I get a good amount of vistors, but
    not a lot. P.S. could i put it on my myspace page?...
  21. Google Adsense Bugs - AdSense Referral Units are NOT displayed... (4)
    Hi The Google AdSense Referral Ads are not displayed in my blog last 5 days. The Tech Support Team
    says " We Apologize for your inconvenience. Currently we are upgrading our AdSense ... - The total
    AdSense Network is under testing... - Please be patient... - Check status updates on Inside AdSense
    blog. This is the summary of mail i received today from AdSense Support Team. :)...
  22. Big Adsense Secrets - Really Works (14)
    QUOTE Let me before starting this topic tell you that im not in the top adsense earner or the so
    called premium advertisers, but i do have a decent income from google adsense program. Its very
    simple to earn good money from this program. Your 15 year old kids are earning 2000$ monthly
    from it, so why cant you. Its a myth that to you got to know all the technical stuff and should be
    a programming guru to earn off that much from google adsense. Its totally unrealistic, but all the
    premium publisher or atleast most of them are general site owners with basic or ama...
  23. Making More Money With Adsense - (3)
    I have been stepping in getting money with adsense small by small.You won't make money with
    google fast.That's my own experience again. QUOTE Google wants a slice of your traffic and
    they're willing to pay big bucks!For those who have been complaining of high traffic and low
    sales, there's simple no better way to cash in on those hard-eaned visitors to your web pages.
    Adsense makes it so easy! There's no complicated software to install, no need to scout for
    affiliate, nothing to buy and no need to even have a merchant account.So... Why isn&...
  24. Can You Trace The Owner Of An Adsense Account? - (1)
    Does anyone know if you can trace the owner of an adsense account? Reason I ask is someone had some
    work done on their site and a while later realised the adsense channel had been changed, now the
    person who worked on the site denies it was them, but if it could be traced that might help or prove
    the case....
  25. Does Anyone Know How To Change Adsense Code Sript? - (1)
    I have been using adsense fr sometime but I want to know how I can change the script like make the
    text appearing like normal melted text.I want to mix the text with my article....
  26. There Is A Bug In 'adsense For Search' - Requires working knowledge of Javascript and HTML (6)
    I am sure many of you would have used Adsense for Search. You include Google Search in your site.
    Someone comes along and does a search for some XYZ . He finds an ad interesting among those results
    and he clicks. Voila!!! You get paid!!! Very convenient!!! I
    have been using this for sometime now and yesterday, I discovered a bug. Remember the code, that
    Google asks you to paste in your site in order to use Adsense Search CODE <!-- Search
    Google --> <center> <form method="get" action="http...
  27. Adsense Issues - (2)
    I'm thinking of getting AdSense but I have a few queries: -Is AdSense entirely free? -Can Google
    access any of your information? -How much, on average, do you get per click? Thanks, MiniK...
  28. Adsense Tax - A question about Google Adsense taxes (6)
    Well i'm new to adsense and i think my first 4 days was a big success Well believe it or not
    (its up to you), i made $60.00 in the starting 4 days with Adsense. I'm about to submit my
    tax information because its almost the 15th but i see that you have to pay taxes with Adsense. Is
    this true? do i have to pay taxes with adsense and how does the w9 work? I'm new to Adsense and
    web advertising. So my question is Do you have to pay taxes from adsense? and how do they take this
    money out of you?...
  29. In Some Cases Google Doesn't Pay. - So my friends say (17)
    Some friends of mine, tell me that when they have some money tio take out they acouunt is deleted
    /blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> thing that
    is unfair I think the posting member means: Some friends of mine told me that when they tried to
    take money out of their Google account, the account had already been deleted and I think that is
    unfair of Google to do that. ...
  30. Limited Advertising Budget With Adsense Adwords - (1)
    yeah lets say i want to use $50 to advertise my site but thats all i have unless it works and i
    get more money from it so after 1 month can i cancel right away? Topic title is very important. If
    you do not know how title should be made please give me a PM. ...



Looking for smart, php, code, firefox, product, referrals, unit, display, google, referral, ads, google, adsense, conten

Searching Video's for smart, php, code, firefox, product, referrals, unit, display, google, referral, ads, google, adsense, conten
advertisement



Smart Php Code -- Firefox Product Referrals - Unit to display either Google Referral Ads / Google AdSense for conten



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE