1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Adsense User Colors / Editable

Discussion in 'AdSense' started by carterx, Apr 23, 2005.

  1. #1
    This thing I want for Adsense is kind-of hard to explain, so please bare with me.

    You know the basic adsense code?
    It has: ''google_ad_client = "pub-xxxxxxxxx";
    in the code. Since I am running a free-hosting site, my hostees can easily change the ad_client part into their own/mess it up, which of course, I do not want.

    Now, what I want is so that the hostee will be able to get their google ad on their hosted website, without using the ad_client part. The important thing is, that they WILL be able to edit their colors still (borders, background, etc).

    Of course, It's not possible without the ad_client part, so is there any way that It could be somehow be on a different file(that they can't edit), and then include it or something like that?

    Thanks.
     
    carterx, Apr 23, 2005 IP
  2. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #2
    its very very very very easy to do what you want to with php.. probably other languages aswell.

    I am guessing you give them a place to set colors for there site?

    Just give them a place to set adcolor also. just call those variables and insert it into your google code dynamically that way it will ALWAYS match there site and you will never give them access to edit any google code directly.
     
    Shoemoney, Apr 23, 2005 IP
  3. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #3
    for example for php your adsense code-

    This is what i wrote and use for my sites.
    google_ad_client = "pub-xxxxxxxxxxxxxxxxxx";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_channel ="xxxxxxxx";
    google_color_border = "<? print "$googleboarder"; ?>";
    google_color_bg = "<? print "$googlebg" ?>";
    google_color_link = "<? print "$googlelk"; ?>";
    google_color_url = "<? print "$googleurl"; ?>";
    google_color_text = "<? print "$googletext"; ?>";
     
    Shoemoney, Apr 23, 2005 IP
  4. City2

    City2 Peon

    Messages:
    542
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Shoemoney thats a really good idea.
     
    City2, Apr 23, 2005 IP
  5. carterx

    carterx Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks, Shoemoney, but I don't get what you mean.
    But, I believe that in your way, the page must be a .php extension for it to work? I want it to be able to work on almost every type of page.
     
    carterx, Apr 23, 2005 IP
  6. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #6
    sorry.... I guess I misread what your trying to do... Are you hosting peoples webpages but through some means you are making your code display on there pages?

    If so what I sugested above is just to match the color scheme either by letting them select there own colors (probably not) or you could just use the same variables they are using from there preselected colors...

    i think i misunderstood what you are asking sorry
     
    Shoemoney, Apr 23, 2005 IP
  7. carterx

    carterx Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I want the hostees to be able to change their ad colors, yes.
    But, the normal adsense code has my user ID (pub-xxxxxxxxx) on there.
    I don't want that to show up.
     
    carterx, Apr 23, 2005 IP
  8. SHT

    SHT Active Member

    Messages:
    266
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    73
    #8
    Just to remind you, modifying the google code is against the google TOS. ;)
     
    SHT, Apr 24, 2005 IP
  9. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #9
    true and my code doesnt alter it.
     
    Shoemoney, Apr 24, 2005 IP
  10. carterx

    carterx Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I still do not get it. Could you explain the process again?
     
    carterx, Apr 24, 2005 IP
  11. carterx

    carterx Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Does anybody have any other ideas?
    Thanks.
     
    carterx, May 9, 2005 IP
  12. riziko

    riziko Peon

    Messages:
    189
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #12
    First off it is against the TOS to modify the AdSense code.

    What about splitting the AdSense code into two javascript parts?

    In server.js
    google_ad_client = "pub-1234";
    Code (markup):
    on the hostee page (or you could put it in another js file)
    <script type="text/javascript"><!--
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_color_border = "88FF88";
    google_color_bg = "CCFFCC";
    google_color_link = "000066";
    google_color_url = "222222";
    google_color_text = "222222";
    //--></script>
    [B]<script type="text/javascript" src="http://www.freehosting.com/server.js"></script>
    [/B]<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    
    Code (markup):
    This line
    <script type="text/javascript" src="http://www.freehosting.com/server.js">
    calls your js file and sets the value of google_ad_client which should overwrite the value set by the hostee.

    I haven't tested this but it should work. You might need to add some script to the server.js file to test if they have set all of the variables like google_ad_format etc. Something like
    if (google_ad_format == "") {
      google_ad_format = "468x60_as";
    }
    Code (markup):
    I am not a javascript expert so you should check that code out.

    Ross
     
    riziko, May 9, 2005 IP
  13. carterx

    carterx Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Yep, I've tried that.
    It's good, but It's kind of a awkward code, and I'm not even sure it will overwrite the hostee's pub #.
    Hm..
     
    carterx, May 9, 2005 IP
  14. paymentapprovaltooslow

    paymentapprovaltooslow Banned

    Messages:
    1,038
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I have a script that works by rotating the colors. It isn't hard to do, but I don't see why you would need muti colored ads.
     
    paymentapprovaltooslow, May 11, 2005 IP
  15. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #15
    carterx, maybe it would help if you showed us an example of what you want to accomplish. Right now, it does not sound feasible.
     
    mopacfan, May 11, 2005 IP
  16. paymentapprovaltooslow

    paymentapprovaltooslow Banned

    Messages:
    1,038
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #16

    Jimmy carter, we don;t have any other ideas.
     
    paymentapprovaltooslow, May 11, 2005 IP