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

A brief overview of the Top 3 PPC programs

Posted on August 14th, 2006 in PPC-Affiliates by jason

I figure the best way to kick off this section is to give a brief overview of the best 3 pay per click programs i have used. I will follow up with a more detailed reviews of each program in the coming weeks, but this should help get you started on learning what each program is.

First up is Google’s Adsense


Easily the best program out there hands down, simple and easy to use, all you have to do is copy and paste the code their wizard generates into your web page, and Google takes care of the rest by delivering advertisments based on your pages content. So a page on digital cameras will yield ads about digital cameras.

Up next is Chitika and their eMiniMalls program,


Get Chitika eMiniMalls

this program is unique in that it allows you to manually select specific products or general categories of products, so if you have a page about a certain type of cell phone, you can display ads for that exact cell phone, or if your page is about say college dorms, you could target products popular with college students like ipods, ipod accessories that would be unavailable thru contextual based advertising like Adsense or Ypn. I have even done some testing using geoip technology to deliver geo-located ads with it wth decent results.

Last we have Adbrite,



this program is cool due to the fact, that you are actually selling the ads directly to an advertiser, and setting the prices yourself. They also have in house ads that display when you have no active ads, depending on the subject, these in house ads can be quite relevent. They also have a feature called Active Interstitials, that really pays out quite nicely.

you may have noticed i have left off Ypn or Yahoo’s ad network, that is because it is in beta and very hard to get into, and i dont want to waste time reviewing a program that a normal site owner cant get in. I will post a few articles on the head to head testing i did between Adsense and Ypn (Adsense wins hands down) but wont focus too much on it untill it goes out of beta