Archive for the ‘Technology’ Category
Programmatically Accessing Data from ClickBank.com
Posted by: Greg Lems, VP of Information Technology
Please note: This post is intended for readers with knowledge of web programming.
Some Clickbank clients have expressed the desire to retrieve transaction information from their accounts programmatically. In the future, we expect to implement a web-based solution for programmatic access to client data.
For now, clients who wish to programmatically access their Clickbank account data can do so using a special link on the Clickbank site that creates a CSV file with one day’s worth of transactions from an account. A sample of PHP code which accesses this data is shown below. However, any language which provides http access and session management can be used to access Clickbank account data.
To access Clickbank transaction data, a program must perform two operations:
1) Authenticate by performing an HTTPS POST to https://nickname.accounts.clickbank.com/account/login (note: no trailing slash) and passing authentication information (see example below for specifics).
2) Call the CSV download URL for the desired date. The format of the request is:
https://nickname.accounts.clickbank.com/account/dailyTxnCsv.htm?dt=YYYY-MM-DD
Below is an example of PHP code which authenticates, calls the CSV, then parses the data and prints it out. Make sure to replace ACCOUNT_NICKNAME and ACCOUNT_PASSWORD with your appropriate credentials, and select the date you want (in this example we use 2008-11-06).
<?php
# Get transactions for 2008-11-06
#
$account_nickname = ‘<ACCOUNT NICKNAME>’;
$baseurl = “https:// <https:/> ” . $account_nickname . “.accounts.clickbank.com”;
$login_args = array(
‘j_username’ => $account_nickname,
‘j_password’ => ‘ACCOUNT_PASSWORD’
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_COOKIEJAR, ‘cookie.txt’);
curl_setopt($curl, CURLOPT_URL,
$baseurl.’/account/login’);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($login_args));
$login = curl_exec($curl);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_URL,
$baseurl.’/account/dailyTxnCsv.htm?dt=2008-11-06?);
$csvfile = curl_exec($curl);
curl_close ($curl);
$lines = explode(”\n”, $csvfile);
foreach ($lines as $line) {
if (strlen($line) > 0) {
list($date,$time,$receipt,$tid,$pmt,$txntype,$item,$amount,$publisher,
$affiliate,$countrycode,$state,$lastname,$firstname,$email) = explode(”,”, $line);
printf(”%-20s %s\n”,”Date:”, $date);
printf(”%-20s %s\n”,”Time:”, $time);
printf(”%-20s %s\n”,”Receipt”, $receipt);
printf(”%-20s %s\n”,”Tracking ID:”, $tid);
printf(”%-20s %s\n”,”Payment Type:”, $pmt);
printf(”%-20s %s\n”,”Transaction Type:”, $txntype);
printf(”%-20s %s\n”,”Item:”, $item);
printf(”%-20s %s\n”,”Amount:”, $amount);
printf(”%-20s %s\n”,”Publisher:”, $publisher);
printf(”%-20s %s\n”,”Affiliate:”, $affiliate);
printf(”%-20s %s\n”,”Country Code:”, $countrycode);
printf(”%-20s %s\n”,”State:”, $state);
printf(”%-20s %s\n”,”Lastname:”, $lastname);
printf(”%-20s %s\n”,”Firstname:”, $firstname);
printf(”%-20s %s\n”,”Email:”, $email);
echo “—————\n”;
}
}
?>
Fields returned for each line in the CSV file:
| Column: | Example: | |
| Date | 2007-01-29 | |
| Time | 07:23 | |
| Receipt | 7BXK1N4J | |
| TID | ADSENSE1 | |
| Pmt | VISA | |
| Txn Type | Sale | |
| Item | 1 | (note, this field may also contain alpha characters) |
| Amount | $120.18 | (note, negative amounts appear as $-120.18) |
| Publisher | PUBNAME | |
| Affiliate | AFFNAME | |
| CC | US | |
| St. | WA | |
| Last Name | THOMPSON | |
| First Name | JERRY | |
| JERRY@YAHOO.COM | ||
By using this type of script, you should be able to get all the information you need about ClickBank transactions in your account. Let me know if you have any questions or concerns by leaving a comment.
Finding Inspiration
Posted by: Kristen M., Marketing Communications Manager
For many people creativity doesn’t come easy. Companies use strategies as varied as brainstorming meetings in rubber-padded rooms with beanbags, popcorn parties, and even brainstorming retreats to try to foster creativity and find the next big idea.
We don’t go to quite those lengths here at ClickBank, but I do take steps to cultivate my own creativity. One resource that I find very helpful is the Springwise Weekly Newsletter.
Springwise summarizes new business ideas spotted around the world—everything from maps that allow you to navigate cities by mood to personalized PDF magazines converted from RSS feeds.
Only some of these products are digitally delivered. Other inspired ideas include customized couture helmets and sticky car art.
Almost all, however, are creative solutions to an existing business need. Not to mention, they are certainly fun to read about. So check them out, and get the creative juices flowing for your next big idea.

Keeping Watch Over IT
Posted by: Jeff Leget, Director of Operations
A ClickBank client recently asked me about the tools we use to monitor and secure our systems so that he could learn more about monitoring and securing his own systems. So today I’m writing about some of the simple tools ClickBank uses to secure our servers and how those tools might benefit publishers and affiliates.
First, I think it is important to understand what parts of your technology are integral to your core business and what parts should be outsourced. At ClickBank, we use external outsourced data centers for many of our services. We want to focus our energy on providing innovative solutions that support your business, not building world-class data centers. Many ClickBank clients already outsource their Web services, because creating and promoting great products is their core business. A service provider can offer uptime guarantees, redundant network connections, and much more. These options can make your Web site significantly more complicated if you manage them yourself.
You should make sure that you always have multiple copies of your Web site code, both on and off the Web servers themselves. A disaster with your service provider doesn’t have to be a disaster for you. In addition, your Web site should also be protected from DoS (Denial of Service) attacks. You or your service provider should invest in tools that inspect your Web traffic. Web servers like Apache (with modEvasive or modSecurity) have the ability to handle or dynamically block traffic that doesn’t meet requirements. For example, if you receive 1000 requests in a row to your Web site for pages that don’t exist, the IP address requesting those pages should be blocked.
Regardless of whether or not you outsource facets of your Web site, you should monitor it from at least one external source. In addition to extensive internal monitoring, ClickBank subscribes to several external Web-monitoring services. These services include:
· http://www.alertra.com
· http://www.internetsupervision.com
· http://www.site24×7.com
· http://www.siteuptime.com
There are many others as well. These services often offer free monitoring at low levels (every 30 minutes to 1 hour) from a single location. Any downtime is automatically reported to you via email or text message. Paid subscription services often offer higher monitoring rates from various locations around the globe. Some services allow you to monitor content on the page. This enables you to make sure that your Web site is not hacked or modified without your knowledge. Other services like www.dnsstuff.com allow you to check the completeness of your Web site domain, the associated DNS entries, and potential email blacklists. It is important to make sure that the rest of the world views your Web site the same way you do.
Finally, for publishers, it is extremely important that you protect your product download itself. ClickBank allows each publisher to use the ClickBank Proof of Purchase to ensure that every purchase of your product is legitimate. A description of how to verify the Proof of Purchase, along with the code to perform this action, is available at:
http://www.clickbank.com/publisher_tools.html#Publisher_Tools_7
We work hard at ClickBank to build and maintain a secure and stable platform for our clients and customers. I hope that some of these tips help you to do the same.

Using ClickBank Instant Notification
Posted by: Greg Lems, Director of Application Development
Please note: This post is intended for readers with some experience in programming and Internet servers.
I read once that in the very early days of Amazon.com, Jeff Bezos and his engineers had wired up their server to make a cash-register “ka-ching!” sound every time they made a sale. As business picked up, they had to turn it off because it was going off all the time! It got me thinking whether a fun little widget like this might be something that ClickBank publishers and affiliates are interested in.
To build something that performs an action with each sale, you can use ClickBank Instant Notifications, a feature we enabled earlier this year. This post is about using this ClickBank feature. It assumes that the reader has experience with programming and Internet servers.
IE8 Beta and the Attack on Cookies
Posted by: Jeff Leget, Director of Operations
Microsoft is gearing up for another major release of Internet Explorer. A recent blog post at 5 Star Affiliate Programs discussed concerns regarding this upgrade. Like the recent Firefox upgrade, the new IE8 beta promises to have additional security features that make browsing safer. With each browser release, ClickBank and other Internet advertisers are left wondering how those new security features that make “browsing safer” will affect now-common advertising practices.
At ClickBank, we always try to stay a step ahead of the latest browser releases. We recently tested the IE8 beta and confirmed that it did NOT affect ClickBank affiliate tracking in any way. We performed the same tests on Mozilla Firefox several weeks ago and came to the same conclusion. ClickBank does not use 3rd party cookies to track affiliate commissions. Since the Hoplinks our affiliates are asked to use direct a consumer’s browser to a “clickbank.net” Web address, without the use of popups or embedded tags, ClickBank is able to place legitimate 1st party cookies on consumers’ PCs, for accurate affiliate tracking. When cookies are disabled or otherwise blocked, ClickBank uses other proprietary methods to track affiliate commissions.
The larger issue here is the public’s opinion that cookies themselves are “bad.” Most Web sites today use browser-based cookies to track user preferences, search history, etc. Wikipedia states, “Cookies are also subject to a number of misconceptions, mostly based on the erroneous notion that they are computer programs. In fact, cookies are simple pieces of data unable to perform any operation by themselves. In particular, they are neither spyware nor viruses, despite the detection of cookies from certain sites by many anti-spyware products.” See http://en.wikipedia.org/wiki/HTTP_cookie for more information.
This consumer misconception about browser cookies plagues many online retailers. When consumers blindly disable cookies, online retailers have difficulty providing a targeted and personalized experience to the consumer. ClickBank vendors and affiliates can do their part by making sure they explicitly abide by our privacy policy and refrain from any unscrupulous advertising practices. At ClickBank, we’ll continue to do our part by testing new browser releases, maintaining quality technology, and building a recognizable and trusted brand.
Operate in Real Time with the ClickBank API
Posted by: Dush Ramachandran, VP of Business Development
If you sell or promote digital products through ClickBank, wouldn’t you like to know where your customers are, and what days of the week and times of day they buy your products? With ClickBank’s introduction of the Instant Notification API, whether you’re a publisher or an affiliate you can do all that and more.
The Instant Notification API, or application program interface, provides a way by which information captured at the time of purchase can be provided by the ClickBank system to another computer. If you are signed up to receive instant notifications, you can set up a program on your computer to receive the information that ClickBank sends as soon as a transaction takes place.
Ordinarily, this transaction information is sent to publishers by means of a notification email, which needs to be parsed in order to collect this data. With the API, all of this same information can be collected instantaneously, as each transaction occurs. Additionally, now affiliates can also gather this transaction data as the sale occurs, which was previously only possible for publishers.
With the API and a corresponding data collection program in place on your computer, you can easily determine from which country or zip code most of your sales originate and direct your advertising efforts to media in those markets. You can analyze the times of day that are most popular with your customers and use day part bidding, or Ad Scheduling as Google refers to it (covered in an earlier post by Beau Blackwell), to show your ads at the times when your customers are most likely to see them and make a purchase.
Publishers with multiple accounts can take instant notifications from all their accounts and have the day’s sales aggregated and displayed, showing sales for all of their products across various geographical locations and time zones. Since the API will output information on all transactions, including sales, refunds and chargebacks, this capability can give you a minute-to-minute update on the status of your business through ClickBank.
Please be aware that this service is intended for use by experienced programmers. If you don’t have extensive programming skills, you should consider enlisting the services of a programmer to help you take advantage of the Instant Notification API.
Be sure to check out details on the Instant Notification API and explore how it can give you a better handle on your business.
The New iPhone
Posted by: Kristen M., Marketing Communications Manager
Technology advances and so does your business. A recent post talked about how people’s behavior and uses of search and small screens change on weekends.
Now, with the new $199 iPhone arriving this month and Google’s Android on the way, more pressure than ever will be placed on all cell phone and PDA makers to up their game. Odds are, more and more people will be using the portable device for finding and using information, especially as surfing the Net from these devices becomes faster.
This is going to build more demand for products and services, and not just technology widgets, which can be delivered on that platform. It’s a hot market that is waiting for ClickBank product publishers and affiliates to tap into its potential.
Small Screens
Posted by: Kristen M., Marketing Communications Manager
Businessweek has an interesting story this week about the different Web uses – one on the “big” screens of laptops and desktops and the small screens of PDAs like BlackBerry and the iPhone – and the difference between weekday and weekend usages.
The stats show that people’s habits change away from Google and Yahoo! when they are searching for information on a portable device. The story reports that “The fastest-growing mobile-Web categories relate to weather, entertainment, games, and music.”
Clearly, for product publishers and affiliates, this presents a business opportunity – what is the next generation of products and offerings that will appeal to people on the smaller format?
Seeing Double
Posted by: Jeff Leget, Director of Operations
At home I never want to run out of the daily necessities. There is spare orange juice, in case the first runs out. There should always be spare dog food, in case the first runs out. We need 2 gallons of milk, 2 boxes of cereal, and extra chicken in the freezer…just in case. Yes, the pantry and freezer are usually crowded, but we rarely run completely out.
I’m not sure whether work imitates life or the other way around, but I have the same challenge at ClickBank. As the Director of Operations, I oversee the purchase, installation, and management of our technology. Particularly in the last 2 years, ClickBank has added a lot to the pantry. Today we operate out of 2 geographically separated data center facilities. Each of those has redundant network, power, and cooling. The power and network into each facility enters via 2 different routes. So, if a backhoe operator makes a mistake, power and network keep functioning. If the power goes completely out from the utility company, battery backup systems and generators that are routinely tested automatically kick in, and we keep operating.
We continue this model of equipment redundancy within our computer equipment. We have at least 2 DNS servers within each facility. These systems tell people on the Internet how to locate different ClickBank components (Hoplinks, orders form, web site) by name. We can divert traffic between systems and facilities by manipulating the configuration on these systems. Below that layer we operate on at least 2 load-balancing, cache servers within each facility that provide mostly static content (images, text, etc). Again, we can divert traffic between systems and facilities by altering the configuration of these systems. Below that layer we have 2 or more systems within each facility that answer Internet requests and provide dynamic content (account information, order form content, etc). Below that layer we have a constellation of database systems that store and organize all of the account, product, and price data and synchronize that information across systems and facilities.
A single Hoplink or order form request touches at least 4 different computer systems and countless networking devices before any information is actually returned to a web browser. ClickBank has spent a lot of time designing and maintaining this complex redundant architecture to provide you with the most reliable service available. There will always be incidents outside of our control or complex functionality changes that necessitate short-term outages. Whenever possible, we will notify the ClickBank community in advance. When that isn’t possible, we will always update the ClickBank System Status page at http://www.clickbank.com.xohost.com/status.php. This page is hosted in yet another facility completely separated from the ClickBank service network.
Our goal is to maintain the highest uptime possible to support your business. To that end, we’ll work to make sure the lights are always on, the network is always up, and there is extra orange juice in the fridge.
The Power of Data
Posted by: Greg Lems, Director of Application Development
Here’s a riddle: What travels at the speed of light, takes up virtually no space, and changes constantly, yet is vitally important to ClickBank publishers and affiliates? Data!
The key to being effective as a ClickBank affiliate or publisher is having the knowledge of how one’s efforts to attract and convert customers are faring. Data is the key to this knowledge. In recent months, ClickBank has built functionality to help our clients receive data that is vital to their success as publishers and affiliates.
Starting last year, ClickBank made the “tracking ID” (or TID) functionality available to affiliates. This allows affiliates to pass parameters via their Hoplinks that show up at order time, enabling them to track anything they are interested in. Keywords, campaign names, anything that affiliates adjust to try to improve performance can be recorded in the TID and analyzed after orders have been placed.
ClickBank Analytics (available on the “Reporting” tab of your account) takes TIDs and many other factors into account to provide important data to affiliates. It shows how many Hoplinks have been attributed to an affiliate’s account, and also how many sales have occurred. Affiliates can view this data by publisher, to see which of the publishers they promote have the highest conversion rates. They can also view this data by hour or TID. All data is also downloadable by CSV (comma-separated values) for use in analysis tools or charting packages, such as MS Excel.
Additionally, ClickBank Analytics is useful to publishers as well. They can see how well their pitch pages convert, even breaking performance out by affiliate or hour of day.
Another new data-related feature we recently introduced is instant payment notification (IPN). If you choose to enable it, ClickBank will notify your server on a near real-time basis of every transaction event you were involved in, either as a publisher or affiliate. Programmers can write code to receive ClickBank IPNs and create a whole host of functionality, such as a running total of sales for the day or other dashboard features.
In upcoming releases we plan to build upon the data-related functionality we offer. One feature that has been frequently requested is charting or other graphical functionality on the analytics page. We look forward to hearing more from our community about your data-related needs.
As Director of Application Development for ClickBank, I’m keenly aware that there’s a world of programming opportunities available to our clients who want to analyze their ClickBank data. My job is to make sure people can access it and make good use of it. In upcoming posts, I’ll discuss tips and tricks that programmers can use to interface more closely with ClickBank systems.