Chitika Facebook App PHP Display Function

Posted on July 12th, 2007 in Facebook API, Ambglb Scripts, PPC-Affiliates by jason

Ok since im so big on Chitika being the best option for Facebook apps, im going to share with you all the display function i wrote. This function allow you to serve multiple ads across multiple pages with unique keywords and tracking id’s using just one base include file. all you do is fill in a few vars and everything else including the fbml(facebook markup language/facebooks version of html) to create and size the iframe. Of course it is in PHP so you need PHP support on your server. Ok here we go:

first up is the file named “chitika.php”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
//change $yourid$ to your chitika id in the java script below
$w=$_GET[w];
$h=$_GET[h];
$type=$_GET[type];
$bg=$_GET[bg];
$border=$_GET[border];
$title=$_GET[title];
$text=$_GET[text];
$font=$_GET[font];
$cat=$_GET[cat];
$key=stripslashes($_GET[key]);
$sid=$_GET[sid];
$key=str_replace(',' , '","' ,$key);
?>
 
<script type="text/javascript"><!--
ch_client = "$yourid$";
ch_type = "<?php echo $type ?>";
ch_width = <?php echo $w ?>;
ch_height = <?php echo $h ?>;
ch_color_border = "<?php echo $border ?>";
ch_color_bg = "<?php echo $bg ?>";
ch_color_title = "<?php echo $title ?>";
ch_color_text = "<?php echo $text ?>";
ch_non_contextual = 1;
ch_default_category = "<?php echo $cat ?>";
ch_font_title = "<?php echo $font ?>";
ch_font_text = "<?php echo $font ?>";
ch_sid = "<?php echo $sid ?>";
var ch_queries = new Array("<?php echo $key ?>");
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/mm.js" type="text/javascript">
</script>

make sure you change the “$yourid$” your chitka id, now upload the chitika.php file to your server.

up next is the actual create_chitika function, you can either add this to your apps current function include, create a function.php to include or just add it to a single page. Make sure you change the iframe src from yourdomain.com, to your domain.

1
2
3
4
5
6
7
8
9
//change the iframe src to the url of your chitika.php file
function create_chitika($w,$h,$type,$bg,$border,$title,$text,$font,$cat,$key,$sid){
$bg=str_replace("#","",$bg);
$border=str_replace("#","",$border);
$title=str_replace("#","",$title);
$text=str_replace("#","",$text);
//echo $key;
echo "<fb:iframe src=\"http://www.yourdomain.com/dirname/chitika.php?w=$w&h=$h&type=$type&bg=$bg&border=$border&title=$title&text=$text&font=$font&cat=$cat&key=$key&sid=$sid\" width=\"$w\" height=\"$h\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" frameborder=\"no\" smartsize=\"false\" />";
}

ok no need to really pay attention to that, its basically just taking the data we are about to pass to it, creates the fb iframe and chitika eminimall. ok we are done with the boring stuff and on to the actually inserting the ad on your page.

<?php create_chitika('468','180' ,'mpu' , 'ffffff', 'ff0000' ,'000000', '0000ff' ,'comic sans', '200001', 'iphones,palm treo, palm tx,ipod','facebook_appname' ); ?>

lol dont worry im going to explain how this all works, what that code chunk did was create a 468×180 multi product banner, with a white background and red border, black title, blue text, comic sans font, category 200001, for the products iphones,palm treo
palm tx,ipod all reporting under the facebook_appname tracking channel.

1
<?php create_chitika('width','height' ,'type' , 'background', 'border' ,'title', 'text' ,'font', 'category', 'keyword 1,keyword 2, keyword 3','tracking channel name' ); ?>

ok i made this one easier to understand, below i have broke down what each var is
width== the width of the ad to be displayed
height==the height of the ad to be displayed
type==the type of ad set to mpu for multi product banner or leave empty for normal ads
background== the background color of the ad ie ffffff
border==the color of the ads border ie ffffff
title==the color of the ad title ie ffffff
text==the color of the description text ie ffffff
font==the font style of the ad ie arial
category==the chitika category id number ie 89
keywords== a comma seperated list of keywords you want ads to show for ie ipods
tracking channel name==the tracking name you want the ad to be tracked under in your chitika reports panel

you can also use varibles within the function by leaving off the ‘ ‘ on the var so

1
2
3
4
<?php 
$keywords="keyword 1,keyword 2,keyword 3";
create_chitika('468','180' ,'mpu' , 'ffffff', 'ff0000' ,'000000', '0000ff' ,'comic sans', '200001', $keywords,'facebook_appname' ); 
?>

So now you are armed with the ability to target ads to a user’s profile information, if you are having problems copying and pasting the code you can download the chitika.php and function.php pages below. Next time i’ll show you how to parse a user’s hobbies and intrests into a chitika ad.

Download Chitika Facebook App PHP Display Function Files

Adsense OK With Facebook Apps

Posted on July 12th, 2007 in Facebook API, PPC-Affiliates by jason

Well i was wrong (not the first time i know lol). After debating for a while i decided to email Adsense support to find out if Facebook apps violated the TOS or not. To my surprise the reply i got, gave the go ahead.(btw i received a reply in less than 24 hours).
“…webpage complies with our policies and you’re able to edit the source code of the site to allow javascript, then you’re welcome to place Google ads on your site…”

Pretty cool i must say, so of course i went right to some of my apps to add in some code to see how it would work. As you know we have some fairly popular sites, and our apps are “stored” under one of those domains, so of course at first i got ads themed towards the main domain. No biggie i was thinking that referrals would be a better match anyway, so i created a few and after almost 3 years as an Adsense publisher i know it takes ole googlebot a few page views by a different users to get a grasp on a page, i stuck up some adlinks. Within a day or so the adlinks were themed to facebook,(also the name of the directory they were in). so i added the ad units back in, and low and behold i was getting blocks themed towards facebook. These were just called into the canvas page via the fb iframe method, the page itself wasn’t an iframe. So remember your directory and url structure is going to be important. I have also implemented some tests on pages that are complete iframes with pretty good results as well so far, not as great targeting as a “regular” webpage would have but still pretty good. Though if you want to advertise special products i still think Chitika
and their manually targeting option is the better choice, but nothing wrong with running them both. I’m in the process of putting together a top 5 or 10 Adsense for Facebook tips, ill be posting in the next day or two so keep your eyes open.

How to make money from your facebook application

Posted on June 26th, 2007 in Facebook API, PPC-Affiliates by jason

Probably the most asked question after how to make an app for facebook, is how to make money from a facebook application. Since alot of developers may not be up to speed on what are the best methods on making money online, im going to give it a shot.

Of course there’s the best of the bunch Adsense, but i’m not really sure how the facebook framed pages fit in with the Adsense TOS, my gut instinct is no, but i would bet it would go on a case to case basis depending on the nature of the app.

Right now i think the best bet is probably going to be Chitika and their eminimall PPC ads. With a wide variety of canvas page size friendly banners and fully customizable colors they will fit in nicely in any application layout. And since you pick out which products (keywords) that the ads are on, you can accurately target the ads directly to what your visitors would want. Bringing you even more money than contextual advertising could. You have access thru the API to find out what your users interests and hobbies are, so you already have the data technically. For example say your application is the nascar top 5, with Chitika you can in addition to just general nascar ads, you could fill in the keywords with the drivers name and display ads on merch just for those drivers, or is the users hobby fishing? What’s their favorite movie? Band? All that info is available thru the standard FQL query that gives you the user’s name and id. The limits to what you can target is only how many if/else’s you want to code lol. I have also received permission to use the eminimalls on facebook from Chitika, though they did want to check out the applications first. You also get paid thru paypal on a net 30 basis(you get june’s check the end of july) after accruing just $10.00 in a month.

Get Chitika eMiniMalls
I’m going to list out a few more choices that includes both pay per action (PPA) which is where you are paid per action, like selling a product, or getting a user to submit a form. and pay per impression (cpm) which is where you are paid for each time a visitor views your page, and of course PPC which is where you are paid on a pay per click basis.

PPC - PPA - CPM

Adbrite
PPC - CPM

Text Link Ads Sell text links by the month

shareasale.com PPA - PPC

Axill CPM - PPA

Amazon.com PPA

Commission Junction PPA

Burst Media CPM - PPC

The Golf Shot of My Life

Posted on June 24th, 2007 in Rants and Raves, Geek Stuff by jason

120 yds out, uphill on the Mancation 2007 golf scramble, i believe it was hole 10. Scott hit a wedge, short and left, Brian a 9 iron short and left. Brian tells me to go grab my 8 and hit it. So i do, and it heads right to towards the pin hits the green bounces once and goes out of site. We take the carts up to the green im expecting a 5-10 foot birdie putt, but my ball is no where to be seen. Scott and Brian where it’s either in the hole or off the green, realizing my skill level, luck level and the extremely fast greens i was thinking it was off the green, and turned around to get my wedge. When a shout of IT’S IN THE HOLE comes from behind me. Yes i had sunk it for an eagle to give my team a 2 stroke lead, which we of course ended up losing by 2 anyway. But i was too stoked to care. What was the secret? Due to having a few too many the nite before, i had a slight case of the miller lite flu, i finally gave in and had a beer on the turn, the next hole….eagle.

if you are in kenosha county in wisconsin
http://www.co.kenosha.wi.us/publicworks/golf/brightondale.html
check out this course, while it is laid out someone different now than what the site shows, it is still one heck of a course and at 27.50 per person for 18 and a cart a hell of a deal. You can’t bring your own cooler, but beer girls in carts, and a snack shop on 9 makes sure you have plenty of cold ones be it coke beer or water for your round

New Blog

Posted on June 24th, 2007 in Uncategorized by jason

As you can tell by the dates on the post, i kinda of fell behind here, but since i felt like i needed to do some testing with wordpress as well as giving something back to the community. So expect this to be more of a tutorial type of blog than anything else. Right now i am liking this version of wordpress alot beter than the one i was using before and other than the pain of trying to get code to post i am liking it better than the version of nucleus i was running.