element and the first 10 elements. The contents of the
element (if present), is used to describe the post and the micro-affiliate may also enter some additional text. The micro-affiliate may additionally select one of the 10 images (if present), to be included along with the text.
After clicking the Share button, the following item will be posted to the micro-affiliate's wall on Facebook and will be sent to all the micro-affiliates friends.
5
When a micro-affiliate's friend clicks the image or the title, they are taken to the page referenced by the affiliate URL on the www.ski-news.com site. Ski-news must use server-side code to process the URL to recover the product and micro-affiliate information. In this example the review of interest is referenced by the 'review' parameter and the micro-affiliate id is held in the 'aff' parameter as always.
Constructing the sales page
Having recovered the review id and the micro-affiliate id, it should be a relatively simple matter to create a custom sales page using any server-side language such as PHP or Java.
In this example the promotional teaser is similar to that presented earlier but the data behind the buy button (in this case the 'Read now EU 50¢ link), is different because CarrotPay must be informed that the micro-affiliate is to receive 15% of the sale. This is achieved by changing the 'price' attribute of the JavaScript Carrot.pay() function. For a normal sale the price attribute would be set like this: price : "0.5:EUR"
When a micro-affiliate is included the price attribute needs to be changed to: price : "0.425:EUR+0.075:EUR:BMWM-VJQB-LVJC-HKQW"
This tells CarrotPay to take a total of EUR 0.5 and credit the site merchant with EUR 0.425 and credit EUR 0.075 to the micro-affiliate with id BMWM-VJQB-LVJC-HKQW. NOTE: When checking the authorisation hash which is returned from CarrotPay, the price attribute is included in the calculation. If micro-affiliate(s) are included in the price, then the hash will be calculated differently for each different micro-affiliate. For this reason be sure you can recreate the price attribute exactly as it was sent to CarrotPay.
5 Case study: CarrotBid – a Facebook application
CarrotBid is an auction application hosted on Facebook and uses share-n-earn to promote itself. As individual bids on any given auction only cost 10¢, micro-affiliates are offered a bigger incentive by earning the value of 20% of all the bids made by a new customer for the first year. Unlike in the example above, this case requires that the micro-affiliate id is recorded against each new customer's account as they register. It also requires that the price attribute is constructed with the micro-affiliate's id for every sale to that customer during the first year. This case is further complicated by the fact that the application accepts two currencies (USD and a virtual currency called #BID), as we shall see. 6
share-n-earn Button The S-N-E button is always the same as it's intended to promote the whole site rather than a particular piece of content. data-cobrand="Carrot.org" data-link="http://www.carrot.org /carrotbid/share-n-earn.php">
●
data-scheme points to a static html page which simply describes the affiliate scheme for the benefit of a potential affiliate.
●
data-earn is an one-line summary of the scheme.
●
data-title is the full name of the application.
●
data-cobrand is the company domain.
●
data-link points to a PHP function which reads the micro-affiliate id from the URL and stores it in a non-persistent cookie. It then redirects the page to the CarrotBid application. It does it this way because Facebook manages the environment that the application runs in and the user's Facebook id is not available until obtained through the Facebook API. The full source code of this PHP function is shown in Appendix A.
7
Publishing the link
When the micro-affiliate posts the link on Facebook they will be presented with the following page. They can enter some text to further encourage their friends to follow the link, and choose one of the images to display from the 10 available. This post will then be published by Facebook to the news feeds of the micro-affiliate's friends.
Accessing the link from a news feed
The published news feed item is much like any other and is intended to take the user directly to the CarrotBid application.
However, if this is the first time for a user to access the CarrotBid application, Facebook requires them to grant permission for CarrotBid to access their personal data, otherwise they are taken directly to the application. When a new user to CarrotBid clicks the image or the title of the post, they are taken first to an authorisation page (as above), and then to the home page of the CarrotBid application (via share-n-earn.php).
8
The CarrotBid application determines if this is a new user and if so it checks for the presence of a 'referrer' cookie (as stored by share-n-earn.php). If set the referrer indicates the id of the micro-affiliate and this is stored in a newly created user record together with the global settings for the agreed micro-affiliate split percentage and the expiry data of the agreement (currently set at 15% and 365 days). NOTE: By storing these values in the user record the global values may be updated from time to time without affecting already established micro-affiliate agreements.
User purchases
The final piece of the puzzle is to calculate the price attribute when a user makes a bid (see A ppendix B for full source code). The principal is simple enough; split the original price into two parts and add an affiliate id to the affiliate part. In this case we have the further complication that CarrotBid accepts #BID tokens as well as USD. The none-affiliate price is: 1.0:#BID;0.1:USD
This indicates that an acceptable payment to register a bid is #BID1.0 OR USD0.10. When we add the affiliate id we get: 0.8:#BID+0.2:#BID:BMWM-VJQB-LVJC-HKQW;0.08:USD+0.02:USD:BMWM-VJQB-LVJC-HKQW
NOTE: An implication of the above is that the affiliate may receive #BID tokens as payment as well as USD. In this case any #BID tokens can only be spent on CarrotBid auctions whereas the USD may be spent 9
anywhere. NOTE: Since the introduction of SiteCoins, there is also a need to add a price_sig parameter to each payment request. See ….
Appendix A – A PHP generated page that processes an affiliate URL < ?php /* share-n-earn redirection page Filename: share-n-earn.php Authors: Jason 2010-12-22 The purpose of this function is three fold: 1) To transfer the affiliate id to a cookie. 2) To pass a title, description and image selection to Facebook/other 3) To redirect to a specific auction if indicated by an auctionID parameter At the time when the link is about to be posted, Facebook/other may pick up some meta data from the header. However in test we found that Facebook more reliably picked up first
and elements from the body.
*/
This d ata is apparently aggressively cached by Facebook so we cannot readily change it from i nstance to instance.
include 'globalVariables.php'; include 'utils.php'; $referrer=$_GET["aff"]; $auctionID=$_GET["auctionID"]; /*
Store the referrer and a uctionID in the u ser's cookie so that it can b e found i f a new user record is created C ookie expiry is q uite short in case the user d oes not c omplete
*/ setCookie("referrer",$referrer,time()+300); setCookie("gotoauction",$auctionID,time()+60); /*
*/
Apparently Facebook will not pick up the meta-data from this page if we redirect with a header Location line like this - header('Location: '.$facebookHome); Instead we use Javascript to redirect once the page loads. In order to hide the images on the page we use css to hide them.
?>